UNPKG

react-native-ranking-leaderboard

Version:
29 lines (28 loc) 1.01 kB
"use strict"; import { Text, TouchableOpacity, View } from 'react-native'; import { jsx as _jsx } from "react/jsx-runtime"; export const SortingTypes = ({ sortingTypes, sorting, setSorting, showSortingTypes, style, styles, sortingPosition }) => { if (!showSortingTypes) return null; return /*#__PURE__*/_jsx(View, { style: [styles.sortingTypesContainer, sortingPosition == 'top' ? { marginBottom: 20 } : null], children: sortingTypes.map(st => /*#__PURE__*/_jsx(TouchableOpacity, { onPress: () => setSorting(st), style: [styles.sortingButton, style?.sortingButtonStyle, sorting === st && [styles.sortingButtonActive, style?.sortingButtonActiveStyle]], children: /*#__PURE__*/_jsx(Text, { style: [styles.sortingText, style?.sortingTextStyle, sorting === st && [styles.sortingTextActive, style?.sortingTextActiveStyle]], children: st.charAt(0).toUpperCase() + st.slice(1) }) }, st)) }); }; //# sourceMappingURL=SortingTypes.js.map