🐛 répare le bug du champs perdant le focus
parent
8f5bea211e
commit
40f36e7eb9
|
@ -8,7 +8,10 @@ import emoji from 'react-easy-emoji'
|
|||
import { Trans, useTranslation } from 'react-i18next'
|
||||
import { useDispatch, useSelector } from 'react-redux'
|
||||
import { DottedName } from 'Rules'
|
||||
import { answeredQuestionsSelector } from 'Selectors/simulationSelectors'
|
||||
import {
|
||||
answeredQuestionsSelector,
|
||||
situationSelector
|
||||
} from 'Selectors/simulationSelectors'
|
||||
import './AnswerList.css'
|
||||
|
||||
type AnswerListProps = {
|
||||
|
@ -17,7 +20,9 @@ type AnswerListProps = {
|
|||
|
||||
export default function AnswerList({ onClose }: AnswerListProps) {
|
||||
const dispatch = useDispatch()
|
||||
const answeredQuestions = useSelector(answeredQuestionsSelector)
|
||||
const answeredQuestions: DottedName[] = Object.keys(
|
||||
useSelector(situationSelector)
|
||||
)
|
||||
const nextSteps = useNextQuestions()
|
||||
|
||||
return (
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { formatValue } from 'publicodes'
|
||||
import React, { useCallback } from 'react'
|
||||
import React, { useCallback, useState } from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import NumberFormat from 'react-number-format'
|
||||
import { currencyFormat, debounce } from '../../utils'
|
||||
|
@ -21,6 +21,7 @@ export default function Input({
|
|||
const { language } = useTranslation().i18n
|
||||
const { thousandSeparator, decimalSeparator } = currencyFormat(language)
|
||||
|
||||
// const [currentValue, setCurrentValue] = useState(value)
|
||||
return (
|
||||
<div className="step input">
|
||||
<div>
|
||||
|
@ -42,9 +43,10 @@ export default function Input({
|
|||
allowEmptyFormatting={true}
|
||||
// We don't want to call `onValueChange` in case this component is
|
||||
// re-render with a new "value" prop from the outside.
|
||||
key={value}
|
||||
onValueChange={({ floatValue }) => {
|
||||
debouncedOnChange(floatValue)
|
||||
if (floatValue !== value) {
|
||||
debouncedOnChange(floatValue)
|
||||
}
|
||||
}}
|
||||
value={value}
|
||||
autoComplete="off"
|
||||
|
|
|
@ -46,34 +46,12 @@ export default function IndépendantExplanation() {
|
|||
function PLExplanation() {
|
||||
return (
|
||||
<Trans i18nKey="simulateurs.explanation.pamc">
|
||||
<h2>Vos institutions partenaires</h2>
|
||||
<div className="ui__ box-container">
|
||||
<div className="ui__ card box">
|
||||
<a target="_blank" href="https://www.urssaf.fr/portail/home.html">
|
||||
<LogoImg src={urssafSrc} title="logo Urssaf" />
|
||||
</a>
|
||||
<p
|
||||
className="ui__ notice"
|
||||
css={`
|
||||
flex: 1;
|
||||
`}
|
||||
>
|
||||
Les cotisations recouvrées par l'Urssaf, qui servent au financement
|
||||
de la sécurité sociale (assurance maladie, allocations familiales,
|
||||
dépendance)
|
||||
</p>
|
||||
<p className="ui__ lead">
|
||||
<Value expression="dirigeant . indépendant . PL . cotisations Urssaf" />
|
||||
</p>
|
||||
</div>
|
||||
<CaisseRetraite />
|
||||
<Condition expression="dirigeant . indépendant . PL . PAMC . participation CPAM > 0">
|
||||
<Animate.fromBottom>
|
||||
<h2>Vos institutions partenaires</h2>
|
||||
<div className="ui__ box-container">
|
||||
<div className="ui__ card box">
|
||||
<a
|
||||
target="_blank"
|
||||
href="https://www.urssaf.fr/portail/home/praticien-et-auxiliaire-medical/mes-cotisations/le-calcul-de-mes-cotisations/la-participation-de-la-cpam-a-me.html"
|
||||
>
|
||||
<LogoImg src={assuranceMaladieSrc} title="Logo CPAM" />
|
||||
<a target="_blank" href="https://www.urssaf.fr/portail/home.html">
|
||||
<LogoImg src={urssafSrc} title="logo Urssaf" />
|
||||
</a>
|
||||
<p
|
||||
className="ui__ notice"
|
||||
|
@ -81,17 +59,41 @@ function PLExplanation() {
|
|||
flex: 1;
|
||||
`}
|
||||
>
|
||||
En tant que professionnel de santé conventionné, vous bénéficiez
|
||||
d'une prise en charge d'une partie de vos cotisations par
|
||||
l'Assurance Maladie.
|
||||
Les cotisations recouvrées par l'Urssaf, qui servent au
|
||||
financement de la sécurité sociale (assurance maladie, allocations
|
||||
familiales, dépendance)
|
||||
</p>
|
||||
<p className="ui__ lead">
|
||||
<Emoji emoji="🎁" />{' '}
|
||||
<Value expression="dirigeant . indépendant . PL . PAMC . participation CPAM" />
|
||||
<Value expression="dirigeant . indépendant . PL . cotisations Urssaf" />
|
||||
</p>
|
||||
</div>
|
||||
</Condition>
|
||||
</div>
|
||||
<CaisseRetraite />
|
||||
<Condition expression="dirigeant . indépendant . PL . PAMC . participation CPAM > 0">
|
||||
<div className="ui__ card box">
|
||||
<a
|
||||
target="_blank"
|
||||
href="https://www.urssaf.fr/portail/home/praticien-et-auxiliaire-medical/mes-cotisations/le-calcul-de-mes-cotisations/la-participation-de-la-cpam-a-me.html"
|
||||
>
|
||||
<LogoImg src={assuranceMaladieSrc} title="Logo CPAM" />
|
||||
</a>
|
||||
<p
|
||||
className="ui__ notice"
|
||||
css={`
|
||||
flex: 1;
|
||||
`}
|
||||
>
|
||||
En tant que professionnel de santé conventionné, vous bénéficiez
|
||||
d'une prise en charge d'une partie de vos cotisations par
|
||||
l'Assurance Maladie.
|
||||
</p>
|
||||
<p className="ui__ lead">
|
||||
<Emoji emoji="🎁" />{' '}
|
||||
<Value expression="dirigeant . indépendant . PL . PAMC . participation CPAM" />
|
||||
</p>
|
||||
</div>
|
||||
</Condition>
|
||||
</div>
|
||||
</Animate.fromBottom>
|
||||
</Trans>
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue