Skip to content

Commit

Permalink
#3250 - fix presets position
Browse files Browse the repository at this point in the history
  • Loading branch information
Olga Mazurina committed Oct 11, 2023
1 parent 8f1230b commit 73fb4b2
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import {
DisabledArea,
RnaAccordionContainer,
StyledAccordion,
StyledAccordionWrapper,
StyledButton,
} from './styles';
import { Summary } from './Summary';
Expand Down Expand Up @@ -219,7 +220,22 @@ export const RnaAccordion = ({ libraryName }) => {
})}
</DetailsContainer>
);
return (
const presetsExpanded =
groupData.groupName === RnaBuilderPresetsItem.Presets && expanded;

return presetsExpanded ? (
<StyledAccordionWrapper key={groupData.groupName}>
<StyledAccordion
data-testid="styled-accordion"
summary={summary}
details={details}
expanded={expanded}
onSummaryClick={() =>
handleAccordionSummaryClick(groupData.groupName)
}
/>
</StyledAccordionWrapper>
) : (
<StyledAccordion
key={groupData.groupName}
data-testid="styled-accordion"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const Summary = ({
<SummaryText>
{groupName} ({quantity})
</SummaryText>
<StyledIcon name="chevron" expanded={expanded} />
<StyledIcon name="chevron" expanded={!expanded} />
</SummaryContainer>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,18 @@ export const RnaAccordionContainer = styled.div({
flexDirection: 'column',
justifyContent: 'flex-end',
overflow: 'hidden',
height: '100%',
});

export const StyledAccordion = styled(Accordion)({
minHeight: '32px',
});

export const StyledAccordionWrapper = styled.div({
flexGrow: 2,
minHeight: '32px',
});

export const DetailsContainer = styled.div({
position: 'relative',
width: '100%',
Expand Down

0 comments on commit 73fb4b2

Please sign in to comment.