BearStudio / react-native-ficus-ui

🌱 React Native Ficus UI is a UI library to help you easily design and develop your applications
https://ficus-ui.com
MIT License
70 stars 2 forks source link

Unable to Style Input Component via Theme Configuration #22

Open omar-bear opened 9 months ago

omar-bear commented 9 months ago

Description

I am unable to style the Input component from the theme.

After looking through the Ficus UI codebase and examining the useDefaultProps hook, which is supposed to grab the Input component's style from the theme, I styled the Input in the following way:

import { InputProps } from 'react-native-ficus-ui';
import foundations from '@/theme/foundations';

export default {
  name: 'light',
  ...foundations,
  components: {
    // ...other components
    Input: {
      variant: 'default',
      variants: {
        default: {
          colorScheme: 'gray',
          bg: 'gray.50',
          borderColor: 'gray.200',
          borderWidth: 1,
          focusBorderWidth: 2,
          borderRadius: 'full',
          focusBorderColor: 'success.600',
          placeholderTextColor: 'gray.400',
        } as InputProps,
      },
    },
    // ...other components
  },
};

I also tried directly like this:

import { InputProps } from 'react-native-ficus-ui';
import foundations from '@/theme/foundations';

export default {
  name: 'light',
  ...foundations,
  components: {
    // ...other components
    Input: {
      colorScheme: 'gray',
      bg: 'gray.50',
      borderColor: 'gray.200',
      borderWidth: 1,
      focusBorderWidth: 2,
      borderRadius: 'full',
      focusBorderColor: 'success.600',
      placeholderTextColor: 'gray.400',
    },
    // ...other components
  },
};

However, it's still not working.

ntorionbearstudio commented 6 months ago

Can you test again please @omar-bear?

It's working when I try this for example :

<ThemeProvider
      theme={{
        components: {
          Input: {
            bg: 'red.50',
            borderColor: 'red.200',
            borderWidth: 2,
            focusBorderWidth: 3,
            borderRadius: 'full',
            focusBorderColor: 'red.600',
            placeholderTextColor: 'red.400',
          },
        },
      }}
    >