DiscountView.js 1011 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. </Svg>
  16. <View style={styles.cardDiscount}>
  17. <MaterialCommunityIcons
  18. name="brightness-percent"
  19. size={15}
  20. color={"#ffff"}
  21. style={{top: 0, right: 0, position: 'absolute'}}
  22. />
  23. </View>
  24. </>);
  25. } else {
  26. return <></>;
  27. }
  28. };
  29. const styles = StyleSheet.create({
  30. cardDiscount: {
  31. top: 0,
  32. left: 0,
  33. right: 0,
  34. bottom: 0,
  35. zIndex: 2,
  36. borderWidth: 3,
  37. borderRadius: 10,
  38. position: 'absolute',
  39. borderColor: colorAccent,
  40. borderStyle: 'solid'
  41. }
  42. })