Skip to content

Commit

Permalink
Cacher le partage et le questionnaire
Browse files Browse the repository at this point in the history
  • Loading branch information
morganmerzouk committed Oct 25, 2024
1 parent 9cb5043 commit be5bd55
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 51 deletions.
46 changes: 11 additions & 35 deletions app/simulation/Form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,17 @@ import {
getSituation,
} from '@/components/publicodes/situationUtils'
import useSetSearchParams from '@/components/useSetSearchParams'
import Link from '@/node_modules/next/link'
import Publicodes from 'publicodes'
import { Suspense, useMemo } from 'react'
import Stepper from './Stepper'
import Share from './Share'
import simulationConfig from './simulationConfig.yaml'
import logoFranceRenov from '@/public/logo-france-renov-sans-texte.svg'
import UserProblemBanner from '@/components/UserProblemBanner'
import useSyncUrlLocalStorage from '@/utils/useSyncUrlLocalStorage'
import { useSearchParams } from 'next/navigation'
import useIsInIframe, { useIsCompact } from '@/components/useIsInIframe'
import useIsInIframe from '@/components/useIsInIframe'
import LogoCompact from '@/components/LogoCompact'
import Answers, { firstLevelCategory } from './Answers'
import Image from 'next/image'

function Form({ rules }) {
const isInIframe = useIsInIframe()
const isCompact = useIsCompact()
useSyncUrlLocalStorage()
const rawSearchParams = useSearchParams(),
searchParams = Object.fromEntries(rawSearchParams.entries())
Expand All @@ -40,9 +33,6 @@ function Form({ rules }) {
...Object.keys(simulationConfig.situation || {}),
...getAnsweredQuestions(situationSearchParams, rules),
]
const started =
answeredQuestions.filter((el) => el === 'simulation . mode').length > 1 // because of simulation mode

const situation = {
...(simulationConfig.situation || {}),
...getSituation(situationSearchParams, rules),
Expand All @@ -68,7 +58,7 @@ function Form({ rules }) {
return (
<div>
<Section>
{isInIframe && isCompact && (
{isInIframe && (
<>
<LogoCompact
css={`
Expand Down Expand Up @@ -101,32 +91,18 @@ function Form({ rules }) {
/>
)}
</Section>
{isCompact && (
<div
{isInIframe && (
<p
css={`
display: flex;
align-items: center;
font-size: 0.7rem;
margin: 0;
margin-top: 1rem;
line-height: 1rem;
`}
>
<a href="https://france-renov.gouv.fr" target="_blank">
<Image
src={logoFranceRenov}
alt="Logo de France Rénov"
width="80"
/>
</a>
<p
css={`
font-size: 0.7rem;
margin: 0;
margin-left: 10px;
line-height: 1rem;
`}
>
Une initiative construite avec France&nbsp;Rénov' pour simplifier
l'information sur les aides à la rénovation énergétique.
</p>
</div>
Ceci est une initiative construite avec France&nbsp;Rénov' pour
simplifier l'information sur les aides à la rénovation énergétique.
</p>
)}
</div>
)
Expand Down
3 changes: 1 addition & 2 deletions components/AddressSearch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,7 @@ export default function AddressSearch({ setChoice, situation, type }) {
src={checkIcon}
alt="Icône d'un check"
css={`
position: relative;
transform: translateY(-170%);
position: absolute;
width: 20px;
height: 20px;
`}
Expand Down
2 changes: 1 addition & 1 deletion components/ClassicQuestionWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ export default function ClassicQuestionWrapper({
}}
/>
<Notifications {...{ currentQuestion, engine }} />
{(!isInIframe || !isCompact) && (
{false && (!isInIframe || !isCompact) && (
<>
<br />
<UserProblemBanner />
Expand Down
20 changes: 7 additions & 13 deletions components/DPESelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,12 @@ export default function DPESelector({
oldLetter = isNew && data[+situation['DPE . actuel'] - 1].lettre

return (
<div
style={css`
margin-top: 0.6rem;
`}
>
<DPE
newLetter={newLetter}
letter={isNew ? oldLetter : newLetter}
onClick={(value) =>
console.log('setDPE', value) || doSetSearchParams(value + 1)
}
/>
</div>
<DPE
newLetter={newLetter}
letter={isNew ? oldLetter : newLetter}
onClick={(value) =>
console.log('setDPE', value) || doSetSearchParams(value + 1)
}
/>
)
}

0 comments on commit be5bd55

Please sign in to comment.