1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-08-09 13:47:13 +02:00

feat: open environment accordion if there is only one environment in a project

This commit is contained in:
Tymoteusz Czech 2024-09-19 17:43:28 +02:00
parent 10ec2e7de5
commit d7a3d28249
No known key found for this signature in database
GPG Key ID: 133555230D88D75F

View File

@ -131,6 +131,7 @@ const FeatureOverviewEnvironment = ({
const featureEnvironment = feature?.environments.find(
(featureEnvironment) => featureEnvironment.name === env.name,
);
const defaultExpanded = feature?.environments.length === 1;
return (
<ConditionallyRender
@ -143,6 +144,7 @@ const FeatureOverviewEnvironment = ({
className={`environment-accordion ${
env.enabled ? '' : 'accordion-disabled'
}`}
defaultExpanded={defaultExpanded}
>
<StyledAccordionSummary
expandIcon={<ExpandMore titleAccess='Toggle' />}