import React from 'react'; import { StyleProp, StyleSheet, View, ViewStyle } from 'react-native'; import { withTheme } from '../../core/theming'; import type { Color, Direction, Theme } from '../../types'; type Props = { color?: Color; direction?: Direction; disabled?: boolean; segments?: number; style?: StyleProp; theme: Theme; }; const pixelSize = 2; const ChevronIcon = ({ color, direction = 'down', disabled = false, segments = 5, style = {}, theme, ...rest }: Props) => { const baseColor = color || theme.materialText; let segmentSizes = new Array(segments).fill(null).map((_, i) => 1 + i * 2); if (['right', 'down'].includes(direction)) { segmentSizes = segmentSizes.reverse(); } const isHorizontal = ['left', 'right'].includes(direction); const SegmentPixel = () => ( ); return ( {segmentSizes.map((segmentSize, i) => ( {segmentSize !== 1 && } ))} ); }; const styles = StyleSheet.create({ wrapper: { position: 'relative', alignItems: 'center', }, }); export default withTheme(ChevronIcon);