mon-entreprise/source/components/Targets.js

50 lines
1.4 KiB
JavaScript
Raw Normal View History

2019-01-08 19:43:57 +00:00
import withColours from 'Components/utils/withColours'
import withSitePaths from 'Components/utils/withSitePaths'
2019-01-08 19:43:57 +00:00
import { compose } from 'ramda'
import React from 'react'
2019-01-08 19:43:57 +00:00
import emoji from 'react-easy-emoji'
import { connect } from 'react-redux'
import { Link } from 'react-router-dom'
import sitePaths from '../../sites/mycompanyinfrance.fr/sitePaths';
2019-01-08 19:43:57 +00:00
import { analysisWithDefaultsSelector } from 'Selectors/analyseSelectors'
import './Targets.css'
2018-12-06 17:22:38 +00:00
export default compose(
connect(state => ({ analysis: analysisWithDefaultsSelector(state) })),
withColours,
withSitePaths,
2018-12-06 17:22:38 +00:00
)(
class Targets extends React.Component {
render() {
let {
title,
nodeValue,
sitePaths,
2018-12-06 17:22:38 +00:00
unité: unit,
dottedName
} = this.props.analysis.targets[0]
2018-12-06 17:22:38 +00:00
return (
<div id="targets">
<span className="icon"></span>
<span
className="content"
style={{ color: this.props.colours.textColour }}>
{/*<span className="title">{title}</span>
{' : '} */}
2018-12-06 17:22:38 +00:00
<span className="figure">
<span className="value">{nodeValue?.toFixed(1)}</span>{' '}
<span className="unit">{unit}</span>
</span>
<Link
title="Quel est calcul ?"
style={{ color: this.props.colours.colour }}
to={sitePaths.documentation.index + '/' + dottedName}
2018-12-06 17:22:38 +00:00
className="explanation">
{emoji('📖')}
</Link>
</span>
2018-12-06 17:22:38 +00:00
</div>
)
}
}
2018-12-06 17:22:38 +00:00
)