-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: blank pages, folder structure and active links
- Loading branch information
Arnaud AMBROSELLI
committed
Aug 4, 2023
1 parent
e4db769
commit a09b2ee
Showing
17 changed files
with
150 additions
and
40 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { fr } from "@codegouvfr/react-dsfr"; | ||
|
||
export default function About() { | ||
return ( | ||
<section> | ||
<h1 className={fr.cx("fr-h1")}>À propos de la Fabrique</h1> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { fr } from "@codegouvfr/react-dsfr"; | ||
|
||
export default function Team() { | ||
return ( | ||
<section> | ||
<h1 className={fr.cx("fr-h1")}>L'équipe</h1> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { fr } from "@codegouvfr/react-dsfr"; | ||
|
||
export default function NotreOffre() { | ||
return ( | ||
<section> | ||
<h1 className={fr.cx("fr-h1")}>Ce que vous offre de la Fabrique</h1> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { fr } from "@codegouvfr/react-dsfr"; | ||
|
||
export default function Documentation() { | ||
return ( | ||
<section> | ||
<h1 className={fr.cx("fr-h1")}>Documentation</h1> | ||
</section> | ||
); | ||
} |
Binary file not shown.
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { fr } from "@codegouvfr/react-dsfr"; | ||
|
||
export default function ProposezVosIdees() { | ||
return ( | ||
<section> | ||
<h1 className={fr.cx("fr-h1")}>Proposez vos idées</h1> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { fr } from "@codegouvfr/react-dsfr"; | ||
|
||
export default function Recrutement() { | ||
return ( | ||
<section> | ||
<h1 className={fr.cx("fr-h1")}>Recrutement</h1> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { fr } from "@codegouvfr/react-dsfr"; | ||
|
||
export default function Startups() { | ||
return ( | ||
<section> | ||
<h1 className={fr.cx("fr-h1")}>Nos startups</h1> | ||
</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 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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
"use client"; | ||
import { useMemo } from "react"; | ||
import { usePathname, useSearchParams } from "next/navigation"; | ||
import { MainNavigation, type MainNavigationProps } from "@codegouvfr/react-dsfr/MainNavigation"; | ||
import { navigationItems } from "../utils/navigationItems"; | ||
|
||
export default function Navigation() { | ||
const pathname = usePathname(); | ||
const searchParams = useSearchParams().toString(); | ||
|
||
const activeNavigationItems = useMemo(() => { | ||
const currentUrl = `${pathname}${window.location.hash}${ | ||
searchParams ? `?${searchParams}` : "" | ||
}`; | ||
const activeNavigationItems = navigationItems.map((item: MainNavigationProps.Item) => { | ||
if (item.menuLinks?.length) { | ||
let isActive = false; | ||
const activeMenuLinks = item.menuLinks.map((menuLink) => { | ||
const menuLinkIsActive = currentUrl === (menuLink.linkProps.href as string); | ||
if (menuLinkIsActive) isActive = true; | ||
return { ...menuLink, isActive: menuLinkIsActive }; | ||
}); | ||
|
||
return { ...item, isActive, menuLinks: activeMenuLinks }; | ||
} | ||
if (!item.linkProps) return item; | ||
return { ...item, isActive: pathname.startsWith(item.linkProps.href as string) }; | ||
}); | ||
return activeNavigationItems; | ||
}, [pathname, searchParams]); | ||
|
||
// Warning: Prop `id` did not match. Server: "main-navigation-:Rt6cq:-button-0" Client: "main-navigation-:R3kpj9:-button-0" | ||
// https://github.com/vercel/next.js/issues/53110 | ||
|
||
return <MainNavigation items={activeNavigationItems} />; | ||
} |
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,18 +1,18 @@ | ||
"use client"; | ||
|
||
import { startReactDsfr } from "@codegouvfr/react-dsfr/next-appdir"; | ||
import { defaultColorScheme } from "./defaultColorScheme"; | ||
import { defaultColorScheme } from "../styles/defaultColorScheme"; | ||
import Link from "next/link"; | ||
|
||
declare module "@codegouvfr/react-dsfr/next-appdir" { | ||
interface RegisterLink { | ||
interface RegisterLink { | ||
Link: typeof Link; | ||
} | ||
} | ||
|
||
startReactDsfr({ defaultColorScheme, Link }); | ||
|
||
export function StartDsfr(){ | ||
export function StartDsfr() { | ||
//Yes, leave null here. | ||
return null; | ||
} |
File renamed without changes.
File renamed without changes.
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