-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #903 from CodeForAfrica/chore/techlogblog_mdxjs
@/techlabblog mdxjs
- Loading branch information
Showing
37 changed files
with
4,816 additions
and
5,348 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,25 @@ | ||
import { Box } from "@mui/material"; | ||
import { Section } from "@commons-ui/core"; | ||
|
||
import Article from "@/techlabblog/components/Article"; | ||
import { ArticleProps, getContent } from "@/techlabblog/lib/data"; | ||
import PostHeader from "@/techlabblog/components/PostHeader"; | ||
import { getPost } from "@/techlabblog/lib/data"; | ||
|
||
export default async function Page({ params }: { params: { slug: string } }) { | ||
const post: ArticleProps = await getContent(params.slug); | ||
const postModule = await getPost(params.slug); | ||
|
||
// TODO: Check that the post does exist, return 404 otherwise | ||
return <Article {...post} />; | ||
if (!(postModule && postModule.frontmatter)) { | ||
// TODO(kilemensi): 404 | ||
return null; | ||
} | ||
const { default: PostContent, frontmatter } = postModule; | ||
return ( | ||
<Section | ||
sx={{ | ||
px: { xs: 2.5, sm: 0 }, | ||
py: { xs: 2.5, sm: 5 }, | ||
}} | ||
> | ||
<PostHeader {...frontmatter} /> | ||
<PostContent /> | ||
</Section> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.