Suppression d'appels non utilisés

pull/682/head
Maxime Quandalle 2019-09-11 18:17:07 +02:00
parent fcb5699fbc
commit bdd9505586
No known key found for this signature in database
GPG Key ID: 428641C03D29CA10
5 changed files with 29 additions and 38 deletions

View File

@ -9,7 +9,6 @@ import { analysisWithDefaultsSelector } from 'Selectors/analyseSelectors'
import animate from 'Ui/animate'
import './Controls.css'
import { Markdown } from './utils/markdown'
import withColours from './utils/withColours'
function Controls({
controls,
@ -94,6 +93,5 @@ export default compose(
goToQuestion,
hideControl
}
),
withColours
)
)(Controls)

View File

@ -1,7 +1,6 @@
import { T } from 'Components'
import Distribution from 'Components/Distribution'
import PaySlip from 'Components/PaySlip'
import withTracker from 'Components/utils/withTracker'
import { compose } from 'ramda'
import React, { useRef } from 'react'
import emoji from 'react-easy-emoji'
@ -26,7 +25,6 @@ class ErrorBoundary extends React.Component {
}
export default compose(
withTracker,
connect(state => ({
showDistributionFirst: !state.conversationSteps.foldedSteps.length
}))

View File

@ -1,4 +1,3 @@
import withColours from 'Components/utils/withColours'
import { compose, toPairs } from 'ramda'
import React, { useState } from 'react'
import { useTranslation } from 'react-i18next'
@ -6,7 +5,6 @@ import { connect } from 'react-redux'
import { formValueSelector } from 'redux-form'
export default compose(
withColours,
connect(state => ({
period: formValueSelector('conversation')(state, 'période')
}))

View File

@ -6,7 +6,6 @@ import logoEnSvg from 'Images/logo-mycompany.svg'
import logoSvg from 'Images/logo.svg'
import marianneSvg from 'Images/marianne.svg'
import urssafSvg from 'Images/urssaf.svg'
import { compose } from 'ramda'
import React from 'react'
import emoji from 'react-easy-emoji'
import { useTranslation } from 'react-i18next'
@ -19,7 +18,7 @@ import type { SitePaths } from 'Components/utils/withSitePaths'
type Props = {
sitePaths: SitePaths
}
export default compose(withSitePaths)(({ sitePaths }: Props) => {
export default withSitePaths(({ sitePaths }: Props) => {
const {
i18n: { language }
} = useTranslation()

View File

@ -53,36 +53,34 @@ export default (function ActivitésSelection() {
)
})
export const ActivitéSelection = withSitePaths(
({ activités, currentActivité }) => {
const { state } = useContext(StoreContext)
const activitéRépondue = activitésRéponduesSelector(state)
const nextButtonDisabled = !intersection(
activitésEffectuéesSelector(state),
activités
).length
export const ActivitéSelection = ({ activités, currentActivité }) => {
const { state } = useContext(StoreContext)
const activitéRépondue = activitésRéponduesSelector(state)
const nextButtonDisabled = !intersection(
activitésEffectuéesSelector(state),
activités
).length
return (
<>
<div css="display: flex; flex-wrap: wrap; justify-content: center">
{activités.map(title => {
const selected = state[title].effectuée
const answered = activitéRépondue.includes(title)
return (
<ActivitéCard
key={title}
title={title}
selected={selected}
answered={answered}
/>
)
})}
</div>
<NextButton disabled={nextButtonDisabled} activité={currentActivité} />
</>
)
}
)
return (
<>
<div css="display: flex; flex-wrap: wrap; justify-content: center">
{activités.map(title => {
const selected = state[title].effectuée
const answered = activitéRépondue.includes(title)
return (
<ActivitéCard
key={title}
title={title}
selected={selected}
answered={answered}
/>
)
})}
</div>
<NextButton disabled={nextButtonDisabled} activité={currentActivité} />
</>
)
}
const activitéCardCss = `
width: 14rem;