Skip to content

Commit

Permalink
Merge pull request #2362 from tom0827/TRACK-2358
Browse files Browse the repository at this point in the history
changed warning colours for legislated vs non legislated phases
  • Loading branch information
tom0827 authored Jul 18, 2024
2 parents 4c892e4 + 92b3346 commit 9259dfd
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
17 changes: 13 additions & 4 deletions epictrack-web/src/components/workPlan/phase/PhaseAccordion.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,15 @@ const PhaseAccordion = ({ phase, ...rest }: PhaseAccordionProps) => {
[phase]
);

const getPhaseOverdueColour = (daysLeft: number, isLegislated: boolean) => {
if (daysLeft >= 0) return Palette.neutral.dark;
if (isLegislated) {
return Palette.error.dark;
} else {
return Palette.purple;
}
};

return (
<>
<Box
Expand Down Expand Up @@ -164,10 +173,10 @@ const PhaseAccordion = ({ phase, ...rest }: PhaseAccordionProps) => {
bold={isSelectedPhase}
sx={{
...summaryContentStyle,
color:
phase.days_left < 0
? Palette.error.dark
: Palette.neutral.dark,
color: getPhaseOverdueColour(
phase.days_left,
phase.work_phase.legislated
),
}}
>
{phase.work_phase.is_completed && (
Expand Down
1 change: 1 addition & 0 deletions epictrack-web/src/styles/theme.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ export const Palette = {
},
white: "#FFFFFF",
black: "#000000",
purple: "#4006AC",
hover: {
light: "#4C81AF",
},
Expand Down

0 comments on commit 9259dfd

Please sign in to comment.