From ecd6efd4fd172cbb0485cc73bfdcbd9f0a7670ac Mon Sep 17 00:00:00 2001 From: Roman Timashev Date: Fri, 2 Aug 2019 16:23:41 +0300 Subject: [PATCH] teacher title --- pages/teacher/[person].jsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pages/teacher/[person].jsx b/pages/teacher/[person].jsx index f0461d8e..9210b0f6 100644 --- a/pages/teacher/[person].jsx +++ b/pages/teacher/[person].jsx @@ -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} > + + {props.title} +
{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(' ') } }