mirror of
https://github.com/Unleash/unleash.git
synced 2025-09-10 17:53:36 +02:00
feat: remove borders, improve draggable visibility etc (#9002)
This commit is contained in:
parent
487d3f25e9
commit
3fb7097fd9
@ -19,7 +19,6 @@ import { ConditionallyRender } from 'component/common/ConditionallyRender/Condit
|
|||||||
const StyledContainer = styled('div')(({ theme }) => ({
|
const StyledContainer = styled('div')(({ theme }) => ({
|
||||||
padding: theme.spacing(2),
|
padding: theme.spacing(2),
|
||||||
borderRadius: theme.shape.borderRadiusMedium,
|
borderRadius: theme.shape.borderRadiusMedium,
|
||||||
border: `1px solid ${theme.palette.divider}`,
|
|
||||||
'& + &': {
|
'& + &': {
|
||||||
marginTop: theme.spacing(2),
|
marginTop: theme.spacing(2),
|
||||||
},
|
},
|
||||||
|
@ -13,6 +13,7 @@ import {
|
|||||||
ReleasePlanMilestoneStatus,
|
ReleasePlanMilestoneStatus,
|
||||||
type MilestoneStatus,
|
type MilestoneStatus,
|
||||||
} from './ReleasePlanMilestoneStatus';
|
} from './ReleasePlanMilestoneStatus';
|
||||||
|
import { useState } from 'react';
|
||||||
|
|
||||||
const StyledAccordion = styled(Accordion, {
|
const StyledAccordion = styled(Accordion, {
|
||||||
shouldForwardProp: (prop) => prop !== 'status',
|
shouldForwardProp: (prop) => prop !== 'status',
|
||||||
@ -51,7 +52,6 @@ const StyledSecondaryLabel = styled('span')(({ theme }) => ({
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
const StyledAccordionDetails = styled(AccordionDetails)(({ theme }) => ({
|
const StyledAccordionDetails = styled(AccordionDetails)(({ theme }) => ({
|
||||||
backgroundColor: theme.palette.envAccordion.expanded,
|
|
||||||
borderBottomLeftRadius: theme.shape.borderRadiusLarge,
|
borderBottomLeftRadius: theme.shape.borderRadiusLarge,
|
||||||
borderBottomRightRadius: theme.shape.borderRadiusLarge,
|
borderBottomRightRadius: theme.shape.borderRadiusLarge,
|
||||||
}));
|
}));
|
||||||
@ -67,6 +67,8 @@ export const ReleasePlanMilestone = ({
|
|||||||
status,
|
status,
|
||||||
onStartMilestone,
|
onStartMilestone,
|
||||||
}: IReleasePlanMilestoneProps) => {
|
}: IReleasePlanMilestoneProps) => {
|
||||||
|
const [expanded, setExpanded] = useState(false);
|
||||||
|
|
||||||
if (!milestone.strategies.length) {
|
if (!milestone.strategies.length) {
|
||||||
return (
|
return (
|
||||||
<StyledAccordion status={status}>
|
<StyledAccordion status={status}>
|
||||||
@ -85,7 +87,10 @@ export const ReleasePlanMilestone = ({
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<StyledAccordion status={status}>
|
<StyledAccordion
|
||||||
|
status={status}
|
||||||
|
onChange={(evt, expanded) => setExpanded(expanded)}
|
||||||
|
>
|
||||||
<StyledAccordionSummary expandIcon={<ExpandMore />}>
|
<StyledAccordionSummary expandIcon={<ExpandMore />}>
|
||||||
<StyledTitleContainer>
|
<StyledTitleContainer>
|
||||||
<StyledTitle>{milestone.name}</StyledTitle>
|
<StyledTitle>{milestone.name}</StyledTitle>
|
||||||
@ -96,8 +101,8 @@ export const ReleasePlanMilestone = ({
|
|||||||
</StyledTitleContainer>
|
</StyledTitleContainer>
|
||||||
<StyledSecondaryLabel>
|
<StyledSecondaryLabel>
|
||||||
{milestone.strategies.length === 1
|
{milestone.strategies.length === 1
|
||||||
? 'View strategy'
|
? `${expanded ? 'Hide' : 'View'} strategy`
|
||||||
: `View ${milestone.strategies.length} strategies`}
|
: `${expanded ? 'Hide' : 'View'} ${milestone.strategies.length} strategies`}
|
||||||
</StyledSecondaryLabel>
|
</StyledSecondaryLabel>
|
||||||
</StyledAccordionSummary>
|
</StyledAccordionSummary>
|
||||||
<StyledAccordionDetails>
|
<StyledAccordionDetails>
|
||||||
|
@ -45,9 +45,6 @@ const StyledMilestoneCard = styled(Card)(({ theme }) => ({
|
|||||||
},
|
},
|
||||||
transition: 'background-color 0.2s ease-in-out',
|
transition: 'background-color 0.2s ease-in-out',
|
||||||
backgroundColor: theme.palette.background.default,
|
backgroundColor: theme.palette.background.default,
|
||||||
'&:hover': {
|
|
||||||
backgroundColor: theme.palette.neutral.light,
|
|
||||||
},
|
|
||||||
}));
|
}));
|
||||||
|
|
||||||
const StyledMilestoneCardBody = styled(Box)(({ theme }) => ({
|
const StyledMilestoneCardBody = styled(Box)(({ theme }) => ({
|
||||||
@ -82,7 +79,6 @@ const StyledAccordion = styled(Accordion)(({ theme }) => ({
|
|||||||
[theme.breakpoints.down('sm')]: {
|
[theme.breakpoints.down('sm')]: {
|
||||||
justifyContent: 'center',
|
justifyContent: 'center',
|
||||||
},
|
},
|
||||||
transition: 'background-color 0.2s ease-in-out',
|
|
||||||
backgroundColor: theme.palette.background.default,
|
backgroundColor: theme.palette.background.default,
|
||||||
'&:before': {
|
'&:before': {
|
||||||
opacity: '0 !important',
|
opacity: '0 !important',
|
||||||
@ -390,7 +386,7 @@ export const MilestoneCard = ({
|
|||||||
onEditClick={() => {
|
onEditClick={() => {
|
||||||
onSelectEditStrategy(strg);
|
onSelectEditStrategy(strg);
|
||||||
}}
|
}}
|
||||||
isDragging={false}
|
isDragging={dragItem?.id === strg.id}
|
||||||
strategy={strg}
|
strategy={strg}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user