From e3016b079a6941b25d29b93bfd0ee5106e16a705 Mon Sep 17 00:00:00 2001 From: alimpens Date: Mon, 25 Nov 2024 10:55:04 +0100 Subject: [PATCH] Use prop instead of loading config for next button --- src/components/NextButton/NextButton.tsx | 21 +++++++------------ .../IncidentNavigation/IncidentNavigation.tsx | 1 + 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/src/components/NextButton/NextButton.tsx b/src/components/NextButton/NextButton.tsx index 8956276144..4774eb9c23 100644 --- a/src/components/NextButton/NextButton.tsx +++ b/src/components/NextButton/NextButton.tsx @@ -6,25 +6,20 @@ import styled from 'styled-components' import Button from 'components/Button' -import configuration from '../../shared/services/configuration/configuration' - -const appMode = configuration.featureFlags.appMode - -const StyledButton = styled(Button)` - margin-right: ${appMode ? '0' : '15px !important'}; - width: ${appMode ? '100%' : 'auto'}; -` - interface Props { - className?: string + appMode?: boolean children: ReactNode onClick: (event: BaseSyntheticEvent) => void } -const NextButton = ({ className = '', children, onClick }: Props) => ( +const StyledButton = styled(Button)` + ${({ appMode }) => !appMode && 'margin-right: 15px !important'}; + ${({ appMode }) => appMode && 'width: 100%;'} +` + +const NextButton = ({ appMode, children, onClick, ...restProps }: Props) => ( { (!mapActive && (appMode ? ( { handleSubmit(e, next, wizardStep.formAction) }}