Skip to content

Commit

Permalink
update App Header and Footer
Browse files Browse the repository at this point in the history
  • Loading branch information
thieryw committed Jul 16, 2022
1 parent 418f4a1 commit b28ba31
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 5 deletions.
4 changes: 3 additions & 1 deletion src/App/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { Home } from "../pages/Home";
import { PageExample } from "../pages/PageExample";
import { FourOhFour } from "../pages/FourOFour";
import { ThemeProvider } from "../theme";
import { Page2Example } from "../pages/Page2Example";

export function App() {
const route = useRoute();
Expand All @@ -23,7 +24,8 @@ export function App() {
switch(route.name){
case "home": return <Home />;
case "pageExample": return <PageExample />;
default : return <FourOhFour />;
case "page2Example": return <Page2Example />;
default: return <FourOhFour />;
}
})()
}
Expand Down
5 changes: 5 additions & 0 deletions src/App/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ export const Footer = memo(() => {
"label": t("link1label"),
...routes.pageExample().link
},
{
"label": t("linkPage2Label"),
...routes.page2Example().link
},
{
"label": t("link2label"),
"href": "https://example.com",
Expand All @@ -30,6 +34,7 @@ export const Footer = memo(() => {
export const { i18n } = declareComponentKeys<
| "license"
| "link1label"
| "linkPage2Label"
| "link2label"
| "link3label"
>()({ Footer });
5 changes: 5 additions & 0 deletions src/App/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ export const Header = memo(() => {
"label": t("link1label"),
...routes.pageExample().link
},
{
"label": t("linkPage2Label"),
...routes.page2Example().link
},
{
"label": t("link2label"),
"href": "https://example.com",
Expand All @@ -48,6 +52,7 @@ export const Header = memo(() => {
export const { i18n } = declareComponentKeys<
| "headerTitle"
| "link1label"
| "linkPage2Label"
| "link2label"
| "link3label"
>()({ Header });
12 changes: 8 additions & 4 deletions src/i18n.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,15 @@ export const {
"headerTitle": "Title",
"link1label": "Example page",
"link2label": "Link 2",
"link3label": "Link 3"
"link3label": "Link 3",
"linkPage2Label": "Link page 2"
},
"Footer": {
"license": "License M.I.T",
"link1label": "Example page",
"link2label": "Link 2",
"link3label": "Link 3"
"link3label": "Link 3",
"linkPage2Label": "Link page 2"
},
"Home": {
"heroTitle": "Hero title",
Expand Down Expand Up @@ -126,13 +128,15 @@ export const {
"headerTitle": "Titre",
"link1label": "Exemple de page",
"link2label": "Lien 2",
"link3label": "Lien 3"
"link3label": "Lien 3",
"linkPage2Label": "Lien page 2"
},
"Footer": {
"license": "License M.I.T",
"link1label": "Exemple de page",
"link2label": "Lien 2",
"link3label": "Lien 3"
"link3label": "Lien 3",
"linkPage2Label": "Lien page 2"
},
"Home": {
"heroTitle": "Titre du Hero",
Expand Down

0 comments on commit b28ba31

Please sign in to comment.