-
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
8abe6b3
commit d315a82
Showing
19 changed files
with
179 additions
and
62 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 |
---|---|---|
@@ -1,13 +1,13 @@ | ||
/** @type {import('next').NextConfig} */ | ||
const nextConfig = { | ||
output: "standalone", | ||
webpack: config => { | ||
webpack: (config) => { | ||
config.module.rules.push({ | ||
test: /\.woff2$/, | ||
type: "asset/resource" | ||
}); | ||
return config; | ||
} | ||
type: "asset/resource", | ||
}) | ||
return config | ||
}, | ||
} | ||
|
||
module.exports = nextConfig |
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,43 @@ | ||
"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}${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
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
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