From cac45d28018cd5e59a56e5fc4a39b579af9eed2a Mon Sep 17 00:00:00 2001 From: Hugo Nouts <hnouts@grandlyon.com> Date: Fri, 29 May 2020 15:01:31 +0200 Subject: [PATCH] us-135 done --- .../FluidChartContainer.tsx | 5 +--- .../ActivateHalfHourLoad.tsx | 25 ++++++++++++------- .../FluidChart/FluidChartContent.tsx | 4 --- src/locales/en.json | 2 +- src/styles/base/_layout.scss | 1 - 5 files changed, 18 insertions(+), 19 deletions(-) diff --git a/src/components/ContainerComponents/FluidChartContainer/FluidChartContainer.tsx b/src/components/ContainerComponents/FluidChartContainer/FluidChartContainer.tsx index 8eb5174e0..5837e30ee 100644 --- a/src/components/ContainerComponents/FluidChartContainer/FluidChartContainer.tsx +++ b/src/components/ContainerComponents/FluidChartContainer/FluidChartContainer.tsx @@ -114,16 +114,13 @@ const FluidChartContainer: React.FC<FluidChartContainerProps> = ({ {isLoaded ? ( <div className="fc-root"> <div className="fc-content"> - {isMinuteBlocked && timeStep === 10 && ( - <ActivateHalfHourLoad timeStep={timeStep} /> - )} + {isMinuteBlocked && timeStep === 10 && <ActivateHalfHourLoad />} <FluidChartContent referenceDate={referenceDate} lastDataDate={lastDataDate} lastDateWithAllData={lastDateWithAllData} fluidTypes={fluidTypes} timeStep={timeStep} - activateHalfHourLoad={isMinuteBlocked} multiFluid={multiFluid} currentChallenge={challenge} consumptionDataManager={consumptionDataManager} diff --git a/src/components/ContentComponents/ConsumptionNavigator/ActivateHalfHourLoad.tsx b/src/components/ContentComponents/ConsumptionNavigator/ActivateHalfHourLoad.tsx index 729da9861..a0735d1e3 100644 --- a/src/components/ContentComponents/ConsumptionNavigator/ActivateHalfHourLoad.tsx +++ b/src/components/ContentComponents/ConsumptionNavigator/ActivateHalfHourLoad.tsx @@ -1,29 +1,36 @@ import React from 'react' import { translate } from 'cozy-ui/react/I18n' -import { TimeStep } from 'services/dataConsumptionContracts' -import IFluidConfig from 'services/IFluidConfig' -import StyledButton from 'components/CommonKit/Button/StyledButton' +import StyledOauthButton from 'components/CommonKit/Button/StyledOauthButton' +import StyledIcon from 'components/CommonKit/Icon/StyledIcon' +import iconEnedisLogo from 'assets/icons/visu/enedis-logo.svg' +import Config from '../../../../config.json' interface ActivateHalfHourLoadProps { - timeStep: TimeStep t: Function // translation service } const ActivateHalfHourLoad = ({ t }: ActivateHalfHourLoadProps) => { - const siteLink = 'https://mon-compte-client.enedis.fr/' + const siteLink = Config.fluidConfig[0].siteLink //TODO change here return ( <div className="cta-box"> <div className="cta-box-header header-text text-16-normal"> {t('timestep.activate.enedis.info')} </div> - <StyledButton + <StyledOauthButton className="cta-box-button" - type="submit" + type="button" color="primary" onClick={() => window.open(siteLink, '_blank')} > - {t('timestep.activate.enedis.label1')} - </StyledButton> + <div className="oauthform-button-content"> + <div className="oauthform-button-content-icon"> + <StyledIcon icon={iconEnedisLogo} size={48} /> + </div> + <div className="oauthform-button-text text-18-bold"> + <div> {t('timestep.activate.enedis.label1')}</div> + </div> + </div> + </StyledOauthButton> </div> ) } diff --git a/src/components/ContentComponents/FluidChart/FluidChartContent.tsx b/src/components/ContentComponents/FluidChart/FluidChartContent.tsx index 1d7f0fcb8..92019ef58 100644 --- a/src/components/ContentComponents/FluidChart/FluidChartContent.tsx +++ b/src/components/ContentComponents/FluidChart/FluidChartContent.tsx @@ -23,7 +23,6 @@ import ConsumptionVisualizer from 'components/ContentComponents/ConsumptionVisua import StyledIcon from 'components/CommonKit/Icon/StyledIcon' import captionIcon from 'assets/icons/visu/challenge-caption-chart.svg' -import ActivateHalfHourLoad from '../ConsumptionNavigator/ActivateHalfHourLoad' interface FluidChartContentProps { fluidTypes: FluidType[] @@ -31,7 +30,6 @@ interface FluidChartContentProps { referenceDate: DateTime lastDataDate: DateTime lastDateWithAllData: DateTime - activateHalfHourLoad: boolean multiFluid: boolean currentChallenge: UserChallenge | null consumptionDataManager: IConsumptionDataManager @@ -47,7 +45,6 @@ const FluidChartContent: React.FC<FluidChartContentProps> = ({ lastDataDate, lastDateWithAllData, multiFluid, - activateHalfHourLoad, currentChallenge, consumptionDataManager, isDataLoaded, @@ -76,7 +73,6 @@ const FluidChartContent: React.FC<FluidChartContentProps> = ({ setIndexDisplayed(index) setIsLoaded(false) } - console.log('HOUR LOAD is : ', activateHalfHourLoad, timeStep) const handleClickData = ( dataload: IDataload, diff --git a/src/locales/en.json b/src/locales/en.json index 396406c2d..3592619ec 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -201,7 +201,7 @@ "activate": { "enedis": { "info": "Pour visualiser vos consommations à la 1/2 heure, il vous faut valider l'activation de l'enregistrement de votre consommation horaire sur votre compte Enedis", - "label1": "Activer sur Enedis", + "label1": "Activer sur mon compte Enedis", "activateLink": "https://mon-compte-client.enedis.fr/" } } diff --git a/src/styles/base/_layout.scss b/src/styles/base/_layout.scss index 8b7e4be6b..e3665c494 100644 --- a/src/styles/base/_layout.scss +++ b/src/styles/base/_layout.scss @@ -142,7 +142,6 @@ body { .cta-box-button { margin-left: auto; margin-right: auto; - color: black; width: 80%; } } -- GitLab