FilledPill.js 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. import { StyleSheet, Text, TouchableOpacity, View } from 'react-native'
  2. import React from 'react'
  3. import fonts from '../../../theme/fonts'
  4. import colors from '../../../theme/colors'
  5. import { ToggleButton } from 'react-native-paper'
  6. const FilledPill = ({label, style, textStyle, selectedStyle, selectedTextStyle, value,}) => {
  7. return (
  8. // <TouchableOpacity style={status === true || status === id ? [styles.selectedContainer, selectedStyle] : [styles.container, style]} onPress={onPress}>
  9. //
  10. // </TouchableOpacity>
  11. <ToggleButton style={status === true || status === id ? [styles.selectedContainer, selectedStyle] : [styles.container, style]}>
  12. <Text style={status === true || status === id ? [styles.selectedPillText, selectedTextStyle]: [styles.pillText,textStyle]}>{label}</Text>
  13. </ToggleButton>
  14. )
  15. }
  16. export default FilledPill
  17. const styles = StyleSheet.create({
  18. container: {
  19. borderRadius: fonts.getSize(18),
  20. paddingVertical: fonts.getSize(8),
  21. paddingHorizontal: fonts.getSize(16),
  22. backgroundColor: colors.white
  23. },
  24. selectedContainer:{
  25. paddingVertical: fonts.getSize(8),
  26. paddingHorizontal: fonts.getSize(16),
  27. backgroundColor: colors.topVariantColor,
  28. borderRadius: fonts.getSize(18),
  29. },
  30. selectedPillText: {
  31. fontFamily: fonts.type.semibold,
  32. fontSize:fonts.getSize(12),
  33. color: colors.white
  34. },
  35. pillText:{
  36. fontFamily: fonts.type.semibold,
  37. fontSize:fonts.getSize(12),
  38. color: colors.quaternaryColor
  39. }
  40. })