Skip to content

Commit

Permalink
Fix switching light/dark mode issue
Browse files Browse the repository at this point in the history
  • Loading branch information
lyzhan7 committed Aug 9, 2023
1 parent f71a294 commit 7cbf4ea
Showing 1 changed file with 1 addition and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,6 @@ const styles = StyleSheet.create({
colorDescriptionNamePadding: { paddingRight: 5 },
});

const getSwatchColorStyle = (colorName: string, colorValue: ColorValue): ViewStyle => {
styles[colorName] = styles[colorName] || { backgroundColor: colorValue };
return styles[colorName];
};

type ColorTokenProps = { colorValue: ColorValue; colorName: string };
const ColorToken: React.FunctionComponent<ColorTokenProps> = (p: ColorTokenProps) => {
if (p.colorValue === undefined) {
Expand All @@ -68,7 +63,7 @@ const ColorToken: React.FunctionComponent<ColorTokenProps> = (p: ColorTokenProps
return (
<View style={styles.swatchItem}>
<View
style={[getSwatchColorStyle(p.colorName, p.colorValue), themedStyles.swatch]}
style={[{ backgroundColor: p.colorValue }, themedStyles.swatch]}
/* For Android E2E testing purposes, testProps must be passed in after accessibilityLabel. */
{...testProps(COLORTOKENS_TEST_COMPONENT)}
/>
Expand All @@ -89,7 +84,6 @@ const getSwatch = (item) => {

const AliasColorTokensSwatchList: React.FunctionComponent = () => {
const theme = useTheme();

const aliasColorTokens = theme.colors;

const aggregator = React.useCallback(
Expand Down

0 comments on commit 7cbf4ea

Please sign in to comment.