1
0
Fork 0
mirror of https://github.com/betagouv/mon-entreprise synced 2025-02-09 04:05:01 +00:00
mon-entreprise/source/components/Targets.tsx
Maxime Quandalle 6545281f01
Suppression de liens morts dans la description SEO (#858)
* Personnalise la configuration ESLint pour les scripts

* 👽 Déplace la traduction de l'explication SEO

sur le simulateur salarié

* Ajout d'une fonction rule dans sitePaths

Permet de type-checker le nom de la règle pour éviter les liens morts

* 👽 Ajoute un test pour la traduction des unités

* 👽 Traduction BNC

* 👽 fix translations
2020-01-27 12:17:26 +01:00

34 lines
1.1 KiB
TypeScript

import { ThemeColorsContext } from 'Components/utils/colors'
import { SitePathsContext } from 'Components/utils/withSitePaths'
import React, { useContext } from 'react'
import emoji from 'react-easy-emoji'
import { useSelector } from 'react-redux'
import { Link } from 'react-router-dom'
import { analysisWithDefaultsSelector } from 'Selectors/analyseSelectors'
import './Targets.css'
export default function Targets() {
const colors = useContext(ThemeColorsContext)
const sitePaths = useContext(SitePathsContext)
const analysis = useSelector(analysisWithDefaultsSelector)
let { nodeValue, unité: unit, dottedName } = analysis.targets[0]
return (
<div id="targets">
<span className="icon"></span>
<span className="content" style={{ color: colors.textColor }}>
<span className="figure">
<span className="value">{nodeValue?.toFixed(1)}</span>{' '}
<span className="unit">{unit}</span>
</span>
<Link
title="Quel est calcul ?"
style={{ color: colors.color }}
to={sitePaths.documentation.rule(dottedName)}
className="explanation"
>
{emoji('📖')}
</Link>
</span>
</div>
)
}