From 0df26852ad20d72ead998d94c8718d4697278936 Mon Sep 17 00:00:00 2001 From: Michal Zielenkiewicz Date: Tue, 14 May 2024 15:05:31 +0200 Subject: [PATCH 1/2] Remove usage of defaultProps in HomePage --- .../pages/HomePage/Graph/HelpScreen/index.tsx | 10 +++------- .../HomePage/Graph/ParaTimeSelector/index.tsx | 20 +++++++++---------- src/stories/ButtonsShowroom.stories.tsx | 3 --- 3 files changed, 13 insertions(+), 20 deletions(-) diff --git a/src/app/pages/HomePage/Graph/HelpScreen/index.tsx b/src/app/pages/HomePage/Graph/HelpScreen/index.tsx index 62106eb97..b192b9c1d 100644 --- a/src/app/pages/HomePage/Graph/HelpScreen/index.tsx +++ b/src/app/pages/HomePage/Graph/HelpScreen/index.tsx @@ -34,12 +34,6 @@ const SwiperBox = styled(Box)(() => ({ height: '40%', })) -export const GetStartedBtn = styled(Button)({}) -GetStartedBtn.defaultProps = { - variant: 'contained', - color: 'primary', -} - interface Step { icon: ReactElement label: string @@ -135,7 +129,9 @@ const HelpScreen: FC = ({ setParaTimeStep }) => { /> )} {activeStep > 1 && ( - {t('home.helpScreen.getStarted')} + )} ) diff --git a/src/app/pages/HomePage/Graph/ParaTimeSelector/index.tsx b/src/app/pages/HomePage/Graph/ParaTimeSelector/index.tsx index 7edb48278..f5883b775 100644 --- a/src/app/pages/HomePage/Graph/ParaTimeSelector/index.tsx +++ b/src/app/pages/HomePage/Graph/ParaTimeSelector/index.tsx @@ -97,10 +97,6 @@ export const ExploreBtn = styled(Button)(({ theme }) => ({ paddingRight: theme.spacing(6), }, })) -ExploreBtn.defaultProps = { - color: 'secondary', - variant: 'contained', -} export const ZoomOutBtn = styled(Button)(({ theme }) => ({ color: theme.palette.layout.graphZoomOutText, @@ -118,11 +114,7 @@ export const ZoomOutBtn = styled(Button)(({ theme }) => ({ backgroundColor: 'transparent', }, })) -ZoomOutBtn.defaultProps = { - color: 'primary', - variant: 'text', - startIcon: , -} + const ZoomOutBtnFade = styled(Fade)(() => ({ transitionDelay: '500ms !important', })) @@ -267,13 +259,21 @@ const ParaTimeSelectorCmp: FC = ({ {!isMobile && ( - + } + onClick={onZoomOutClick} + disabled={disabled} + > {t('home.zoomOutBtnText')} )} {isMobile && ParaTimeSelectorUtils.showExploreBtn(step) && ( {