Skip to content

Commit cbfe527

Browse files
authored
remove Colors.primary usages (#2338)
1 parent 3dc5f58 commit cbfe527

File tree

21 files changed

+30
-30
lines changed

21 files changed

+30
-30
lines changed

demo/src/screens/componentScreens/GridViewScreen.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ class GridViewScreen extends Component {
153153
items={contacts}
154154
// viewWidth={300}
155155
numColumns={6}
156-
lastItemOverlayColor={Colors.rgba(Colors.primary, 0.6)}
156+
lastItemOverlayColor={Colors.rgba(Colors.$backgroundPrimaryHeavy, 0.6)}
157157
lastItemLabel={7}
158158
/>
159159

@@ -163,7 +163,7 @@ class GridViewScreen extends Component {
163163
<GridView
164164
items={products}
165165
numColumns={4}
166-
lastItemOverlayColor={Colors.rgba(Colors.primary, 0.6)}
166+
lastItemOverlayColor={Colors.rgba(Colors.$backgroundPrimaryHeavy, 0.6)}
167167
lastItemLabel={42}
168168
keepItemSize
169169
/>

lib/components/WheelPicker/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class WheelPicker extends Component<WheelPickerProps> {
5050

5151
static defaultProps = {
5252
labelStyle: {fontSize: Typography.text70?.fontSize, fontFamily: Typography.text70?.fontFamily},
53-
color: Colors.primary
53+
color: Colors.$textPrimary
5454
};
5555

5656
static Item: typeof WheelPickerItem;

src/components/chipsInput/Presenter.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export const hasInvalidChip = (chips: Array<ChipsInputChipProps>) => {
88
export const getValidationBasedColor = (chips: Array<ChipsInputChipProps>, defaultChip?: ChipsInputChipProps) => {
99
const dismissColor = defaultChip?.dismissColor || Colors.red30;
1010

11-
return hasInvalidChip(chips) ? dismissColor : Colors.primary;
11+
return hasInvalidChip(chips) ? dismissColor : Colors.$backgroundPrimaryHeavy;
1212
};
1313

1414
export const getCounterTextColor = (stateChips: Array<ChipsInputChipProps>, props: ChipsInputProps) => {

src/components/chipsInput/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,7 @@ const styles = StyleSheet.create({
572572
tag: {
573573
borderWidth: 0,
574574
paddingVertical: 5,
575-
backgroundColor: Colors.primary
575+
backgroundColor: Colors.$backgroundPrimaryHeavy
576576
},
577577
invalidTag: {
578578
borderWidth: 1,

src/components/drawer/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import View from '../view';
1010
import Swipeable, {SwipeableProps} from './Swipeable';
1111
import {LogService} from '../../services';
1212

13-
const DEFAULT_BG = Colors.primary;
13+
const DEFAULT_BG = Colors.$backgroundPrimaryHeavy;
1414
const DEFAULT_BOUNCINESS = 0;
1515

1616
interface DrawerItemProps {

src/components/hint/__tests__/index.spec.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ describe('Hint Screen component test', () => {
3434
});
3535

3636
it('Test Hint component background color', async () => {
37-
const expectedColor = Colors.primary;
37+
const expectedColor = Colors.$backgroundPrimaryHeavy;
3838
const component = <HintTestComponent showHint/>;
3939

4040
const driver = new HintDriver({component, testID: 'Hint'});

src/components/hint/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import TouchableOpacity from '../touchableOpacity';
2626
const sideTip = require('./assets/hintTipSide.png');
2727
const middleTip = require('./assets/hintTipMiddle.png');
2828

29-
const DEFAULT_COLOR = Colors.primary;
29+
const DEFAULT_COLOR = Colors.$backgroundPrimaryHeavy;
3030
const DEFAULT_HINT_OFFSET = Spacings.s4;
3131
const DEFAULT_EDGE_MARGINS = Spacings.s5;
3232

src/components/loaderScreen/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class LoaderScreen extends Component<LoaderScreenProps> {
2828
<ActivityIndicator
2929
size={'large'}
3030
animating
31-
color={loaderColor || (Constants.isIOS ? Colors.grey60 : Colors.primary)}
31+
color={loaderColor || (Constants.isIOS ? Colors.grey60 : Colors.$iconPrimary)}
3232
{...others}
3333
/>
3434
)}

src/components/modal/TopBar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ type topBarButtonProp = {
8181

8282
const TOP_BAR_HEIGHT = Constants.isIOS ? 44 : 56;
8383
const DEFAULT_BUTTON_PROPS = {
84-
color: Colors.primary
84+
color: Colors.$textPrimary
8585
};
8686

8787
/**

src/components/modal/api/modalTopBar.api.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"name": "doneButtonProps",
1212
"type": "ButtonProps",
1313
"description": "Done action props",
14-
"default": "{color: Colors.primary}"
14+
"default": "{color: Colors.$textPrimary}"
1515
},
1616
{"name": "doneLabel", "type": "string", "description": "Done action label", "default": "Save"},
1717
{"name": "doneIcon", "type": "ImageSource", "description": "Done action icon"},
@@ -20,7 +20,7 @@
2020
"name": "cancelButtonProps",
2121
"type": "ButtonProps",
2222
"description": "Cancel action props",
23-
"default": "{color: Colors.primary}"
23+
"default": "{color: Colors.$textPrimary}"
2424
},
2525
{"name": "cancelLabel", "type": "string", "description": "Cancel action label"},
2626
{

src/components/pageControl/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import View from '../view';
88

99
const MAX_SHOWN_PAGES = 7;
1010
const NUM_LARGE_INDICATORS = 3;
11-
const DEFAULT_INDICATOR_COLOR = Colors.primary;
11+
const DEFAULT_INDICATOR_COLOR = Colors.$iconPrimary;
1212

1313
function getColorStyle(isCurrentPage: boolean, color?: string, inactiveColor?: string) {
1414
const activeColor = color || DEFAULT_INDICATOR_COLOR;

src/components/pageControl/pageControl.api.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"name": "color",
2727
"type": "string",
2828
"description": "Color of the selected page dot and, if inactiveColor not passed, the border of the not selected pages",
29-
"default": "Colors.primary"
29+
"default": "Colors.$iconPrimary"
3030
},
3131
{
3232
"name": "inactiveColor",

src/components/radioButton/radioButton.api.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
},
2323
{"name": "onPress", "type": "(selected: boolean) => void", "description": "Invoked when pressing the button"},
2424
{"name": "disabled", "type": "boolean", "description": "Whether the radio button should be disabled"},
25-
{"name": "color", "type": "string", "description": "The color of the radio button", "default": "Colors.primary"},
25+
{"name": "color", "type": "string", "description": "The color of the radio button", "default": "Colors.$backgroundPrimaryHeavy"},
2626
{
2727
"name": "size",
2828
"type": "number",

src/components/stateScreen/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ function createStyles(isRemoteImage: boolean) {
7474
marginTop: 12
7575
},
7676
ctaLabel: {
77-
color: Colors.primary,
77+
color: Colors.$textPrimary,
7878
...Typography.text70
7979
}
8080
});

src/components/tabBar/TabBarItem.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import Image from '../image';
1919
import Badge, {BadgeProps} from '../badge';
2020

2121
const INDICATOR_HEIGHT = 2;
22-
const INDICATOR_BG_COLOR = Colors.primary;
22+
const INDICATOR_BG_COLOR = Colors.$backgroundPrimaryHeavy;
2323
const HORIZONTAL_PADDING = Constants.isTablet ? Spacings.s7 : Spacings.s5;
2424

2525
export interface TabBarItemProps {
@@ -262,11 +262,11 @@ const styles = StyleSheet.create({
262262
paddingHorizontal: HORIZONTAL_PADDING
263263
},
264264
label: {
265-
color: Colors.primary,
265+
color: Colors.$textPrimary,
266266
...Typography.text80
267267
},
268268
selectedLabel: {
269-
color: Colors.primary,
269+
color: Colors.$textPrimary,
270270
...Typography.text80,
271271
fontWeight: 'bold'
272272
},

src/components/tabController/apis/tabBarItem.api.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"name": "selectedLabelColor",
1414
"type": "string",
1515
"description": "The selected label color",
16-
"default": "Colors.primary"
16+
"default": "Colors.$textPrimary"
1717
},
1818
{"name": "icon", "type": "number", "description": "Icon of the tab"},
1919
{"name": "iconColor", "type": "string", "description": "Icon tint color"},

src/components/textField/index.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ const COLOR_BY_STATE = {
2929
};
3030
const UNDERLINE_COLOR_BY_STATE = {
3131
default: Colors.grey50,
32-
focus: Colors.primary,
32+
focus: Colors.$outlinePrimary,
3333
error: Colors.red30
3434
};
3535
const PLACEHOLDER_COLOR_BY_STATE = {
3636
default: Colors.grey30,
37-
focus: Colors.primary
37+
focus: Colors.$textPrimary
3838
};
3939
const CHAR_COUNTER_COLOR_BY_STATE = {
4040
default: Colors.grey30,
@@ -656,7 +656,7 @@ export default class TextField extends BaseInput {
656656
pointerEvents="none"
657657
source={iconSource}
658658
resizeMode={'contain'}
659-
style={[this.styles.rightButtonImage, {tintColor: iconColor || Colors.primary}]}
659+
style={[this.styles.rightButtonImage, {tintColor: iconColor || Colors.$iconPrimary}]}
660660
/>
661661
</TouchableOpacity>
662662
);

src/components/toast/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ export default class Toast extends PureBaseComponent {
249249
}
250250

251251
if (action) {
252-
const actionBg = backgroundColor || Colors.rgba(Colors.primary, 0);
252+
const actionBg = backgroundColor || Colors.rgba(Colors.$backgroundPrimaryHeavy, 0);
253253

254254
return (
255255
<Button
@@ -315,7 +315,7 @@ export default class Toast extends PureBaseComponent {
315315
return null;
316316
}
317317

318-
const bg = backgroundColor || Colors.primary;
318+
const bg = backgroundColor || Colors.$backgroundPrimaryHeavy;
319319
const isTop = position === 'top';
320320
const positionMultiplier = isTop ? -1 : 1;
321321
const translateY = this.toastAnim.interpolate({

src/components/wheelPickerDialog/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,14 +144,14 @@ const styles = StyleSheet.create({
144144
marginLeft: 142
145145
},
146146
cancelButton: {
147-
color: Colors.primary,
147+
color: Colors.$textPrimary,
148148
width: 75,
149149
height: 36,
150150
textAlign: 'center',
151151
textAlignVertical: 'center'
152152
},
153153
okButton: {
154-
color: Colors.primary,
154+
color: Colors.$textPrimary,
155155
width: 47,
156156
height: 36,
157157
textAlign: 'center',

src/style/componentsColors.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import Colors from './colors';
22

33
const ComponentsColors = {
4-
CTA: Colors.primary,
4+
CTA: Colors.$backgroundPrimaryHeavy,
55
disabledText: Colors.grey50
66
};
77

src/style/themeManager.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ export class ThemeManager {
1919
private themeContext?: Context<any>;
2020

2121
theme: Theme = {
22-
primaryColor: Colors.primary,
22+
primaryColor: Colors.$backgroundPrimaryHeavy,
2323
CTA: {
2424
textColor: Colors.white,
2525
disabledColor: Colors.grey60,
26-
backgroundColor: Colors.primary
26+
backgroundColor: Colors.$backgroundPrimaryHeavy
2727
},
2828
titleColor: Colors.grey10,
2929
subtitleColor: Colors.grey40,

0 commit comments

Comments
 (0)