Skip to content

Commit ebf04ca

Browse files
authored
Merge pull request layer5io#604 from sudhanshutech/correct/styles
Add correct styles in modal button for different category
2 parents 6945a32 + ada5c0e commit ebf04ca

File tree

2 files changed

+33
-9
lines changed

2 files changed

+33
-9
lines changed

src/custom/Modal/index.tsx

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -173,17 +173,21 @@ export const ModalFooter: React.FC<ModalFooterProps> = ({ helpText, children, va
173173
export const ModalButtonPrimary: React.FC = styled(ContainedButton)(({ theme }) => ({
174174
backgroundColor: theme.palette.background.brand?.default,
175175
color: theme.palette.text.constant?.white,
176+
'&:hover': {
177+
background: theme.palette.background.brand?.hover
178+
},
176179
'&.MuiButton-contained.Mui-disabled': {
177-
color: theme.palette.text.disabled,
178-
backgroundColor: theme.palette.primary.disabled
180+
color: theme.palette.text.constant?.disabled,
181+
backgroundColor: theme.palette.background.constant?.disabled
179182
}
180183
}));
181184

182185
// ModalButtonSecondary
183186
export const ModalButtonSecondary = styled(OutlinedButton)(({ theme }) => ({
184187
'&.MuiButton-outlined': {
185-
border: `1px solid ${theme.palette.common.white}`,
188+
border: `1px solid ${theme.palette.background.constant?.white}`,
186189
color: theme.palette.text.constant?.white,
190+
backgroundColor: 'transparent',
187191
'&:hover': {
188192
background: 'transparent',
189193
color: theme.palette.text.constant?.white
@@ -192,7 +196,7 @@ export const ModalButtonSecondary = styled(OutlinedButton)(({ theme }) => ({
192196
'&.MuiButton-outlined.Mui-disabled': {
193197
color: theme.palette.text.disabled,
194198
border: 'none',
195-
backgroundColor: theme.palette.secondary.disabled
199+
backgroundColor: theme.palette.background.brand?.disabled
196200
}
197201
}));
198202

@@ -204,5 +208,8 @@ export const ModalButtonTertiary = styled(TextButton)(({ theme }) => ({
204208
// ModalButtonDanger
205209
export const ModalButtonDanger = styled(ContainedButton)(({ theme }) => ({
206210
backgroundColor: theme.palette.background.error?.default,
207-
color: theme.palette.text.constant?.white
211+
color: theme.palette.text.constant?.white,
212+
'&:hover': {
213+
background: theme.palette.background.error?.hover
214+
}
208215
}));

src/theme/palette.ts

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ declare module '@mui/material/styles' {
3030
hover: string;
3131
pressed: string;
3232
};
33+
constant?: {
34+
disabled: string;
35+
white: string;
36+
};
3337
inverse?: string;
3438
brand?: Interactiveness;
3539
cta?: Interactiveness;
@@ -58,6 +62,7 @@ declare module '@mui/material/styles' {
5862
};
5963
constant?: {
6064
white: string;
65+
disabled: string;
6166
};
6267
}
6368

@@ -77,6 +82,7 @@ declare module '@mui/material/styles' {
7782
};
7883
constant?: {
7984
white: string;
85+
disabled: string;
8086
};
8187
inverse?: string;
8288
brand?: Interactiveness;
@@ -107,6 +113,7 @@ declare module '@mui/material/styles' {
107113
};
108114
constant?: {
109115
white: string;
116+
disabled: string;
110117
};
111118
inverse?: string;
112119
brand?: Interactiveness;
@@ -239,7 +246,11 @@ export const lightModePalette: PaletteOptions = {
239246
secondary: Colors.red[60],
240247
tertiary: Colors.red[70]
241248
},
242-
code: Colors.charcoal[90]
249+
code: Colors.charcoal[90],
250+
constant: {
251+
white: Colors.accentGrey[100],
252+
disabled: Colors.charcoal[70]
253+
}
243254
},
244255
text: {
245256
default: Colors.charcoal[10],
@@ -257,7 +268,8 @@ export const lightModePalette: PaletteOptions = {
257268
alt: Colors.charcoal[40]
258269
},
259270
constant: {
260-
white: Colors.charcoal[100]
271+
white: Colors.charcoal[100],
272+
disabled: Colors.charcoal[50]
261273
}
262274
},
263275
border: {
@@ -346,7 +358,11 @@ export const darkModePalette: PaletteOptions = {
346358
secondary: Colors.red[20],
347359
tertiary: Colors.red[10]
348360
},
349-
code: Colors.accentGrey[90]
361+
code: Colors.accentGrey[90],
362+
constant: {
363+
white: Colors.accentGrey[100],
364+
disabled: Colors.charcoal[70]
365+
}
350366
},
351367
text: {
352368
default: Colors.charcoal[100],
@@ -364,7 +380,8 @@ export const darkModePalette: PaletteOptions = {
364380
alt: Colors.keppel[40]
365381
},
366382
constant: {
367-
white: Colors.charcoal[100]
383+
white: Colors.charcoal[100],
384+
disabled: Colors.charcoal[50]
368385
}
369386
},
370387
border: {

0 commit comments

Comments
 (0)