jefelewis / react-native-ultimate-modal-picker

NPM Link: https://www.npmjs.com/package/react-native-ultimate-modal-picker
MIT License
42 stars 7 forks source link

How do you style the component? #1

Closed oscadev closed 3 years ago

oscadev commented 4 years ago

I dont need the width taking up the entire screen, and doing something like "width:200" either on the parent container, or as a style, or as a containerStyle, is completely ignored.

sandersonsoares commented 4 years ago

I had the same problem. But it is apparently not possible to change the style of the inputs.

paulbryan commented 4 years ago

I ended up editing the js file in the node directory and changing the styles I needed updated.

tonyduanesmith commented 4 years ago

Pushed changes up to allow overriding of styles, hoping the maintainer merges but if not I will create a new npm package

Jaseyacey commented 3 years ago

Pushed changes up to allow overriding of styles, hoping the maintainer merges but if not I will create a new npm package

Did you create an NPM package?

jefelewis commented 3 years ago

@oscadev @sandersonsoares @paulbryan @tonyduanesmith @Jaseyacey Sorry for the delayed response! It's been a busy year and I just haven't had the time to maintain some of my libraries. However, I've taken the past week and revamped the library completely with custom styles, React 17, iOS 14 support, improved darkMode, updated dependencies, improved package.json, improved file organization and file names, and Typescript Improvements.

You can add custom styles for any of the pickers and dropdowns. Here is an example:

<PickerTime
  title="Time (Custom Styles)"
  onChange={(date: Date) => setTime(date)}
  mode="spinner"
  customStyleContainer={{
    containerLight: {
      backgroundColor: '#000000',
      borderColor: '#000000',
      borderBottomWidth: 2,
    },
    containerDark: {
      backgroundColor: '#000000',
      borderColor: '#000000',
      borderBottomWidth: 2,
    },
  }}
  customStyleLabelText={{
    labelTextLight: {
      fontFamily: 'System',
      fontSize: 22,
      fontWeight: '800',
      textTransform: 'lowercase',
      color: 'red',
    },
    labelTextDark: {
      fontFamily: 'System',
      fontSize: 22,
      fontWeight: '800',
      textTransform: 'lowercase',
      color: 'red',
    },
  }}
/>