-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changelog: - SEO / Google présente la version EN en deuxième lien [NGC-644] #555 - Now waiting for engine init before setting computed results #558 - Page de fin / Nouvelle version [NGC-814] #550 - Retire le formatage des situations + unformat uniquement les clés formatées [NGC-724] #554
- Loading branch information
1 parent
ccfb711
commit 5f7bbf7
Showing
64 changed files
with
1,921 additions
and
258 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
31 changes: 0 additions & 31 deletions
31
src/app/(layout-with-navigation)/(simulation)/fin/_components/CongratulationsText.tsx
This file was deleted.
Oops, something went wrong.
33 changes: 33 additions & 0 deletions
33
src/app/(layout-with-navigation)/(simulation)/fin/_components/DocumentationBlock.tsx
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,33 @@ | ||
import BookClosedIcon from '@/components/icons/BookClosedIcon' | ||
import Trans from '@/components/translation/Trans' | ||
import { endClickDocumentation } from '@/constants/tracking/pages/end' | ||
import InlineLink from '@/design-system/inputs/InlineLink' | ||
import Title from '@/design-system/layout/Title' | ||
import { trackEvent } from '@/utils/matomo/trackEvent' | ||
|
||
export default function DocumentationBlock() { | ||
return ( | ||
<div> | ||
<Title tag="h2"> | ||
<Trans>Comment est calculée votre empreinte ?</Trans> | ||
</Title> | ||
|
||
<p> | ||
<Trans> | ||
Notre simulateur repose sur un modèle de données, dont l'intégralité | ||
des calculs est documentée ; les données affichées sont directement | ||
associées à votre test. | ||
</Trans> | ||
</p> | ||
|
||
<InlineLink | ||
href="/documentation/bilan" | ||
className="flex items-center" | ||
onClick={() => trackEvent(endClickDocumentation)}> | ||
<BookClosedIcon className="mr-2 w-4 fill-primary-700" /> | ||
|
||
<Trans>Comprendre le calcul</Trans> | ||
</InlineLink> | ||
</div> | ||
) | ||
} |
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
19 changes: 19 additions & 0 deletions
19
src/app/(layout-with-navigation)/(simulation)/fin/_components/Heading.tsx
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,19 @@ | ||
'use client' | ||
|
||
import Trans from '@/components/translation/Trans' | ||
import Title from '@/design-system/layout/Title' | ||
import HeadingButtons from './heading/HeadingButtons' | ||
|
||
export default function Heading() { | ||
return ( | ||
<> | ||
<div className="mb-4 flex flex-wrap items-start justify-between"> | ||
<Title | ||
className="text-lg md:text-2xl" | ||
title={<Trans>Mon empreinte</Trans>} | ||
/> | ||
<HeadingButtons endPage /> | ||
</div> | ||
</> | ||
) | ||
} |
59 changes: 0 additions & 59 deletions
59
src/app/(layout-with-navigation)/(simulation)/fin/_components/Results.tsx
This file was deleted.
Oops, something went wrong.
22 changes: 22 additions & 0 deletions
22
src/app/(layout-with-navigation)/(simulation)/fin/_components/ShareBlock.tsx
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,22 @@ | ||
import { endClickShare } from '@/constants/tracking/pages/end' | ||
import CopyInput from '@/design-system/inputs/CopyInput' | ||
import Title from '@/design-system/layout/Title' | ||
import { useEndPageSharedUrl } from '@/hooks/useEndPageSharedUrl' | ||
import { trackEvent } from '@/utils/matomo/trackEvent' | ||
|
||
export default function ShareBlock() { | ||
const { sharedUrl } = useEndPageSharedUrl() | ||
|
||
return ( | ||
<div id="share-block" className=""> | ||
<Title tag="h2">Partager mon résultat</Title> | ||
|
||
<CopyInput | ||
textToCopy={sharedUrl} | ||
textToDisplay={sharedUrl} | ||
canShare | ||
onClick={() => trackEvent(endClickShare)} | ||
/> | ||
</div> | ||
) | ||
} |
27 changes: 27 additions & 0 deletions
27
src/app/(layout-with-navigation)/(simulation)/fin/_components/SmallFootprint.tsx
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,27 @@ | ||
import Trans from '@/components/translation/Trans' | ||
import Title from '@/design-system/layout/Title' | ||
import Actions from './subcategories/subcategory/Actions' | ||
|
||
export default function SmallFootprint() { | ||
return ( | ||
<div> | ||
<Title | ||
tag="h2" | ||
subtitle={ | ||
<Trans> | ||
Vous êtes très nettement en dessous de la moyenne française. | ||
</Trans> | ||
}> | ||
Bien joué 👏 | ||
</Title> | ||
<p> | ||
<Trans> | ||
Il y a de grandes chances que votre temps soit plus efficace à{' '} | ||
<strong>convaincre et aider les autres</strong> qu'à chercher à gagner | ||
vos "tonnes en trop". | ||
</Trans> | ||
</p> | ||
<Actions subcategory="ui . pédagogie . empreinte faible" shouldHideLink /> | ||
</div> | ||
) | ||
} |
25 changes: 25 additions & 0 deletions
25
src/app/(layout-with-navigation)/(simulation)/fin/_components/Subcategories.tsx
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,25 @@ | ||
import { useSortedSubcategoriesByFootprint } from '@/hooks/useSortedSubcategoriesByFootprint' | ||
import { useSortedUiCategoriesByFootprint } from '@/hooks/useSortedUiCategoriesByFootprint' | ||
import Subcategory from './subcategories/Subcategory' | ||
|
||
export default function Subcategories() { | ||
const { sortedSubcategories } = useSortedSubcategoriesByFootprint() | ||
|
||
const { sortedUiCategories } = useSortedUiCategoriesByFootprint() | ||
|
||
const firstThreeSubcategories = ( | ||
sortedUiCategories.length > 0 ? sortedUiCategories : sortedSubcategories | ||
).slice(0, 3) | ||
|
||
return ( | ||
<> | ||
{firstThreeSubcategories.map((subcategory, index) => ( | ||
<Subcategory | ||
key={subcategory} | ||
subcategory={subcategory} | ||
index={index} | ||
/> | ||
))} | ||
</> | ||
) | ||
} |
108 changes: 108 additions & 0 deletions
108
src/app/(layout-with-navigation)/(simulation)/fin/_components/TargetBlock.tsx
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,108 @@ | ||
'use client' | ||
|
||
import Link from '@/components/Link' | ||
import CloseIcon from '@/components/icons/Close' | ||
import DownArrow from '@/components/icons/DownArrow' | ||
import Trans from '@/components/translation/Trans' | ||
import { endToggleTargetBlock } from '@/constants/tracking/pages/end' | ||
import ExternalLinkIcon from '@/design-system/icons/ExternalLinkIcon' | ||
import Button from '@/design-system/inputs/Button' | ||
import Title from '@/design-system/layout/Title' | ||
import { trackEvent } from '@/utils/matomo/trackEvent' | ||
import { useState } from 'react' | ||
import { twMerge } from 'tailwind-merge' | ||
import Hedgehog from './targetBlock/Hedgehog' | ||
import HedgehogAwareness from './targetBlock/HedgehogAwareness' | ||
import TargetChart from './targetBlock/TargetChart' | ||
import TargetQuestions from './targetBlock/TargetQuestions' | ||
|
||
export default function TargetBlock() { | ||
const [isOpen, setIsOpen] = useState(false) | ||
|
||
const [isHedgehog, setIsHedgehog] = useState(false) | ||
|
||
const [isQuestionOpen, setIsQuestionOpen] = useState(false) | ||
|
||
return ( | ||
<div className="relative"> | ||
<Hedgehog setIsHedgehog={setIsHedgehog} /> | ||
<div className="short:py-2 relative rounded-xl border-2 border-primary-50 bg-gray-100 px-4 py-6"> | ||
{isHedgehog ? ( | ||
<HedgehogAwareness /> | ||
) : ( | ||
<> | ||
<div className={twMerge('lg:hidden', isOpen ? '' : '-mb-8')}> | ||
<Title | ||
tag="h2" | ||
className="text-lg lg:text-2xl" | ||
hasSeparator={isOpen} | ||
title={ | ||
<Trans> | ||
<strong className="font-black text-secondary-700"> | ||
2 tonnes | ||
</strong>{' '} | ||
en 2050 ? | ||
</Trans> | ||
} | ||
/> | ||
</div> | ||
<div className="hidden lg:block"> | ||
<Title | ||
tag="h2" | ||
className=" text-lg lg:text-2xl" | ||
title={ | ||
<Trans> | ||
<strong className="font-black text-secondary-700"> | ||
2 tonnes | ||
</strong>{' '} | ||
en 2050 ? | ||
</Trans> | ||
} | ||
/> | ||
</div> | ||
<div | ||
className={twMerge( | ||
'lg:block', | ||
isOpen || isHedgehog ? 'block' : 'hidden' | ||
)}> | ||
<p> | ||
<Trans> | ||
C’est l’objectif à atteindre pour espérer limiter le | ||
réchauffement climatique à 2 degrés. | ||
</Trans> | ||
</p> | ||
<TargetChart isQuestionOpen={isQuestionOpen} /> | ||
<TargetQuestions setIsQuestionOpen={setIsQuestionOpen} /> | ||
<div className="flex justify-end"> | ||
<Link | ||
className="text-sm" | ||
href="/empreinte-climat" | ||
target="_blank"> | ||
En savoir plus{' '} | ||
<ExternalLinkIcon className="stroke-primary-700" /> | ||
</Link> | ||
</div> | ||
</div> | ||
</> | ||
)} | ||
</div> | ||
<Button | ||
color={isOpen || isHedgehog ? 'text' : 'primary'} | ||
className={twMerge( | ||
'absolute right-4 top-4 h-12 w-12 p-0 lg:hidden', | ||
isHedgehog ? '!block' : '' | ||
)} | ||
onClick={() => { | ||
setIsOpen((prevIsOpen) => !prevIsOpen) | ||
setIsHedgehog(false) | ||
trackEvent(endToggleTargetBlock) | ||
}}> | ||
{isOpen || isHedgehog ? ( | ||
<CloseIcon className="h-7 w-7 fill-primary-700" /> | ||
) : ( | ||
<DownArrow className="h-7 w-7 fill-white" /> | ||
)} | ||
</Button> | ||
</div> | ||
) | ||
} |
Oops, something went wrong.