Skip to content

Commit d40a969

Browse files
V7/ ThemeManager (#2484)
* remove old theme keys and themeManager getters * remove primaryColor from theme * revert chipsInput change --------- Co-authored-by: Ethan Sharabi <[email protected]>
1 parent b37684d commit d40a969

File tree

1 file changed

+2
-54
lines changed

1 file changed

+2
-54
lines changed

src/style/themeManager.ts

Lines changed: 2 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,15 @@
11
import _ from 'lodash';
22
import type {Context} from 'react';
3-
import Colors from './colors';
43

54
interface Theme {
6-
primaryColor: string,
7-
CTA: {
8-
textColor: string,
9-
disabledColor: string,
10-
backgroundColor: string
11-
},
12-
titleColor: string,
13-
subtitleColor: string,
14-
dividerColor: string,
15-
components: Extendable
5+
components: Extendable;
166
}
177

188
export class ThemeManager {
199
private themeContext?: Context<any>;
2010

2111
theme: Theme = {
22-
primaryColor: Colors.$backgroundPrimaryHeavy,
23-
CTA: {
24-
textColor: Colors.white,
25-
disabledColor: Colors.grey60,
26-
backgroundColor: Colors.$backgroundPrimaryHeavy
27-
},
28-
titleColor: Colors.grey10,
29-
subtitleColor: Colors.grey40,
30-
dividerColor: Colors.grey70,
31-
components: {} as Extendable // leave this key and delete the rest on V6
12+
components: {} as Extendable
3213
};
3314

3415
forcedTheme = {
@@ -43,10 +24,6 @@ export class ThemeManager {
4324
return this.themeContext;
4425
}
4526

46-
getTheme() {
47-
return this.theme;
48-
}
49-
5027
setItem(key: string, value: any) {
5128
if (key === 'components') {
5229
throw new Error('Overriding the "components" key is not possible.');
@@ -83,35 +60,6 @@ export class ThemeManager {
8360
get forcedThemeComponents() {
8461
return this.forcedTheme.components;
8562
}
86-
87-
// TODO: remove getters below
88-
get primaryColor() {
89-
return this.theme.primaryColor;
90-
}
91-
92-
get CTATextColor() {
93-
return this.theme.CTA.textColor;
94-
}
95-
96-
get CTADisabledColor() {
97-
return this.theme.CTA.disabledColor;
98-
}
99-
100-
get CTABackgroundColor() {
101-
return this.theme.CTA.backgroundColor;
102-
}
103-
104-
get titleColor() {
105-
return this.theme.titleColor;
106-
}
107-
108-
get subtitleColor() {
109-
return this.theme.subtitleColor;
110-
}
111-
112-
get dividerColor() {
113-
return this.theme.dividerColor;
114-
}
11563
}
11664

11765
export default new ThemeManager();

0 commit comments

Comments
 (0)