-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: Add quiz * feat: fiches * fix: texts * add contenu * track matomo * fix: sizes * change meta image
- Loading branch information
Showing
75 changed files
with
2,486 additions
and
229 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
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 |
---|---|---|
|
@@ -72,3 +72,5 @@ npm/react/dist/index.js.LICENSE.txt | |
dist/ | ||
|
||
public/webcomponents/ | ||
|
||
public/pdf/ |
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,8 @@ | ||
import React from 'react' | ||
import Quiz from 'components/outils/quiz/Quiz' | ||
|
||
const page = () => { | ||
return <Quiz /> | ||
} | ||
|
||
export default page |
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,31 @@ | ||
import { Metadata } from 'next' | ||
import React from 'react' | ||
import Notion from 'components/Notion/Notion' | ||
import { getNotionContentProps, getNotionRevalidate } from 'components/Notion/utils' | ||
import Suggestion from 'components/layout/Suggestion' | ||
|
||
export const revalidate = getNotionRevalidate() | ||
|
||
const title = 'Quiz carbone : le nouveau jeu de cartes de l’ADEME est en ligne !' | ||
|
||
export const metadata: Metadata = { | ||
title: `${title} | Impact CO₂`, | ||
description: | ||
'Quelle activité humaine a le moins d’impact sur l’environnement ? Découvrez le Quiz carbone pour y voir plus clair !', | ||
openGraph: { | ||
creators: 'ADEME', | ||
images: `${process.env.NEXT_PUBLIC_URL}/meta/quiz-carbone.png`, | ||
}, | ||
} | ||
const QuizCarbone = async () => { | ||
const recordMap = await getNotionContentProps('1126523d57d780fb926be79164a403b8') | ||
|
||
return ( | ||
<> | ||
<Notion title={title} recordMap={recordMap} /> | ||
<Suggestion from={title} fromLabel={title} simulatorName='du quiz carbone' /> | ||
</> | ||
) | ||
} | ||
|
||
export default QuizCarbone |
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,32 @@ | ||
import { Metadata } from 'next' | ||
import React from 'react' | ||
import QuizPage from 'components/outils/quiz/QuizPage' | ||
import { metaDescriptions, metaTitles } from 'utils/meta' | ||
import Suggestion from 'components/layout/Suggestion' | ||
|
||
export async function generateMetadata({ | ||
searchParams, | ||
}: { | ||
searchParams: { [key: string]: string | string[] | undefined } | ||
}): Promise<Metadata> { | ||
const language = (searchParams.language as string) || 'fr' | ||
return { | ||
title: `${metaTitles.quiz[language]} | Impact CO₂`, | ||
description: metaDescriptions.quiz[language], | ||
openGraph: { | ||
creators: 'ADEME', | ||
images: 'meta/quiz.png', | ||
}, | ||
} | ||
} | ||
|
||
const page = () => { | ||
return ( | ||
<> | ||
<QuizPage /> | ||
<Suggestion from='/outils/quiz' fromLabel='Quiz carbone' simulatorName='du quiz carbone' /> | ||
</> | ||
) | ||
} | ||
|
||
export default page |
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,20 @@ | ||
import { notFound } from 'next/navigation' | ||
import React from 'react' | ||
import { categories } from 'data/categories' | ||
import Recto from 'components/outils/equivalents/pdf/Recto' | ||
import 'components/outils/equivalents/pdf/pdf.css' | ||
|
||
const EquivalentPage = ({ params }: { params: { tool: string; equivalent: string } }) => { | ||
const category = categories.find((category) => category.slug === params.tool) | ||
if (!category || !category.equivalents) { | ||
return notFound() | ||
} | ||
const [slug] = decodeURIComponent(params.equivalent).split('+') | ||
const equivalent = category.equivalents.find((equivalent) => equivalent.slug === slug) | ||
if (!equivalent) { | ||
return notFound() | ||
} | ||
return <Recto equivalent={equivalent} /> | ||
} | ||
|
||
export default EquivalentPage |
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,28 @@ | ||
import { notFound } from 'next/navigation' | ||
import React from 'react' | ||
import { ParamProvider } from 'src/providers/ParamProvider' | ||
import TranslationProvider from 'src/providers/TranslationProvider' | ||
import { categories } from 'data/categories' | ||
import Verso from 'components/outils/equivalents/pdf/Verso' | ||
import 'components/outils/equivalents/pdf/pdf.css' | ||
|
||
const EquivalentPage = ({ params }: { params: { tool: string; equivalent: string } }) => { | ||
const category = categories.find((category) => category.slug === params.tool) | ||
if (!category || !category.equivalents) { | ||
return notFound() | ||
} | ||
const [slug] = decodeURIComponent(params.equivalent).split('+') | ||
const equivalent = category.equivalents.find((equivalent) => equivalent.slug === slug) | ||
if (!equivalent) { | ||
return notFound() | ||
} | ||
return ( | ||
<ParamProvider> | ||
<TranslationProvider> | ||
<Verso equivalent={equivalent} category={category} /> | ||
</TranslationProvider> | ||
</ParamProvider> | ||
) | ||
} | ||
|
||
export default EquivalentPage |
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,4 +1,3 @@ | ||
version: '3' | ||
services: | ||
db: | ||
image: postgres:16 | ||
|
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.