Badge.tsx 856 B

1234567891011121314151617181920
  1. /* Copyright (C) Click & Push Accessibility, Inc - All Rights Reserved
  2. * Unauthorized copying of this file, via any medium is strictly prohibited
  3. * Proprietary and confidential
  4. * Written and maintained by the Click & Push Development team
  5. * <dev@clicknpush.ca>, January 2022
  6. */
  7. import React, { memo } from "react"
  8. import { View, Text, ViewStyle } from "react-native"
  9. import { colors } from "../utils/GlobalUtils"
  10. const Badge: React.FC<{value: number, positioning: {top?: number, left?: number, right?: number, bottom?: number}}> = ({value, positioning}) => {
  11. return (
  12. <View style={[positioning, {position: 'absolute', backgroundColor: 'white', paddingVertical: 2, paddingHorizontal: 5, borderRadius: 50}]}>
  13. <Text style={{fontSize: 10, color: colors.red}}>{value}</Text>
  14. </View>
  15. )
  16. }
  17. export default memo(Badge)