pankod / react-native-picker-modal-view

An unified React Native Picker Modal component for iOS and Android.
204 stars 55 forks source link

Dark mode support #106

Open sharathkbpract opened 2 years ago

sharathkbpract commented 2 years ago

How can i make the modal support dark mode ? I need to make the background a custom black shade and text such as options and index all white.

hatemalimam commented 1 year ago

This repo seems dead, and no one is maintaining it. I have created a fork where I have added some new props that can help in the dark mode area.

Basically it boils down to this example:

      searchInputStyle={styles.textInputContainer}
      alphabetsStyle={styles.alphabetsStyle}
      leftArrowIcon={
        <FontAwesome5 name={'chevron-left'} style={styles.upperIcons} />
      }
      closeArrowIcon={<FontAwesome5 name={'times'} style={styles.upperIcons} />}
      ContainerProps={{
        style: styles.pickerContainer,
      }}

Those props are new in this fork, the most important new props is ContainerProps, where you should set the style as follow:

pickerContainer: {
      flex: 1,
      backgroundColor: theme.color.background,
}

of course the background could be dark or light, depending on your theme.

For the reset of the props, you should create the appropriate styles based on your theme, color backgroundcolor etc...

In order to us this fork, you just need to add the package:

yarn add https://github.com/hatemalimam/react-native-picker-modal-view

Hope this helps.