Skip to content

Commit

Permalink
fix: sizes
Browse files Browse the repository at this point in the history
  • Loading branch information
desoindx committed Oct 7, 2024
1 parent 8194e95 commit 1ac54ea
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 11 deletions.
8 changes: 3 additions & 5 deletions src/components/outils/quiz/QuizSimulator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ const QuizSimulator = () => {
const ref = useRef<HTMLDivElement>(null)
const nextRef = useRef<HTMLButtonElement>(null)

const [finished, setFinished] = useState(false)
const [navigated, setNavigated] = useState(false)
const [question, setQuestion] = useState(0)
const score = useRef<number[]>([])
Expand Down Expand Up @@ -48,11 +47,10 @@ const QuizSimulator = () => {
}, [question, navigated])

useEffect(() => {
if (!finished && !config) {
setFinished(true)
if (!config) {
track('Quiz', 'Finished', score.current.reduce((acc, current) => acc + current, 0).toString())
}
}, [finished, config])
}, [config])

return (
<>
Expand Down Expand Up @@ -178,7 +176,7 @@ const QuizSimulator = () => {
className={styles.moreButton}
onClick={() => {
setDisplayMore(!displayMore)
track('Quiz', displayMore ? 'HideMore' : 'DisplayMore', 'quiz_display_more')
track('Quiz', displayMore ? 'HideMore' : 'DisplayMore', question.toString())
if (displayMore && ref.current) {
ref.current.scrollIntoView({ behavior: 'smooth' })
}
Expand Down
4 changes: 3 additions & 1 deletion src/components/outils/quiz/infos/FriendsVoiture.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use client'

import { useTranslations } from 'next-intl'
import React from 'react'
import React, { useRef } from 'react'
import useParamContext from 'src/providers/ParamProvider'
import Etiquette from 'components/comparateur/Etiquette'
import Icon from './Icon'
Expand All @@ -10,6 +10,7 @@ import styles from './Infos.module.css'
const FriendsVoiture = () => {
const t = useTranslations('quiz.friends-voiture')
const { language } = useParamContext()
const ref = useRef(null)
return (
<>
<div className={styles.container}>
Expand All @@ -25,6 +26,7 @@ const FriendsVoiture = () => {
</div>
<br />
<Etiquette
ref={ref}
baseValue={4990}
comparisons={['streamingvideo', 'voiturethermique']}
language={language}
Expand Down
9 changes: 5 additions & 4 deletions src/components/outils/quiz/infos/ManteauBouilloire.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,11 @@ const ManteauBouilloire = () => {
<div className={styles.container}>
<div className={styles.withIcon}>
<Icon />
<div>{t.rich('line-1')}</div>
<br />
<br />
<div>{t.rich('line-2')}</div>
<div>
<div>{t.rich('line-1')}</div>
<br />
<div>{t.rich('line-2')}</div>
</div>
</div>
</div>
<br />
Expand Down
5 changes: 4 additions & 1 deletion src/components/outils/quiz/infos/TelevisionPNY.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use client'

import { useTranslations } from 'next-intl'
import React from 'react'
import React, { useRef } from 'react'
import useParamContext from 'src/providers/ParamProvider'
import Etiquette from 'components/comparateur/Etiquette'
import Icon from './Icon'
Expand All @@ -10,6 +10,8 @@ import styles from './Infos.module.css'
const TelevisionPNY = () => {
const t = useTranslations('quiz.television-pny')
const { language } = useParamContext()
const ref = useRef(null)

return (
<>
<div className={styles.container}>
Expand All @@ -25,6 +27,7 @@ const TelevisionPNY = () => {
</div>
<br />
<Etiquette
ref={ref}
baseValue={1770000}
comparisons={['avion-pny', 'francais']}
language={language}
Expand Down

0 comments on commit 1ac54ea

Please sign in to comment.