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