From f669d9622e5b522d469ab6dbc94ebcebfb6e7375 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nuno=20G=C3=B3is?= Date: Fri, 8 Nov 2024 08:18:30 +0000 Subject: [PATCH] fix: console warnings and errors related to event timeline and strategy form (#8692) Fixes browser console warnings and errors related to the event timeline and strategy form. - **Event Timeline**: Addressed a warning where the environment filter rendered with a default environment value (production) before environments were fully loaded. - **Strategy Form**: Resolved an error caused by forwarding the enabled prop as a boolean. --- .../EventTimelineHeader/EventTimelineHeader.tsx | 2 +- .../FeatureStrategyForm/FeatureStrategyForm.tsx | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/frontend/src/component/events/EventTimeline/EventTimelineHeader/EventTimelineHeader.tsx b/frontend/src/component/events/EventTimeline/EventTimelineHeader/EventTimelineHeader.tsx index cb5cbc0a5a2c..e29ee1171804 100644 --- a/frontend/src/component/events/EventTimeline/EventTimelineHeader/EventTimelineHeader.tsx +++ b/frontend/src/component/events/EventTimeline/EventTimelineHeader/EventTimelineHeader.tsx @@ -96,7 +96,7 @@ export const EventTimelineHeader = ({ 0} show={() => ( ({ alignItems: 'center', })); -const EnvironmentTypography = styled(Typography)<{ enabled: boolean }>( - ({ theme, enabled }) => ({ - fontWeight: enabled ? 'bold' : 'normal', - }), -); +const EnvironmentTypography = styled(Typography, { + shouldForwardProp: (prop) => prop !== 'enabled', +})<{ enabled: boolean }>(({ enabled }) => ({ + fontWeight: enabled ? 'bold' : 'normal', +})); const EnvironmentTypographyHeader = styled(Typography)(({ theme }) => ({ marginRight: theme.spacing(0.5),