reanimated-color-picker
Version:
A Pure JavaScript Color Picker for React Native
24 lines (23 loc) • 926 B
JavaScript
import React from 'react';
import Animated, { useAnimatedStyle } from 'react-native-reanimated';
import { styles } from '../../../styles';
import { enableAndroidHardwareTextures, getStyle } from '../../../utils';
export default function Solid({ width, height, borderRadius, thumbColor, adaptiveColor, thumbAnimatedStyle, style }) {
const computedStyle = {
width,
height,
borderRadius,
backgroundColor: thumbColor || 'gray',
borderWidth: 1,
};
const borderColor = getStyle(style, 'borderColor');
const adaptiveColorStyle = useAnimatedStyle(() => {
return {
borderColor: borderColor ?? adaptiveColor.value,
};
}, [borderColor, adaptiveColor]);
return /*#__PURE__*/ React.createElement(Animated.View, {
style: [styles.handle, computedStyle, style, styles.shadow, adaptiveColorStyle, thumbAnimatedStyle],
renderToHardwareTextureAndroid: enableAndroidHardwareTextures,
});
}