✨ Formattage de code
parent
70b2559256
commit
7b861ffc86
|
@ -1,13 +1,13 @@
|
|||
import React from "react"
|
||||
import { Link } from "react-router-dom"
|
||||
import { encodeRuleName } from "Engine/rules"
|
||||
import classNames from "classnames"
|
||||
import { capitalise0 } from "../../utils"
|
||||
let fmt = new Intl.NumberFormat("fr-FR").format
|
||||
import React from 'react'
|
||||
import { Link } from 'react-router-dom'
|
||||
import { encodeRuleName } from 'Engine/rules'
|
||||
import classNames from 'classnames'
|
||||
import { capitalise0 } from '../../utils'
|
||||
let fmt = new Intl.NumberFormat('fr-FR').format
|
||||
export let humanFigure = decimalDigits => value =>
|
||||
fmt(value.toFixed(decimalDigits))
|
||||
import "./RuleValueVignette.css"
|
||||
import ReactCSSTransitionGroup from "react-addons-css-transition-group"
|
||||
import './RuleValueVignette.css'
|
||||
import ReactCSSTransitionGroup from 'react-addons-css-transition-group'
|
||||
|
||||
export default ({
|
||||
name,
|
||||
|
@ -19,16 +19,16 @@ export default ({
|
|||
do {
|
||||
let unsatisfied = ruleValue == null,
|
||||
irrelevant = ruleValue == 0,
|
||||
number = typeof ruleValue == "number" && ruleValue > 0
|
||||
number = typeof ruleValue == 'number' && ruleValue > 0
|
||||
;<span
|
||||
key={name}
|
||||
className={classNames("RuleValueVignette", {
|
||||
className={classNames('RuleValueVignette', {
|
||||
unsatisfied,
|
||||
irrelevant,
|
||||
number
|
||||
})}
|
||||
>
|
||||
<Link to={"/regle/" + encodeRuleName(name)}>
|
||||
<Link to={'/regle/' + encodeRuleName(name)}>
|
||||
<div className="rule-box">
|
||||
<span className="rule-name">{title}</span>
|
||||
<RuleValue
|
||||
|
@ -42,10 +42,10 @@ export default ({
|
|||
let RuleValue = ({ unsatisfied, irrelevant, conversationStarted, ruleValue }) =>
|
||||
do {
|
||||
let [className, text] = irrelevant
|
||||
? ["irrelevant", "Vous n'êtes pas concerné"]
|
||||
? ['irrelevant', 'Vous n\'êtes pas concerné']
|
||||
: unsatisfied
|
||||
? ["unsatisfied", "En attente de vos réponses..."]
|
||||
: ["figure", humanFigure(2)(ruleValue) + " €"]
|
||||
? ['unsatisfied', 'En attente de vos réponses...']
|
||||
: ['figure', humanFigure(2)(ruleValue) + ' €']
|
||||
|
||||
{
|
||||
/*<p><i className="fa fa-lightbulb-o" aria-hidden="true"></i><em>Pourquoi ?</em></p> */
|
||||
|
@ -57,7 +57,7 @@ let RuleValue = ({ unsatisfied, irrelevant, conversationStarted, ruleValue }) =>
|
|||
transitionLeaveTimeout={100}
|
||||
>
|
||||
<span key={text} className="rule-value">
|
||||
{" "}
|
||||
{' '}
|
||||
{conversationStarted && <span className={className}>{text}</span>}
|
||||
</span>
|
||||
</ReactCSSTransitionGroup>
|
||||
|
|
Loading…
Reference in New Issue