UNPKG

wooterz-onboarding-swiper

Version:

wooterz app fork of Onboarding 0.0.5 for your React-Native App

37 lines (32 loc) 681 B
import React from 'react'; import { View } from 'react-native'; import PropTypes from 'prop-types'; const Dot = ({ isLight, selected }) => { let backgroundColor; if (isLight) { backgroundColor = selected ? 'rgba(0, 0, 0, 0.8)' : 'rgba(0, 0, 0, 0.3)'; } else { backgroundColor = selected ? '#F78F1F' : 'rgba(0, 0, 0, 0.5)'; } return ( <View style={{ ...styles.dot, backgroundColor, }} /> ); }; Dot.propTypes = { isLight: PropTypes.bool.isRequired, selected: PropTypes.bool.isRequired, }; const styles = { dot: { width: 8, height: 8, borderRadius: 4, marginHorizontal: 10, }, }; export default Dot;