computer-scienceangular-roadmapbackend-roadmapblockchain-roadmapdba-roadmapdeveloper-roadmapdevops-roadmapfrontend-roadmapgo-roadmaphactoberfestjava-roadmapjavascript-roadmapnodejs-roadmappython-roadmapqa-roadmapreact-roadmaproadmapstudy-planvue-roadmapweb3-roadmap
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
823 B
33 lines
823 B
import Error from "next/error"; |
|
import GuideLayout from 'layouts/guide'; |
|
import { serverOnlyProps } from 'lib/server'; |
|
import GuideHeader from 'components/guide-header'; |
|
import GuideBody from 'components/guide-body'; |
|
import ShareGuide from 'components/share-guide'; |
|
import GuideFooter from 'components/guide-footer'; |
|
import { getRequestedGuide } from "lib/guide"; |
|
|
|
const Guide = ({ guide }) => { |
|
if (!guide) { |
|
return <Error statusCode={404} /> |
|
} |
|
|
|
return ( |
|
<GuideLayout> |
|
<GuideHeader guide={ guide } /> |
|
<GuideBody> |
|
<guide.component /> |
|
<ShareGuide guide={ guide }/> |
|
</GuideBody> |
|
<GuideFooter guide={ guide } /> |
|
</GuideLayout> |
|
); |
|
}; |
|
|
|
Guide.getInitialProps = serverOnlyProps(({ req }) => { |
|
return { |
|
guide: getRequestedGuide(req) |
|
}; |
|
}); |
|
|
|
export default Guide;
|
|
|