Skip to content

Commit 8cd7d92

Browse files
committed
Fix switching light/dark mode issue
1 parent ffb16a9 commit 8cd7d92

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

apps/fluent-tester/src/TestComponents/ColorTokens/ColorTokenTest.tsx

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,6 @@ const styles = StyleSheet.create({
5353
colorDescriptionNamePadding: { paddingRight: 5 },
5454
});
5555

56-
const getSwatchColorStyle = (colorName: string, colorValue: ColorValue): ViewStyle => {
57-
styles[colorName] = styles[colorName] || { backgroundColor: colorValue };
58-
return styles[colorName];
59-
};
60-
6156
type ColorTokenProps = { colorValue: ColorValue; colorName: string };
6257
const ColorToken: React.FunctionComponent<ColorTokenProps> = (p: ColorTokenProps) => {
6358
if (p.colorValue === undefined) {
@@ -68,7 +63,7 @@ const ColorToken: React.FunctionComponent<ColorTokenProps> = (p: ColorTokenProps
6863
return (
6964
<View style={styles.swatchItem}>
7065
<View
71-
style={[getSwatchColorStyle(p.colorName, p.colorValue), themedStyles.swatch]}
66+
style={[{ backgroundColor: p.colorValue }, themedStyles.swatch]}
7267
/* For Android E2E testing purposes, testProps must be passed in after accessibilityLabel. */
7368
{...testProps(COLORTOKENS_TEST_COMPONENT)}
7469
/>
@@ -89,7 +84,6 @@ const getSwatch = (item) => {
8984

9085
const AliasColorTokensSwatchList: React.FunctionComponent = () => {
9186
const theme = useTheme();
92-
9387
const aliasColorTokens = theme.colors;
9488

9589
const aggregator = React.useCallback(

0 commit comments

Comments
 (0)