Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move the header in the layout #10

Merged
merged 4 commits into from
Dec 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions app/about/page.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import Button from "@mui/material/Button";
import { Layout } from "../components/Layout";

export default function About() {
return (
<Layout>
<div>
Hello About
<Button>Test</Button>
</Layout>
</div>
);
}
19 changes: 0 additions & 19 deletions app/components/Layout.tsx

This file was deleted.

8 changes: 2 additions & 6 deletions app/dossiers/dossier/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import React from "react";

import { Layout } from "@/app/components/Layout";
import AdditionalInfoCard from "@/components/folders/AdditionalInfoCard";
import CommiteeCard from "@/components/folders/CommiteeCard";
import Hero from "@/components/folders/HeroSection";
Expand All @@ -17,14 +16,11 @@ import Stack from "@mui/material/Stack";
import Tabs from "@mui/material/Tabs";
import Tab from "@mui/material/Tab";

import { useTheme } from "@mui/material";

export default function Dossier() {
const theme = useTheme();
const tabNumber = 0;

return (
<Layout>
<React.Fragment>
<Hero />
<Box
mb={2}
Expand Down Expand Up @@ -107,6 +103,6 @@ export default function Dossier() {
</Container>
)}
</div>
</Layout>
</React.Fragment>
);
}
10 changes: 2 additions & 8 deletions app/dossiers/page.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
import { Layout } from "../components/Layout";

import Link from "next/link";

export default function Dossiers() {
return (
<Layout>
{/* TODO: match old website url ":id/dossiers/:id" */}
<Link href="dossiers/dossier">Lien vers un dossier</Link>
</Layout>
);
// TODO: match old website url ":id/dossiers/:id"
return <Link href="dossiers/dossier">Lien vers un dossier</Link>;
}
Binary file modified app/favicon.ico
Binary file not shown.
45 changes: 41 additions & 4 deletions app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,60 @@ import type { Metadata } from "next";
import { Raleway } from "next/font/google";
import "./globals.css";
import ThemeRegistry from "@/components/ThemeRegistry/ThemeRegistry";
import { NavBar, NavigationItem } from "@/components/NavBar";

const inter = Raleway({ subsets: ["latin"] });

export const metadata: Metadata = {
title: "Create Next App",
description: "Generated by create next app",
metadataBase: new URL("https://www.nosdeputes.fr"),
robots: "index, follow",
title: "NosDéputés.fr : Observatoire citoyen de l'activité parlementaire",
description: "Observatoire citoyen de l'activité parlementaire",

twitter: {
card: "summary",
site: "@RegardsCitoyens",
title: "NosDéputés.fr par @RegardsCitoyens",
description:
"Observatoire citoyen de l'activité parlementaire à l'Assemblée nationale",
images: {
url: "https://www.nosdeputes.fr/images/xneth/bouton_logo.png",
type: "image/png",
},
},
openGraph: {
type: "website",
title: "NosDéputés.fr par Regards Citoyens",
siteName: "NosDéputés.fr",
description:
"Observatoire citoyen de l'activité parlementaire à l'Assemblée nationale",
url: "https://www.NosDéputés.fr",
locale: "fr_FR",
images: "https://www.nosdeputes.fr/images/xneth/bouton_logo.png",
},
};

const navigation: NavigationItem[] = [
{ name: "Home", href: "/" },
{ name: "About", href: "/about" },
{ name: "Dossiers", href: "/dossiers" }, // old url is "/dossiers/date"
// ... more items
];

export default function RootLayout({
children,
}: {
children?: React.ReactNode;
}) {
return (
<html lang="en">
<html lang="fr">
<body className={inter.className}>
<ThemeRegistry>{children}</ThemeRegistry>
<ThemeRegistry>
<main className="flex min-h-screen flex-col">
<NavBar navigation={navigation} />
{children}
</main>
</ThemeRegistry>
</body>
</html>
);
Expand Down
4 changes: 1 addition & 3 deletions app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { Layout } from "./components/Layout";

export default function Home() {
return <Layout>Hello Home!</Layout>;
return <p>Hello Home!</p>;
}
1 change: 0 additions & 1 deletion app/components/NavBar.tsx → components/NavBar.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"use client";

// app/components/NavBar.client.tsx
import { usePathname } from "next/navigation"; // This is hypothetical, replace with the appropriate import
import Link from "next/link";

Expand Down
4 changes: 2 additions & 2 deletions components/folders/HeroSection/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,10 @@ const HeroSection = () => {
<StatusChip size="small" status="dropped" label="Non-soutenu" />
<StatusChip size="small" status="review" label="1e lecture AN" />
<StatusChip size="small" status="validated" label="Promulgué" />
<LabelChip label="Label" icon={<EnergyIcon />} />
<LabelChip size="small" label="Label" icon={<EnergyIcon />} />
<LabelChip size="small" label="Label" />
<LabelChip size="small" label="Label" onDelete={() => {}} />
<LabelChip label="Label" onDelete={() => {}} />
<LabelChip size="small" label="Label" onDelete={() => {}} />
</Stack>
</Stack>
</Paper>
Expand Down