Skip to content

Commit

Permalink
refactor: update brandColors to be imported from design system (#9875)
Browse files Browse the repository at this point in the history
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

## **Description**
This PR updates the brand color usage to be imported from the
design-tokens repo. Additionally, it updates all existing instances of
brand color usage (mainly QR codes and switches) to align with the
schema defined in the design-tokens. This change ensures that the
application consistently uses the brand colors specified by the design
system, improving maintainability and visual coherence across the
application.

<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->

## **Related issues**

Fixes: #9874 

## **Manual testing steps**

1. Go to settings
2. Check out the switches
3. See white color still works

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<!-- [screenshots/recordings] -->

### **After**

https://github.com/MetaMask/metamask-mobile/assets/14355083/b81a9143-cedc-440b-8dab-7f26bb3e76e2

<!-- [screenshots/recordings] -->

## **Pre-merge author checklist**

- [x] I’ve followed [MetaMask Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
  • Loading branch information
brianacnguyen authored Jun 5, 2024
1 parent d63fcbf commit a26fe0b
Show file tree
Hide file tree
Showing 36 changed files with 143 additions and 134 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export default function BasicFunctionalityComponent({
true: colors.primary.default,
false: colors.border.muted,
}}
thumbColor={theme.brandColors.white['000']}
thumbColor={theme.brandColors.white000}
ios_backgroundColor={colors.border.muted}
/>
</View>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ exports[`BasicFunctionality should render correctly 1`] = `
},
]
}
thumbTintColor="#FFFFFF"
thumbTintColor="#ffffff"
tintColor="#D6D9DC"
value={true}
/>
Expand Down
2 changes: 1 addition & 1 deletion app/components/UI/CollectibleContractElement/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ const createStyles = (colors, brandColors) =>
width: 32,
height: 32,
borderRadius: 16,
backgroundColor: brandColors.yellow['500'],
backgroundColor: brandColors.yellow500,
},
});

Expand Down
4 changes: 2 additions & 2 deletions app/components/UI/LoginOptionsSwitch/LoginOptionsSwitch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ const LoginOptionsSwitch = ({
true: colors.primary.default,
false: colors.border.muted,
}}
thumbColor={theme.brandColors.white['000']}
thumbColor={theme.brandColors.white000}
ios_backgroundColor={colors.border.muted}
testID={LoginOptionsSwitchSelectorsIDs.BIOMETRICS_SWITCH}
/>
Expand All @@ -86,7 +86,7 @@ const LoginOptionsSwitch = ({
true: colors.primary.default,
false: colors.border.muted,
}}
thumbColor={theme.brandColors.white['000']}
thumbColor={theme.brandColors.white000}
ios_backgroundColor={colors.border.muted}
{...generateTestId(Platform, LOGIN_WITH_REMEMBER_ME_SWITCH)}
/>
Expand Down
2 changes: 1 addition & 1 deletion app/components/UI/PaymentRequestSuccess/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ const createStyles = (theme) =>
qrCodeWrapper: {
marginVertical: 8,
padding: 8,
backgroundColor: theme.brandColors.white['000'],
backgroundColor: theme.brandColors.white000,
},
});

Expand Down
2 changes: 1 addition & 1 deletion app/components/UI/QRHardware/AnimatedQRCode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const createStyles = (theme: Theme) =>
wrapper: {
width: 300,
height: 300,
backgroundColor: theme.brandColors.white['000'],
backgroundColor: theme.brandColors.white000,
alignItems: 'center',
justifyContent: 'center',
},
Expand Down
6 changes: 3 additions & 3 deletions app/components/UI/QRHardware/AnimatedQRScanner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const createStyles = (theme: Theme) =>
container: {
width: '100%',
height: '100%',
backgroundColor: theme.brandColors.black['000'],
backgroundColor: theme.brandColors.black000,
},
preview: {
flex: 1,
Expand All @@ -57,7 +57,7 @@ const createStyles = (theme: Theme) =>
text: {
flex: 1,
fontSize: 17,
color: theme.brandColors.white['000'],
color: theme.brandColors.white000,
textAlign: 'center',
justifyContent: 'center',
marginTop: 100,
Expand All @@ -72,7 +72,7 @@ const createStyles = (theme: Theme) =>
hintText: {
width: 240,
maxWidth: '80%',
color: theme.brandColors.black['000'],
color: theme.brandColors.black000,
textAlign: 'center',
fontSize: 16,
...fontStyles.normal,
Expand Down
2 changes: 1 addition & 1 deletion app/components/UI/Ramp/Views/Settings/ActivationKeys.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ function ActivationKeys() {
true: colors.primary.default,
false: colors.border.muted,
}}
thumbColor={theme.brandColors.white['000']}
thumbColor={theme.brandColors.white000}
ios_backgroundColor={colors.border.muted}
disabled={isLoadingKeys}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -692,7 +692,7 @@ exports[`Settings Activation Keys renders correctly when is loading 1`] = `
},
]
}
thumbTintColor="#FFFFFF"
thumbTintColor="#ffffff"
tintColor="#D6D9DC"
value={true}
/>
Expand Down Expand Up @@ -878,7 +878,7 @@ exports[`Settings Activation Keys renders correctly when is loading 1`] = `
},
]
}
thumbTintColor="#FFFFFF"
thumbTintColor="#ffffff"
tintColor="#D6D9DC"
value={false}
/>
Expand Down Expand Up @@ -4227,7 +4227,7 @@ exports[`Settings renders correctly for internal builds 1`] = `
},
]
}
thumbTintColor="#FFFFFF"
thumbTintColor="#ffffff"
tintColor="#D6D9DC"
value={true}
/>
Expand Down Expand Up @@ -4413,7 +4413,7 @@ exports[`Settings renders correctly for internal builds 1`] = `
},
]
}
thumbTintColor="#FFFFFF"
thumbTintColor="#ffffff"
tintColor="#D6D9DC"
value={false}
/>
Expand Down
2 changes: 1 addition & 1 deletion app/components/UI/ReceiveRequest/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ const createStyles = (theme) =>
qrWrapper: {
margin: 8,
padding: 8,
backgroundColor: theme.brandColors.white['000'],
backgroundColor: theme.brandColors.white000,
},
addressWrapper: {
flexDirection: 'row',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const SecurityOptionToggle = ({
true: colors.primary.default,
false: colors.border.muted,
}}
thumbColor={theme.brandColors.white['000']}
thumbColor={theme.brandColors.white000}
style={styles.switch}
ios_backgroundColor={colors.border.muted}
disabled={disabled}
Expand Down
2 changes: 1 addition & 1 deletion app/components/Views/AddressQRCode/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const createStyles = (theme) =>
},
qrCode: {
padding: 8,
backgroundColor: theme.brandColors.white['000'],
backgroundColor: theme.brandColors.white000,
},
addressWrapper: {
alignItems: 'center',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export const createStyles = (theme: Theme) =>
paddingHorizontal: '30%',
},
buttonText: {
color: theme.brandColors.white['000'],
color: theme.brandColors.white000,
...fontStyles.normal,
},
image: {
Expand Down
2 changes: 1 addition & 1 deletion app/components/Views/LedgerConnect/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ const createStyles = (theme: any) =>
marginTop: Device.getDeviceHeight() * 0.025,
},
loader: {
color: theme.brandColors.white['000'],
color: theme.brandColors.white000,
},
});

Expand Down
6 changes: 3 additions & 3 deletions app/components/Views/MediaPlayer/AndroidMediaPlayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ const createStyles = (theme) =>
height: 4,
width: '100%',
borderRadius: 2,
backgroundColor: theme.brandColors.white['000'],
backgroundColor: theme.brandColors.white000,
},
seekbarPermanentFill: {
width: '100%',
Expand All @@ -137,7 +137,7 @@ const createStyles = (theme) =>
top: 14,
height: 14,
width: 14,
backgroundColor: theme.brandColors.white['000'],
backgroundColor: theme.brandColors.white000,
},
actionButton: {
width: 44,
Expand All @@ -150,7 +150,7 @@ const createStyles = (theme) =>
marginHorizontal: 8,
},
actionButtons: {
color: theme.brandColors.white['000'],
color: theme.brandColors.white000,
},
});

Expand Down
2 changes: 1 addition & 1 deletion app/components/Views/NetworkSelector/NetworkSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ const NetworkSelector = () => {
true: colors.primary.default,
false: colors.border.muted,
}}
thumbColor={theme.brandColors.white['000']}
thumbColor={theme.brandColors.white000}
ios_backgroundColor={colors.border.muted}
testID={NetworkListModalSelectorsIDs.TEST_NET_TOGGLE}
disabled={isTestNet(providerConfig.chainId)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1115,7 +1115,7 @@ exports[`Network Selector renders correctly 1`] = `
]
}
testID="test-network-switch-id"
thumbTintColor="#FFFFFF"
thumbTintColor="#ffffff"
tintColor="#D6D9DC"
value={false}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ exports[`DefaultSettings should render correctly 1`] = `
},
]
}
thumbTintColor="#FFFFFF"
thumbTintColor="#ffffff"
tintColor="#D6D9DC"
value={false}
/>
Expand Down
6 changes: 3 additions & 3 deletions app/components/Views/QRScanner/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const createStyles = (theme: Theme) =>
StyleSheet.create({
container: {
flex: 1,
backgroundColor: theme.brandColors.black['000'],
backgroundColor: theme.brandColors.black000,
},
preview: {
flex: 1,
Expand All @@ -18,7 +18,7 @@ const createStyles = (theme: Theme) =>
marginRight: 20,
width: 40,
alignSelf: 'flex-end',
color: theme.brandColors.white['000'],
color: theme.brandColors.white000,
},
frame: {
width: 250,
Expand All @@ -31,7 +31,7 @@ const createStyles = (theme: Theme) =>
text: {
flex: 1,
fontSize: 17,
color: theme.brandColors.white['000'],
color: theme.brandColors.white000,
textAlign: 'center',
justifyContent: 'center',
marginTop: 100,
Expand Down
2 changes: 1 addition & 1 deletion app/components/Views/RevealPrivateCredential/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ export const createStyles = (theme: Theme) =>
alignSelf: 'center',
justifyContent: 'center',
padding: 8,
backgroundColor: theme.brandColors.white['000'],
backgroundColor: theme.brandColors.white000,
},
tabUnderlineStyle: {
height: 2,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ exports[`AdvancedSettings should render correctly 1`] = `
],
]
}
thumbTintColor="#FFFFFF"
thumbTintColor="#ffffff"
tintColor="#D6D9DC"
value={false}
/>
Expand Down Expand Up @@ -342,7 +342,7 @@ exports[`AdvancedSettings should render correctly 1`] = `
],
]
}
thumbTintColor="#FFFFFF"
thumbTintColor="#ffffff"
tintColor="#D6D9DC"
value={true}
/>
Expand Down Expand Up @@ -447,7 +447,7 @@ exports[`AdvancedSettings should render correctly 1`] = `
]
}
testID="eth-sign-switch"
thumbTintColor="#FFFFFF"
thumbTintColor="#ffffff"
tintColor="#D6D9DC"
value={false}
/>
Expand Down Expand Up @@ -533,7 +533,7 @@ exports[`AdvancedSettings should render correctly 1`] = `
],
]
}
thumbTintColor="#FFFFFF"
thumbTintColor="#ffffff"
tintColor="#D6D9DC"
value={false}
/>
Expand Down Expand Up @@ -620,7 +620,7 @@ exports[`AdvancedSettings should render correctly 1`] = `
],
]
}
thumbTintColor="#FFFFFF"
thumbTintColor="#ffffff"
tintColor="#D6D9DC"
value={true}
/>
Expand Down Expand Up @@ -707,7 +707,7 @@ exports[`AdvancedSettings should render correctly 1`] = `
]
}
testID="show-fiat-on-testnets"
thumbTintColor="#FFFFFF"
thumbTintColor="#ffffff"
tintColor="#D6D9DC"
value={false}
/>
Expand Down
12 changes: 6 additions & 6 deletions app/components/Views/Settings/AdvancedSettings/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ class AdvancedSettings extends PureComponent {
true: colors.primary.default,
false: colors.border.muted,
}}
thumbColor={theme.brandColors.white['000']}
thumbColor={theme.brandColors.white000}
ios_backgroundColor={colors.border.muted}
style={styles.switch}
/>
Expand Down Expand Up @@ -464,7 +464,7 @@ class AdvancedSettings extends PureComponent {
true: colors.primary.default,
false: colors.border.muted,
}}
thumbColor={theme.brandColors.white['000']}
thumbColor={theme.brandColors.white000}
style={styles.switch}
ios_backgroundColor={colors.border.muted}
accessibilityLabel={strings(
Expand Down Expand Up @@ -503,7 +503,7 @@ class AdvancedSettings extends PureComponent {
true: colors.primary.default,
false: colors.border.muted,
}}
thumbColor={theme.brandColors.white['000']}
thumbColor={theme.brandColors.white000}
style={styles.switch}
ios_backgroundColor={colors.border.muted}
/>
Expand Down Expand Up @@ -543,7 +543,7 @@ class AdvancedSettings extends PureComponent {
true: colors.primary.default,
false: colors.border.muted,
}}
thumbColor={theme.brandColors.white['000']}
thumbColor={theme.brandColors.white000}
style={styles.switch}
ios_backgroundColor={colors.border.muted}
accessibilityRole={'switch'}
Expand Down Expand Up @@ -582,7 +582,7 @@ class AdvancedSettings extends PureComponent {
true: colors.primary.default,
false: colors.border.muted,
}}
thumbColor={theme.brandColors.white['000']}
thumbColor={theme.brandColors.white000}
style={styles.switch}
ios_backgroundColor={colors.border.muted}
/>
Expand Down Expand Up @@ -622,7 +622,7 @@ class AdvancedSettings extends PureComponent {
true: colors.primary.default,
false: colors.border.muted,
}}
thumbColor={theme.brandColors.white['000']}
thumbColor={theme.brandColors.white000}
style={styles.switch}
ios_backgroundColor={colors.border.muted}
/>
Expand Down
2 changes: 1 addition & 1 deletion app/components/Views/Settings/GeneralSettings/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ class Settings extends PureComponent {
true: colors.primary.default,
false: colors.border.muted,
}}
thumbColor={themeTokens.brandColors.white['000']}
thumbColor={themeTokens.brandColors.white000}
style={styles.switch}
ios_backgroundColor={colors.border.muted}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ const NotificationOptionToggle = ({
true: colors.primary.default,
false: colors.border.muted,
}}
thumbColor={theme.brandColors.white['000']}
thumbColor={theme.brandColors.white000}
style={styles.switch}
ios_backgroundColor={colors.border.muted}
disabled={disabled}
Expand Down
Loading

0 comments on commit a26fe0b

Please sign in to comment.