wix / react-native-ui-lib

UI Components Library for React Native
https://wix.github.io/react-native-ui-lib/
MIT License
6.44k stars 706 forks source link

ActionSheet does not follow theme colors from the designTokens #2951

Open TolgaYigit opened 7 months ago

TolgaYigit commented 7 months ago

Description

The ActionSheet component does not follow theme colors from the designTokens.

Related to

Steps to reproduce

  1. Use the ActionSheet component in a project.
  2. Apply theme colors from designTokens.
  3. Open the ActionSheet.

Expected behavior

I expected the ActionSheet to follow the theme colors specified in designTokens.

Actual behavior

The ActionSheet does not adopt the theme colors from designTokens, and instead, it displays using static color modifiers.

More Info

In the given code snippets, both the styles of the action sheet and the renderAction function contain static color modifiers. They should be modified to utilize colors from the designTokens.

Code snippet

export const MyComponent = () => {
  const [showActionSheet, setShowActionSheet] = useState(false);

  return (
    <ActionSheet
      useSafeArea
      migrateDialog
      options={[
        {
          label: 'Refresh',
          onPress: () => {
            console.log('Refresh');
          },
        },
      ]}
      visible={showActionSheet}
      onDismiss={() => setShowActionSheet(false)}
    />
  );
};

Here is the style of the action sheet: https://github.com/wix/react-native-ui-lib/blob/6089796ae6d4a9b4b8574077797aa5aeb6f9ef1f/src/components/actionSheet/index.tsx#L288-L306

renderAction function: https://github.com/wix/react-native-ui-lib/blob/6089796ae6d4a9b4b8574077797aa5aeb6f9ef1f/src/components/actionSheet/index.tsx#L165-L183

Screenshots/Video

Environment

Affected platforms

TolgaYigit commented 7 months ago

Here is the pull request for the fix: https://github.com/wix/react-native-ui-lib/pull/2952