UNPKG

@madeja-studio/telar

Version:

UI component library by Madeja Studio

32 lines (31 loc) 842 B
"use strict"; import { repeat } from '@madeja-studio/cepillo'; import { View } from 'react-native'; import { useTheme } from 'theme/ThemeContextProvider'; import tw from "../../tailwind/index.js"; import { jsx as _jsx } from "react/jsx-runtime"; const Circle = ({ isSelected }) => { const { theme } = useTheme(); return /*#__PURE__*/_jsx(View, { style: [tw`w-2 h-2 mx-1 rounded-full`, { backgroundColor: isSelected ? theme.pager.color.selected : theme.pager.color.unselected }] }); }; const PageIndicator = ({ numberOfPages, page }) => { return /*#__PURE__*/_jsx(View, { style: tw`center`, children: repeat(numberOfPages, i => i).map(index => /*#__PURE__*/_jsx(Circle, { isSelected: page === index }, index)) }); }; export default PageIndicator; //# sourceMappingURL=PageIndicator.js.map