Skip to content

Commit

Permalink
feat: add description to home page
Browse files Browse the repository at this point in the history
  • Loading branch information
Shchepotin committed Sep 21, 2023
1 parent fa9a2ce commit d3e0c39
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 24 deletions.
21 changes: 0 additions & 21 deletions src/app/[language]/page-content.tsx

This file was deleted.

38 changes: 36 additions & 2 deletions src/app/[language]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import type { Metadata } from "next";
import Home from "./page-content";
import { getServerTranslation } from "@/services/i18n";
import Container from "@mui/material/Container";
import Grid from "@mui/material/Grid";
import Typography from "@mui/material/Typography";
import MuiLink from "@mui/material/Link";
import { Trans } from "react-i18next/TransWithoutContext";

type Props = {
params: { language: string };
Expand All @@ -14,4 +18,34 @@ export async function generateMetadata({ params }: Props): Promise<Metadata> {
};
}

export default Home;
export default async function Home({ params }: Props) {
const { t } = await getServerTranslation(params.language, "home");

return (
<Container maxWidth="md">
<Grid container spacing={3} wrap="nowrap" pt={3}>
<Grid item>
<Typography variant="h3" gutterBottom>
{t("title")}
</Typography>
<Typography>
<Trans
i18nKey={`description`}
t={t}
components={[
<MuiLink
key="1"
target="_blank"
rel="noopener noreferrer"
href="https://github.com/brocoders/react-boilerplate"
>
{}
</MuiLink>,
]}
/>
</Typography>
</Grid>
</Grid>
</Container>
);
}
3 changes: 2 additions & 1 deletion src/services/i18n/locales/en/home.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"title": "Home"
"title": "Home",
"description": "Welcome to the reactjs-boilerplate example app. Full documentation can be found <0>here</0>."
}

0 comments on commit d3e0c39

Please sign in to comment.