mirror of
https://github.com/Unleash/unleash.git
synced 2025-08-13 13:48:59 +02:00
chore: align recently used constraints to designs (#9904)
Now both of the recents have aligned styling. Now ConstraintAccordionView accepts dashed and solid borders. 
This commit is contained in:
parent
8d377f76b7
commit
8e05c92440
@ -26,10 +26,17 @@ interface IConstraintAccordionViewProps {
|
||||
compact?: boolean;
|
||||
disabled?: boolean;
|
||||
renderAfter?: JSX.Element;
|
||||
borderStyle?: 'solid' | 'dashed';
|
||||
}
|
||||
|
||||
const StyledAccordion = styled(Accordion)(({ theme }) => ({
|
||||
border: `1px solid ${theme.palette.divider}`,
|
||||
interface StyledAccordionProps {
|
||||
borderStyle?: 'solid' | 'dashed';
|
||||
}
|
||||
|
||||
const StyledAccordion = styled(Accordion, {
|
||||
shouldForwardProp: (prop) => prop !== 'borderStyle',
|
||||
})<StyledAccordionProps>(({ theme, borderStyle = 'solid' }) => ({
|
||||
border: `1px ${borderStyle} ${theme.palette.divider}`,
|
||||
borderRadius: theme.shape.borderRadiusMedium,
|
||||
boxShadow: 'none',
|
||||
margin: 0,
|
||||
@ -73,6 +80,7 @@ export const ConstraintAccordionView = ({
|
||||
compact = false,
|
||||
disabled = false,
|
||||
renderAfter,
|
||||
borderStyle = 'solid',
|
||||
}: IConstraintAccordionViewProps) => {
|
||||
const [expandable, setExpandable] = useState(true);
|
||||
const [expanded, setExpanded] = useState(false);
|
||||
@ -88,7 +96,7 @@ export const ConstraintAccordionView = ({
|
||||
};
|
||||
|
||||
return (
|
||||
<StyledAccordion expanded={expanded} sx={sx}>
|
||||
<StyledAccordion expanded={expanded} sx={sx} borderStyle={borderStyle}>
|
||||
<StyledAccordionSummary
|
||||
expandIcon={null}
|
||||
onClick={handleClick}
|
||||
|
@ -41,6 +41,7 @@ export const RecentlyUsedConstraints = ({
|
||||
<ConstraintAccordionView
|
||||
key={constraint[constraintId]}
|
||||
constraint={constraint}
|
||||
borderStyle='dashed'
|
||||
onUse={() => {
|
||||
setConstraints((prev) => [...prev, constraint]);
|
||||
}}
|
||||
|
Loading…
Reference in New Issue
Block a user