yuanfux / react-native-hsv-color-picker

a react native HSV(hue, saturation, value) color picker
https://snack.expo.io/@fuyuanx/react-native-hsv-color-picker
48 stars 41 forks source link

add support to RTL #18

Open mega4area opened 3 years ago

mega4area commented 3 years ago

To add RTL support to this lib.

go inside library files in node_modules and found file name SaturationValuePicker.js

First:

import { I18nManager, } from 'react-native';

and then change this code inside the file to this:

const styles = StyleSheet.create({ container: { justifyContent: 'center', alignItems: 'center', }, slider: { top: 0, right: I18nManager.isRTL ? 0 : null, left: I18nManager.isRTL ? null :0, position: 'absolute', borderColor: '#fff', }, linearGradient: { overflow: 'hidden', }, });