From ca758e81959c33a310f8329ca3b40dcde7187fc3 Mon Sep 17 00:00:00 2001 From: Lidor Dafna Date: Wed, 15 Feb 2023 15:39:39 +0200 Subject: [PATCH 1/3] remove old theme keys and themeManager getters --- src/components/chipsInput/index.tsx | 4 +-- src/style/themeManager.ts | 55 ++--------------------------- 2 files changed, 5 insertions(+), 54 deletions(-) diff --git a/src/components/chipsInput/index.tsx b/src/components/chipsInput/index.tsx index 68014384f4..5984a3f744 100644 --- a/src/components/chipsInput/index.tsx +++ b/src/components/chipsInput/index.tsx @@ -1,7 +1,7 @@ import _ from 'lodash'; import React, {Component} from 'react'; import {NativeModules, StyleSheet, ViewStyle, TextInput, NativeSyntheticEvent, TextInputKeyPressEventData, findNodeHandle, ScrollView, ScrollViewProps, TextInputProps as RNTextInputProps} from 'react-native'; -import {Colors, BorderRadiuses, ThemeManager, Typography, Spacings} from '../../style'; +import {Colors, BorderRadiuses, Typography, Spacings} from '../../style'; import Assets from '../../assets'; import {LogService} from '../../services'; import {Constants, asBaseComponent, BaseComponentInjectedProps, TypographyModifiers} from '../../commons/new'; @@ -550,7 +550,7 @@ const basicTagStyle = { const styles = StyleSheet.create({ withUnderline: { borderBottomWidth: StyleSheet.hairlineWidth, - borderColor: ThemeManager.dividerColor + borderColor: Colors.$outlineDisabled }, tagsList: { minHeight: 38, diff --git a/src/style/themeManager.ts b/src/style/themeManager.ts index 12c504a31f..2031323597 100644 --- a/src/style/themeManager.ts +++ b/src/style/themeManager.ts @@ -3,16 +3,8 @@ 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 + primaryColor: string; + components: Extendable; } export class ThemeManager { @@ -20,15 +12,7 @@ export class ThemeManager { 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 = { @@ -43,10 +27,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.'); @@ -83,35 +63,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(); From 70686d4e5c7ab608c9b629289855a8cfded231a7 Mon Sep 17 00:00:00 2001 From: Lidor Dafna Date: Wed, 15 Feb 2023 16:21:32 +0200 Subject: [PATCH 2/3] remove primaryColor from theme --- src/style/themeManager.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/style/themeManager.ts b/src/style/themeManager.ts index 2031323597..3e05d580ed 100644 --- a/src/style/themeManager.ts +++ b/src/style/themeManager.ts @@ -1,9 +1,7 @@ import _ from 'lodash'; import type {Context} from 'react'; -import Colors from './colors'; interface Theme { - primaryColor: string; components: Extendable; } @@ -11,7 +9,6 @@ export class ThemeManager { private themeContext?: Context; theme: Theme = { - primaryColor: Colors.$backgroundPrimaryHeavy, components: {} as Extendable }; From 85e9976ca1880da0d804d6fc87bac5740438b583 Mon Sep 17 00:00:00 2001 From: Lidor Dafna Date: Wed, 15 Feb 2023 16:51:45 +0200 Subject: [PATCH 3/3] revert chipsInput change --- src/components/chipsInput/index.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/chipsInput/index.tsx b/src/components/chipsInput/index.tsx index 5984a3f744..68014384f4 100644 --- a/src/components/chipsInput/index.tsx +++ b/src/components/chipsInput/index.tsx @@ -1,7 +1,7 @@ import _ from 'lodash'; import React, {Component} from 'react'; import {NativeModules, StyleSheet, ViewStyle, TextInput, NativeSyntheticEvent, TextInputKeyPressEventData, findNodeHandle, ScrollView, ScrollViewProps, TextInputProps as RNTextInputProps} from 'react-native'; -import {Colors, BorderRadiuses, Typography, Spacings} from '../../style'; +import {Colors, BorderRadiuses, ThemeManager, Typography, Spacings} from '../../style'; import Assets from '../../assets'; import {LogService} from '../../services'; import {Constants, asBaseComponent, BaseComponentInjectedProps, TypographyModifiers} from '../../commons/new'; @@ -550,7 +550,7 @@ const basicTagStyle = { const styles = StyleSheet.create({ withUnderline: { borderBottomWidth: StyleSheet.hairlineWidth, - borderColor: Colors.$outlineDisabled + borderColor: ThemeManager.dividerColor }, tagsList: { minHeight: 38,