Skip to content

Commit

Permalink
chore: clean up colors enum and rename some existing colors (#4523)
Browse files Browse the repository at this point in the history
### Description

This PR:
- update the colors enum to match
[designs](https://www.figma.com/file/erFfzHvSTm5g1sjK6jWyEH/Working-Design-System-Components?node-id=213%3A11&mode=dev)
- remove unused enum values like purple / teal / orange / brownFaint /
greenStrong
- rename the following (the hex values didn't change)
  - warning -> error
  - greenUI -> primary
  - light -> white
  - dark -> black
  - onboardingBlue -> infoDark
  - yellowFaint -> warningLight

To come in following PRs:
- renaming / replacing / moving the enum values that are not part of the
finalised list

### Test plan

n/a this PR should have no visual changes

### Related issues

- Related to RET-913

### Backwards compatibility

Y
  • Loading branch information
kathaypacific authored Nov 23, 2023
1 parent 3e01467 commit 129d74d
Show file tree
Hide file tree
Showing 150 changed files with 283 additions and 290 deletions.
4 changes: 2 additions & 2 deletions branding/celo/src/icons/Logo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ export default function Logo({ height = 25, type = LogoTypes.COLOR, testID, styl
let mainColor
switch (type) {
case LogoTypes.DARK:
mainColor = colors.dark
mainColor = colors.black
break
case LogoTypes.LIGHT:
mainColor = colors.light
mainColor = colors.white
break
default:
break
Expand Down
2 changes: 1 addition & 1 deletion scripts/sync_branding.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ echo $mobile_root
cd "$mobile_root"

# Please update the sha when valora branding updates are needed
valora_branding_sha=48a6e3363ad7c9befbf0567f3dc370a427fce87b
valora_branding_sha=19bc30b61b48a92c2a836ce1dafa3de25775e1b3

if [[ "$branding" == "valora" ]]; then
# prevents git from asking credentials
Expand Down
2 changes: 1 addition & 1 deletion src/RevokePhoneNumber.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ export const RevokePhoneNumber = ({ forwardedRef }: Props) => {
const styles = StyleSheet.create({
container: {
flexDirection: 'row',
backgroundColor: Colors.yellowFaint,
backgroundColor: Colors.warningLight,
borderRadius: 4,
marginTop: Spacing.Regular16,
marginBottom: Spacing.Thick24,
Expand Down
2 changes: 1 addition & 1 deletion src/account/Education.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ const Education = (props: Props) => {
<TopBarIconButton
testID={`Education/${currentIndex === 0 ? 'Close' : 'Back'}Icon`}
onPress={goBack}
icon={currentIndex === 0 ? <Times /> : <BackChevron color={colors.dark} />}
icon={currentIndex === 0 ? <Times /> : <BackChevron color={colors.black} />}
/>
</View>
)
Expand Down
2 changes: 1 addition & 1 deletion src/account/Profile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,6 @@ const styles = StyleSheet.create({
},
saveButton: {
...fontStyles.regular,
color: colors.greenUI,
color: colors.primary,
},
})
2 changes: 1 addition & 1 deletion src/account/Settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ export const Account = ({ navigation, route }: Props) => {
}
testID="KeylessBackup"
ctaText={cloudBackupCompleted ? t('delete') : t('setup')}
ctaColor={cloudBackupCompleted ? colors.warning : colors.greenUI}
ctaColor={cloudBackupCompleted ? colors.error : colors.primary}
showChevron={!cloudBackupCompleted}
/>
)}
Expand Down
2 changes: 1 addition & 1 deletion src/account/ShakeForSupport.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ const styles = StyleSheet.create({
position: 'absolute',
bottom: 0,
width: '100%',
backgroundColor: colors.light,
backgroundColor: colors.white,
borderTopLeftRadius: 16,
borderTopRightRadius: 16,
padding: 24,
Expand Down
4 changes: 2 additions & 2 deletions src/account/SupportContact.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ const styles = StyleSheet.create({
borderRadius: 4,
borderWidth: 1.5,
marginBottom: 16,
color: colors.dark,
color: colors.black,
height: 80,
maxHeight: 150,
},
Expand All @@ -283,7 +283,7 @@ const styles = StyleSheet.create({
borderRadius: 4,
borderWidth: 1.5,
marginBottom: 16,
color: colors.dark,
color: colors.black,
maxHeight: 50,
},
headerText: {
Expand Down
2 changes: 1 addition & 1 deletion src/backup/BackupIntroduction.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ function goToAccountKeyGuide() {
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: colors.light,
backgroundColor: colors.white,
},
introContainer: {
flexGrow: 1,
Expand Down
8 changes: 4 additions & 4 deletions src/backup/BackupQuiz.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ function DeleteWord({
}
return (
<Touchable borderless={true} onPress={onPressBackspace} style={styles.backWord}>
<Backspace color={colors.greenUI} />
<Backspace color={colors.primary} />
</Touchable>
)
}
Expand Down Expand Up @@ -349,7 +349,7 @@ const styles = StyleSheet.create({
bodyText: {
marginTop: 20,
...fontStyles.regular,
color: colors.dark,
color: colors.black,
textAlign: 'center',
},
bodyTextBold: {
Expand Down Expand Up @@ -398,7 +398,7 @@ const styles = StyleSheet.create({
mnemonicWordButtonOutterRim: {
borderRadius: 100,
borderWidth: 1.5,
borderColor: colors.greenUI,
borderColor: colors.primary,
overflow: 'hidden',
marginVertical: 4,
marginHorizontal: 4,
Expand All @@ -411,7 +411,7 @@ const styles = StyleSheet.create({
},
mnemonicWordButonText: {
textAlign: 'center',
color: colors.greenUI,
color: colors.primary,
},
backWord: {
paddingRight: 24,
Expand Down
2 changes: 1 addition & 1 deletion src/backup/QuizzBottom.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,6 @@ const styles = StyleSheet.create({
incorrect: {
...fontStyles.regular500,
textAlign: 'center',
color: colors.warning,
color: colors.error,
},
})
2 changes: 1 addition & 1 deletion src/components/BottomSheetLegacy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ const styles = StyleSheet.create({
bottom: 0,
opacity: 1,
width: '100%',
backgroundColor: colors.light,
backgroundColor: colors.white,
borderTopRightRadius: Spacing.Regular16,
borderTopLeftRadius: Spacing.Regular16,
},
Expand Down
12 changes: 6 additions & 6 deletions src/components/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -163,25 +163,25 @@ function getColors(type: BtnTypes, disabled: boolean | undefined) {
let opacity
switch (type) {
case BtnTypes.PRIMARY:
textColor = colors.light
backgroundColor = disabled ? colors.greenFaint : colors.greenUI
textColor = colors.white
backgroundColor = disabled ? colors.greenFaint : colors.primary
break
case BtnTypes.SECONDARY:
textColor = disabled ? colors.gray4 : colors.dark
textColor = disabled ? colors.gray4 : colors.black
backgroundColor = colors.beige
break
case BtnTypes.TERTIARY:
textColor = colors.light
textColor = colors.white
backgroundColor = disabled ? colors.goldFaint : colors.goldUI
break
case BtnTypes.ONBOARDING:
textColor = colors.light
textColor = colors.white
backgroundColor = colors.onboardingGreen
opacity = disabled ? 0.5 : 1.0
break
case BtnTypes.ONBOARDING_SECONDARY:
textColor = colors.onboardingGreen
backgroundColor = colors.light
backgroundColor = colors.white
opacity = disabled ? 0.5 : 1.0
break
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/CancelButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,6 @@ export default function CancelButton({ eventName, onCancel, style, buttonType =

const styles = StyleSheet.create({
title: {
color: colors.dark,
color: colors.black,
},
})
2 changes: 1 addition & 1 deletion src/components/Card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export default function Card({ style, rounded = false, shadow = Shadow.Soft, ...

const styles = StyleSheet.create({
container: {
backgroundColor: colors.light,
backgroundColor: colors.white,
padding: 16,
},
rounded: {
Expand Down
2 changes: 1 addition & 1 deletion src/components/CircleButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default class CircleButton extends React.PureComponent<ButtonProps> {
borderWidth !== undefined ? { borderWidth } : { borderWidth: 0 },
{ borderColor: color, width: size, height: size, borderRadius: Math.floor(size! / 2) },
]
const xColor = solid ? colors.light : color
const xColor = solid ? colors.white : color

return (
<View style={[styles.row, this.props.style]}>
Expand Down
4 changes: 2 additions & 2 deletions src/components/CodeInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -175,11 +175,11 @@ export default function CodeInput({
</View>
{showStatus && (
<View style={styles.statusContainer}>
{showSpinner && <ActivityIndicator size="small" color={colors.greenUI} />}
{showSpinner && <ActivityIndicator size="small" color={colors.primary} />}
{showCheckmark && <Checkmark testID={testID ? `${testID}/CheckIcon` : undefined} />}
{showError && (
<InfoIcon
color={colors.warning}
color={colors.error}
testID={testID ? `${testID}/ErrorIcon` : undefined}
/>
)}
Expand Down
2 changes: 1 addition & 1 deletion src/components/CommentTextInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default function CommentTextInput({ testID, onCommentChange, comment, onB
onChangeText={onCommentChange}
value={comment}
placeholder={t('addDescription') ?? undefined}
placeholderTextColor={colors.greenUI}
placeholderTextColor={colors.primary}
returnKeyType={'done'}
onBlur={onBlur}
blurOnSubmit={true}
Expand Down
4 changes: 2 additions & 2 deletions src/components/DevSkipButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,10 @@ const styles = StyleSheet.create({
height: 25,
},
skipButton: {
backgroundColor: colors.warning,
backgroundColor: colors.error,
},
debugButton: {
backgroundColor: colors.onboardingBlue,
backgroundColor: colors.infoDark,
},
hiddenButton: {
flex: 1,
Expand Down
2 changes: 1 addition & 1 deletion src/components/Dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export default function Dialog({
</TextButton>
)}
{showLoading ? (
<ActivityIndicator style={styles.primary} size="small" color={colors.greenUI} />
<ActivityIndicator style={styles.primary} size="small" color={colors.primary} />
) : (
<>
{actionText && (
Expand Down
2 changes: 1 addition & 1 deletion src/components/ErrorMessageInline.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ const styles = StyleSheet.create({
},
errorMessage: {
...fontStyles.small,
color: colors.warning,
color: colors.error,
},
})

Expand Down
2 changes: 1 addition & 1 deletion src/components/FeeDrawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ const styles = StyleSheet.create({
},
title: {
...fontStyles.regular,
color: colors.dark,
color: colors.black,
},
dropDownText: {
...fontStyles.regular,
Expand Down
2 changes: 1 addition & 1 deletion src/components/FullscreenCTA.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class FullscreenCTA extends React.PureComponent<Props> {

const styles = StyleSheet.create({
container: {
backgroundColor: Colors.light,
backgroundColor: Colors.white,
height: variables.height,
width: variables.width,
flex: 1,
Expand Down
2 changes: 1 addition & 1 deletion src/components/InLineNotification.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ const styles = StyleSheet.create({
bodyText: {
...typeScale.bodyXSmall,
lineHeight: 18,
color: Colors.dark,
color: Colors.black,
},
ctaLabel: {
...typeScale.labelSmall,
Expand Down
2 changes: 1 addition & 1 deletion src/components/LegacyFeeDrawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ const styles = StyleSheet.create({
},
title: {
...fontStyles.regular,
color: colors.dark,
color: colors.black,
},
dropDownText: {
...fontStyles.regular,
Expand Down
2 changes: 1 addition & 1 deletion src/components/LineItemRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ const styles = StyleSheet.create({
},
text: {
...fontStyles.regular,
color: colors.dark,
color: colors.black,
},
loadingContainer: {
transform: [{ scale: 0.7 }],
Expand Down
2 changes: 1 addition & 1 deletion src/components/ListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export default function ListItem({ children, onPress, disabled, testID }: Props)

const styles = StyleSheet.create({
container: {
backgroundColor: colors.light,
backgroundColor: colors.white,
},
innerView: {
paddingVertical: variables.contentPadding,
Expand Down
2 changes: 1 addition & 1 deletion src/components/Modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export default function Modal({

const styles = StyleSheet.create({
root: {
backgroundColor: colors.light,
backgroundColor: colors.white,
padding: 24,
maxHeight: '100%',
},
Expand Down
4 changes: 2 additions & 2 deletions src/components/OptionsChooser.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ function OptionsChooser({
options,
includeCancelButton,
isLastOptionDestructive,
buttonsColor = colors.greenUI,
buttonsColor = colors.primary,
onOptionChosen,
onCancel,
}: Props) {
Expand Down Expand Up @@ -72,7 +72,7 @@ function OptionsChooser({
{fullOptions.map((option, index) => {
const extraStyles = {
...(index === cancelButtonIndex ? fontStyles.large600 : fontStyles.large),
color: index === destructiveButtonIndex ? colors.warning : buttonsColor,
color: index === destructiveButtonIndex ? colors.error : buttonsColor,
}
return (
<>
Expand Down
4 changes: 2 additions & 2 deletions src/components/PercentageIndicator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ function PercentageIndicator({
let color: Colors

if (comparison > 0) {
color = Colors.greenUI
color = Colors.primary
indicator = <UpIcon color={color} testID={`${testID}:UpIndicator`} />
} else if (comparison < 0) {
color = Colors.warning
color = Colors.error
indicator = <DownIcon color={color} testID={`${testID}:DownIndicator`} />
} else {
color = Colors.gray3
Expand Down
2 changes: 1 addition & 1 deletion src/components/PhoneNumberInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ const styles = StyleSheet.create({
width: 80,
paddingHorizontal: 12,
alignItems: 'stretch',
backgroundColor: colors.light,
backgroundColor: colors.white,
borderRadius: 8,
},
countryFlagContainer: {
Expand Down
2 changes: 1 addition & 1 deletion src/components/Pill.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const styles = StyleSheet.create({
},
text: {
...fontStyles.small600,
color: colors.greenUI,
color: colors.primary,
},
})

Expand Down
2 changes: 1 addition & 1 deletion src/components/ReviewFrame.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ class ReviewFrame extends React.PureComponent<Props, State> {
const styles = StyleSheet.create({
body: {
flex: 1,
backgroundColor: colors.light,
backgroundColor: colors.white,
},
scrollViewContentContainer: {
paddingVertical: 10,
Expand Down
2 changes: 1 addition & 1 deletion src/components/ReviewHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const styles = StyleSheet.create({
heading: {
padding: 10,
paddingBottom: 10, // overwrite h1
color: colors.dark,
color: colors.black,
alignSelf: 'center',
},
})
Expand Down
2 changes: 1 addition & 1 deletion src/components/SectionHead.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default function SectionheadNew({ text, style }: Props) {

const styles = StyleSheet.create({
container: {
backgroundColor: colors.light,
backgroundColor: colors.white,
paddingHorizontal: variables.contentPadding,
paddingVertical: 8,
flexDirection: 'row',
Expand Down
Loading

0 comments on commit 129d74d

Please sign in to comment.