Skip to content

Commit dfb799c

Browse files
authored
Merge pull request #775 from amitamrutiya/modal-header
update the gradient for the modal header diff for the dark and light mode
2 parents 9ff8a84 + 81e3623 commit dfb799c

File tree

2 files changed

+20
-4
lines changed

2 files changed

+20
-4
lines changed

src/custom/Modal/index.tsx

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { Box, Dialog, IconButton, Paper, Typography } from '../../base';
44
import { ContainedButton, OutlinedButton, TextButton } from '../../base/Button/Button';
55
import { iconLarge, iconMedium } from '../../constants/iconsSizes';
66
import { CloseIcon, InfoCircleIcon } from '../../icons';
7+
import { darkModalGradient, lightModalGradient } from '../../theme/colors/colors';
78
import { CustomTooltip } from '../CustomTooltip';
89

910
interface ModalProps extends DialogProps {
@@ -54,8 +55,8 @@ const StyledDialog = styled(Dialog)`
5455
}
5556
`;
5657

57-
export const ModalStyledHeader = styled('div')(() => ({
58-
background: 'linear-gradient(90deg, #3B687B 0%, #507D90 100%)',
58+
export const ModalStyledHeader = styled('div')(({ theme }) => ({
59+
background: theme.palette.mode === 'light' ? lightModalGradient.header : darkModalGradient.header,
5960
color: '#eee',
6061
display: 'flex',
6162
justifyContent: 'space-between',
@@ -108,15 +109,20 @@ const StyledFooter = styled('div', {
108109
shouldForwardProp: (prop) => prop !== 'variant'
109110
})<ModalFooterProps>(({ theme, variant, hasHelpText }) => ({
110111
background:
111-
variant == 'filled' ? 'linear-gradient(90deg, #3B687B 0%, #507D90 100%)' : 'transparent',
112+
variant === 'filled'
113+
? theme.palette.mode === 'light'
114+
? lightModalGradient.fotter
115+
: darkModalGradient.fotter
116+
: 'transparent',
112117
display: 'flex',
113118
alignItems: 'center',
114119
justifyContent: hasHelpText ? 'space-between' : 'end',
115120
padding: '1rem',
116121
gap: '1rem',
117122

118123
'&& .InfoCircleIcon': {
119-
color: variant == 'filled' ? theme.palette.common.white : theme.palette.background.info?.default
124+
color:
125+
variant === 'filled' ? theme.palette.common.white : theme.palette.background.info?.default
120126
}
121127
}));
122128

src/theme/colors/colors.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ export const KEPPEL = '#00B39F';
77
export const DARK_KEPPEL = '#00A18F';
88
export const CARIBBEAN_GREEN = '#00D3A9';
99
export const TEAL_BLUE = '#477E96';
10+
export const DARK_TEAL_BLUE = '#3B687B';
1011
export const CHARCOAL = '#3C494F';
1112
export const BLACK = '#000000';
1213
export const MIDNIGHT_BLACK = '#111111';
@@ -324,6 +325,15 @@ export const buttonDelete = {
324325
hover: redDelete.light
325326
};
326327

328+
export const darkModalGradient = {
329+
header: `linear-gradient(90deg, ${charcoal[30]} 0%, ${accentGrey[30]} 100%)`,
330+
fotter: `linear-gradient(90deg, ${accentGrey[30]} 0%, ${charcoal[30]} 100%)`
331+
};
332+
333+
export const lightModalGradient = {
334+
header: `linear-gradient(90deg, ${TEAL_BLUE} 0%, ${DARK_TEAL_BLUE} 100%)`,
335+
fotter: `linear-gradient(90deg, ${DARK_TEAL_BLUE} 0%, ${TEAL_BLUE} 100%)`
336+
};
327337
/**
328338
* Notification Colors
329339
*/

0 commit comments

Comments
 (0)