Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 2 additions & 54 deletions src/style/themeManager.ts
Original file line number Diff line number Diff line change
@@ -1,34 +1,15 @@
import _ from 'lodash';
import type {Context} from 'react';
import Colors from './colors';

interface Theme {
primaryColor: string,
CTA: {
textColor: string,
disabledColor: string,
backgroundColor: string
},
titleColor: string,
subtitleColor: string,
dividerColor: string,
components: Extendable
components: Extendable;
}

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

theme: Theme = {
primaryColor: Colors.$backgroundPrimaryHeavy,
CTA: {
textColor: Colors.white,
disabledColor: Colors.grey60,
backgroundColor: Colors.$backgroundPrimaryHeavy
},
titleColor: Colors.grey10,
subtitleColor: Colors.grey40,
dividerColor: Colors.grey70,
components: {} as Extendable // leave this key and delete the rest on V6
components: {} as Extendable
};

forcedTheme = {
Expand All @@ -43,10 +24,6 @@ export class ThemeManager {
return this.themeContext;
}

getTheme() {
return this.theme;
}

setItem(key: string, value: any) {
if (key === 'components') {
throw new Error('Overriding the "components" key is not possible.');
Expand Down Expand Up @@ -83,35 +60,6 @@ export class ThemeManager {
get forcedThemeComponents() {
return this.forcedTheme.components;
}

// TODO: remove getters below
get primaryColor() {
return this.theme.primaryColor;
}

get CTATextColor() {
return this.theme.CTA.textColor;
}

get CTADisabledColor() {
return this.theme.CTA.disabledColor;
}

get CTABackgroundColor() {
return this.theme.CTA.backgroundColor;
}

get titleColor() {
return this.theme.titleColor;
}

get subtitleColor() {
return this.theme.subtitleColor;
}

get dividerColor() {
return this.theme.dividerColor;
}
}

export default new ThemeManager();