Skip to content

Commit dbe7bc4

Browse files
committed
Add success/warning/error colors to the theme
1 parent b515e84 commit dbe7bc4

File tree

4 files changed

+16
-26
lines changed

4 files changed

+16
-26
lines changed

src/components/Announcements/AnnouncementAction/AnnouncementAction.test.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ describe('AnnouncementAction', () => {
120120

121121
const button = getByText('Contacts');
122122
expect(button).toHaveStyle({
123-
'background-color': '#ED6C02',
123+
'background-color': '#D34400',
124124
color: '#FFFFFF',
125125
});
126126
});
@@ -131,7 +131,7 @@ describe('AnnouncementAction', () => {
131131

132132
const button = getByText('Contacts');
133133
expect(button).toHaveStyle({
134-
'background-color': '#ED6C02',
134+
'background-color': '#D34400',
135135
color: '#FFFFFF',
136136
});
137137
});

src/components/Contacts/ContactDetails/ContactTasksTab/ContactTaskRow/TaskDate/TaskDate.test.tsx

+4-23
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,7 @@ describe('TaskCommentsButton', () => {
1717
</ThemeProvider>,
1818
);
1919

20-
const dateText = getByText('Oct 12, 21');
21-
22-
expect(dateText).toBeInTheDocument();
23-
24-
const style = dateText && window.getComputedStyle(dateText);
25-
26-
expect(style?.color).toMatchInlineSnapshot(`"rgb(56, 63, 67)"`);
20+
expect(getByText('Oct 12, 21')).toHaveStyle('color: #383F43');
2721
});
2822

2923
it('should render complete', () => {
@@ -33,13 +27,7 @@ describe('TaskCommentsButton', () => {
3327
</ThemeProvider>,
3428
);
3529

36-
const dateText = getByText('Oct 12, 21');
37-
38-
expect(dateText).toBeInTheDocument();
39-
40-
const style = dateText && window.getComputedStyle(dateText);
41-
42-
expect(style?.color).toMatchInlineSnapshot(`"rgb(156, 159, 161)"`);
30+
expect(getByText('Oct 12, 21')).toHaveStyle('color: #9C9FA1');
4331
});
4432

4533
it('should render late', () => {
@@ -49,13 +37,7 @@ describe('TaskCommentsButton', () => {
4937
</ThemeProvider>,
5038
);
5139

52-
const dateText = getByText('Oct 12, 19');
53-
54-
expect(dateText).toBeInTheDocument();
55-
56-
const style = dateText && window.getComputedStyle(dateText);
57-
58-
expect(style?.color).toMatchInlineSnapshot(`"rgb(211, 47, 47)"`);
40+
expect(getByText('Oct 12, 19')).toHaveStyle('color: #991313');
5941
});
6042

6143
it('should not render year', () => {
@@ -65,7 +47,6 @@ describe('TaskCommentsButton', () => {
6547
</ThemeProvider>,
6648
);
6749

68-
const dateText = getByText('Oct 12');
69-
expect(dateText).toBeInTheDocument();
50+
expect(getByText('Oct 12')).toBeInTheDocument();
7051
});
7152
});

src/components/Dashboard/MonthlyGoal/MonthlyGoal.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ const MonthlyGoal = ({
255255
component={NextLink}
256256
href={`/accountLists/${accountListId}/settings/preferences?selectedTab=${PreferenceAccordion.MonthlyGoal}`}
257257
variant="outlined"
258-
color="statusWarning"
258+
color="warning"
259259
sx={(theme) => ({
260260
marginTop: theme.spacing(1),
261261
textAlign: 'center',

src/theme.ts

+9
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,15 @@ const theme = createTheme({
136136
progressBarGray: {
137137
main: progressBarColors.gray,
138138
},
139+
success: {
140+
main: statusColors.success,
141+
},
142+
warning: {
143+
main: statusColors.warning,
144+
},
145+
error: {
146+
main: statusColors.danger,
147+
},
139148
statusSuccess: {
140149
main: statusColors.success,
141150
},

0 commit comments

Comments
 (0)