DiscountView.js 989 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. import React from 'react';
  2. import { View, StyleSheet } from 'react-native';
  3. import Svg, { Path } from 'react-native-svg';
  4. export default DiscountView = ({visible=false}) => {
  5. if (visible) {
  6. return (<>
  7. <Svg
  8. width={35}
  9. height={35}
  10. viewBox="0 0 40 40"
  11. style={{top: 0, right: 0, zIndex: 2, position: 'absolute'}}>
  12. <Path
  13. fill={colorAccent}
  14. d="M28 0H0L40 40V12C40 5.37258 34.6274 -30 28 0Z" />
  15. <MaterialCommunityIcons
  16. name="brightness-percent"
  17. size={15}
  18. color={"white"}
  19. style={{top: 3, right: 3, position: 'absolute'}}
  20. />
  21. </Svg>
  22. <View style={styles.cardDiscount}></View>
  23. </>);
  24. } else {
  25. return <></>;
  26. }
  27. };
  28. const styles = StyleSheet.create({
  29. cardDiscount: {
  30. top: 0,
  31. left: 0,
  32. right: 0,
  33. bottom: 0,
  34. borderWidth: 3,
  35. borderRadius: 10,
  36. position: 'absolute',
  37. borderColor: colorAccent,
  38. borderStyle: 'solid'
  39. }
  40. })