teacher title
This commit is contained in:
1 parent
7c3f3542ac
commit
ecd6efd4fd
1 file changed
+6
@@ -1,5 +1,6 @@
|
||||
import React from 'react'
|
||||
import axios from 'axios'
|
||||
import Head from 'next/head'
|
||||
import App from '../../src/components/App'
|
||||
import Page from '../../src/components/Page'
|
||||
import menuModel from '../../src/models/menu'
|
||||
@@ -11,6 +12,9 @@ const Index = (props) => (
|
||||
showAuthor={true}
|
||||
menuPadding={true}
|
||||
>
|
||||
<Head>
|
||||
<title>{props.title}</title>
|
||||
</Head>
|
||||
<div className="content content_thin">
|
||||
<Page shareable={true}>
|
||||
{props.person.post}
|
||||
@@ -25,10 +29,12 @@ Index.getInitialProps = async (ctx) => {
|
||||
const apiUrl = `http://localhost:3000/api/persons/${id}`
|
||||
const res = await axios.get(apiUrl)
|
||||
const person = res.data
|
||||
const name = person.name || []
|
||||
|
||||
return {
|
||||
pageUrl,
|
||||
person,
|
||||
title: name.join(' ')
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user