Skip to content

Commit

Permalink
Release 1.1.4
Browse files Browse the repository at this point in the history
- Corrige le clignotement du tutoriel [NGC-400] #328
- feat: Ajoute le CTA dans le header + modifie le lien Le test [NGC-390, NGC-436] #327
- Quick fix documentation (NGC-407) #326
- Ajoute éléments manquants pour la détection Dashlord #324
- Ajout emoji extérieur 🌿 (NGC-328) #323
- Modifie la manière de sauvegarder l'id lors de la migration d'une ancienne version du storage [NGC-381, NGC-471] #321
- Article challenge amis #320
  • Loading branch information
florianpanchout authored Jan 10, 2024
1 parent 74e9c53 commit 8021013
Show file tree
Hide file tree
Showing 26 changed files with 240 additions and 259 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions public/images/model/logement . extérieur.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
75 changes: 0 additions & 75 deletions public/images/model/logement . piscine . empreinte.svg

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import PrivacyFr from '@/locales/pages/fr/privacy.mdx'

export async function generateMetadata() {
return getMetadataObject({
title: 'Vie privée - Nos Gestes Climat',
title: 'Politique de confidentialité - Nos Gestes Climat',
description:
'Découvrez comment nous utilisons vos données personnelles pour vous proposer un simulateur de bilan carbone personnel.',
alternates: {
canonical: '/vie-privee',
canonical: '/politique-de-confidentialite',
},
})
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import { SuppportedRegions } from '@/types/international'
import Head from 'next/head'
import Engine from 'publicodes'
import { RulePage } from 'publicodes-react'
import References from '../../../_components/References'

type Props = {
supportedRegions: SuppportedRegions
Expand Down Expand Up @@ -44,7 +43,6 @@ export default function DocumentationClient({ slugs }: Props) {
)}
</>
),
References: References as any,
}}
/>
</div>
Expand Down
82 changes: 0 additions & 82 deletions src/app/documentation/_components/DocumentationContent.tsx

This file was deleted.

2 changes: 1 addition & 1 deletion src/app/documentation/_components/DocumentationLanding.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import { useRules } from '@/hooks/useRules'
import { useUser } from '@/publicodes-state'

import Link from '@/components/Link'
import DocumentationLandingCard from './DocumentationLandingCard'
import SearchBar from './SearchBar'
import DocumentationLandingCard from './documentationLanding/DocumentationLandingCard'

// We want to be able to define an order for the cards and their summary here
const FIXED_CARD_SUMMARIES = {
Expand Down
77 changes: 0 additions & 77 deletions src/app/documentation/_components/References.tsx

This file was deleted.

38 changes: 26 additions & 12 deletions src/components/layout/header/HeaderDesktop.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,33 @@ import PRIndicator from '@/components/layout/header/headerDesktop/PRIndicator'
import Logo from '@/components/misc/Logo'
import Trans from '@/components/translation/Trans'
import { useClientTranslation } from '@/hooks/useClientTranslation'
import { useUser } from '@/publicodes-state'
import { usePathname } from 'next/navigation'
import NavLink from './NavLink'
import CTAButton from './headerDesktop/CTAButton'
import DebugIndicator from './headerDesktop/DebugIndicator'
import ModelVersionIndicator from './headerDesktop/ModelVersionIndicator'

const HIDE_CTA_PATHS = ['/fin', '/simulateur/bilan', '/tutoriel']

export default function HeaderDesktop() {
const { t } = useClientTranslation()

const pathname = usePathname()

const { getCurrentSimulation } = useUser()

const currentSimulation = getCurrentSimulation()

let testHref = ''
if (!currentSimulation?.progression) {
testHref = '/tutoriel'
} else if (currentSimulation?.progression < 1) {
testHref = '/simulateur/bilan'
} else {
testHref = '/fin'
}

return (
<header className="sticky top-0 z-[500] hidden h-20 items-center lg:block">
<div className="absolute bottom-0 left-0 right-0 top-0 flex h-20 w-full items-center border-b bg-white shadow-sm">
Expand All @@ -28,8 +48,8 @@ export default function HeaderDesktop() {
<ul className="flex h-full ">
<li className="px-4">
<NavLink
href="/simulateur/bilan"
activeMatches={['/tutoriel', '/simulateur']}
href={testHref}
activeMatches={['/tutoriel', '/simulateur', '/fin']}
icon={BilanIcon}
title={t('Le test')}>
<Trans>Le test</Trans>
Expand Down Expand Up @@ -57,24 +77,18 @@ export default function HeaderDesktop() {
</ul>
</nav>
</div>
<div className="flex items-center gap-4">
<div className="flex items-center gap-8">
<PRIndicator />
<ModelVersionIndicator />
<DebugIndicator />

<NavLink href="/profil" icon={ProfileIcon} title={t('Profil')}>
<Trans>Profil</Trans>
</NavLink>
{/* TODO : uncomment when organisations are ready
<div className="mb-2 h-3 w-[1px] bg-gray-300" />

<NavLink
href="https://sondages.nosgestesclimat.fr"
shouldUseDefaultLink
icon={OrganisationIcon}>
Organisations
</NavLink>
*/}
{!HIDE_CTA_PATHS.includes(pathname) && (
<CTAButton progression={currentSimulation?.progression || 0} />
)}
</div>
</div>
</div>
Expand Down
26 changes: 26 additions & 0 deletions src/components/layout/header/headerDesktop/CTAButton.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
'use client'

import Trans from '@/components/translation/Trans'
import ButtonLink from '@/design-system/inputs/ButtonLink'

export default function CTAButton({ progression }: { progression: number }) {
let href = ''
if (!progression) {
href = '/tutoriel'
} else if (progression < 1) {
href = '/simulateur/bilan'
} else {
href = '/fin'
}

let label
if (!progression) {
label = <Trans>Passer le test</Trans>
} else if (progression < 1) {
label = <Trans>Reprendre mon test</Trans>
} else {
label = <Trans>Voir mes résultats</Trans>
}

return <ButtonLink href={href}>{label}</ButtonLink>
}
Loading

0 comments on commit 8021013

Please sign in to comment.