1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-02-04 00:18:01 +01:00

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.
This commit is contained in:
Nuno Góis 2024-11-08 08:18:30 +00:00 committed by GitHub
parent b52dcb3082
commit f669d9622e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 6 deletions

View File

@ -96,7 +96,7 @@ export const EventTimelineHeader = ({
<EventTimelineHeaderTip />
<StyledCol>
<ConditionallyRender
condition={Boolean(environment)}
condition={Boolean(environment) && environments.length > 0}
show={() => (
<StyledFilter
select

View File

@ -171,11 +171,11 @@ const EnvironmentIconBox = styled(Box)(({ theme }) => ({
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),