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

fix(header): fix exception with neutral theme #302

Merged
merged 2 commits into from
Feb 26, 2024
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
2 changes: 1 addition & 1 deletion report/www/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"prebuild": "only-include-used-icons"
},
"dependencies": {
"@codegouvfr/react-dsfr": "^1.2.2",
"@codegouvfr/react-dsfr": "^1.7.2",
"@emotion/react": "^11.11.3",
"@emotion/server": "^11.11.0",
"@emotion/styled": "^11.11.0",
Expand Down
26 changes: 14 additions & 12 deletions report/www/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,20 @@ const { withDsfr, dsfrDocumentApi } = createNextDsfrIntegrationApi({
const { locale = "fr" } = useRouter();
return locale;
},
preloadFonts: !!dashlordConfig.marianne && [
//"Marianne-Light",
//"Marianne-Light_Italic",
"Marianne-Regular",
//"Marianne-Regular_Italic",
"Marianne-Medium",
//"Marianne-Medium_Italic",
"Marianne-Bold",
//"Marianne-Bold_Italic",
//"Spectral-Regular",
//"Spectral-ExtraBold"
],
preloadFonts:
(!!dashlordConfig.marianne && [
//"Marianne-Light",
//"Marianne-Light_Italic",
"Marianne-Regular",
//"Marianne-Regular_Italic",
"Marianne-Medium",
//"Marianne-Medium_Italic",
"Marianne-Bold",
//"Marianne-Bold_Italic",
//"Spectral-Regular",
//"Spectral-ExtraBold"
]) ||
[],
});

export { dsfrDocumentApi };
Expand Down
8 changes: 5 additions & 3 deletions report/www/pages/tag/[tag].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@ import Head from "next/head";
import uniq from "lodash.uniq";

import { Dashboard } from "../../src/components/Dashboard";
import dashlordConfig from '@/config.json';
import dashlordConfig from "@/config.json";
const report: DashLordReport = require("../../src/report.json");

const Tag = ({ report, tag }: { report: DashLordReport; tag: string }) => {
return (
<>
<Head>
<title>Tag {tag} - {dashlordConfig.title}</title>
<title>
Tag {tag} - {dashlordConfig.title}
</title>
</Head>
<Dashboard report={report} />
</>
Expand All @@ -30,7 +32,7 @@ export const getStaticProps: GetStaticProps = async ({ params }) => {

// return list of urls to generate
export const getStaticPaths: GetStaticPaths = async () => ({
paths: uniq(report.flatMap((u: UrlReport) => u.tags)).map(
paths: uniq(report.flatMap((u: UrlReport) => u.tags).filter(Boolean)).map(
(tag) => `/tag/${tag}`
),
fallback: false,
Expand Down
17 changes: 6 additions & 11 deletions report/www/src/__tests__/__snapshots__/Header.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -237,17 +237,12 @@ exports[`Should render HeaderSite 1`] = `
<div
class="fr-header__operator"
>
<a
href="/"
title="DashLord Fabrique des ministères sociaux"
>
<img
alt="Logo Fabrique des ministères sociaux"
class="fr-responsive-img"
src="https://avatars.githubusercontent.com/u/35456799?s=400"
style="max-width: 9.0625rem;"
/>
</a>
<img
alt="Logo Fabrique des ministères sociaux"
class="fr-responsive-img"
src="https://avatars.githubusercontent.com/u/35456799?s=400"
style="max-width: 9.0625rem;"
/>
</div>
<div
class="fr-header__navbar"
Expand Down
14 changes: 10 additions & 4 deletions report/www/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -268,12 +268,13 @@
"@babel/helper-validator-identifier" "^7.22.20"
to-fast-properties "^2.0.0"

"@codegouvfr/react-dsfr@^1.2.2":
version "1.2.2"
resolved "https://registry.yarnpkg.com/@codegouvfr/react-dsfr/-/react-dsfr-1.2.2.tgz#d172fed779b439e9bbe96b7bc018e876435fdb2f"
integrity sha512-ZzjMbOONksJSwgiWJdgMNSDW030P6y5FjGUBJyB1LL+y1OnNuKSTDTc+fjz8uMdfkFZI6j0Ub10OzZXQoMpGjQ==
"@codegouvfr/react-dsfr@^1.7.2":
version "1.7.2"
resolved "https://registry.yarnpkg.com/@codegouvfr/react-dsfr/-/react-dsfr-1.7.2.tgz#c38a330333c9cdff60b20d8b1a7e0aebd89cd73d"
integrity sha512-4kZ1EajPQVelkneSzbn7EZbrVBdukWUBsy+RsHBXf9a+JRvgYS3xlf7jDmc70tuEHF/824pShue7kDvoR6uxnw==
dependencies:
tsafe "^1.6.3"
yargs-parser "^21.1.1"

"@emotion/babel-plugin@^11.11.0":
version "11.11.0"
Expand Down Expand Up @@ -5727,6 +5728,11 @@ yaml@^1.10.0:
resolved "https://registry.yarnpkg.com/yaml/-/yaml-1.10.2.tgz#2301c5ffbf12b467de8da2333a459e29e7920e4b"
integrity sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==

yargs-parser@^21.1.1:
version "21.1.1"
resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-21.1.1.tgz#9096bceebf990d21bb31fa9516e0ede294a77d35"
integrity sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==

yocto-queue@^0.1.0:
version "0.1.0"
resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b"
Expand Down
Loading