related-ui-components 1.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +200 -0
- package/lib/commonjs/app/_layout.js +41 -0
- package/lib/commonjs/app/_layout.js.map +1 -0
- package/lib/commonjs/app/index.js +153 -0
- package/lib/commonjs/app/index.js.map +1 -0
- package/lib/commonjs/assets/components/BannerWithDetails.png +0 -0
- package/lib/commonjs/assets/components/DealCard-Horizontal.png +0 -0
- package/lib/commonjs/assets/components/DealCard-Vertical.png +0 -0
- package/lib/commonjs/assets/components/DealCard-floating.png +0 -0
- package/lib/commonjs/assets/components/DealCard-nested.png +0 -0
- package/lib/commonjs/assets/components/Filters.png +0 -0
- package/lib/commonjs/assets/components/Popup-1.png +0 -0
- package/lib/commonjs/assets/components/Popup-2.png +0 -0
- package/lib/commonjs/assets/components/Popup-3.png +0 -0
- package/lib/commonjs/assets/components/RedemptionOption-Horizontal.png +0 -0
- package/lib/commonjs/assets/components/RedemptionOption-Vertical.png +0 -0
- package/lib/commonjs/assets/components/SimpleBanner.png +0 -0
- package/lib/commonjs/assets/components/SimpleTrendingCard.png +0 -0
- package/lib/commonjs/assets/components/SimpleTrendingCardV2.png +0 -0
- package/lib/commonjs/assets/components/UnlockRewards-1.png +0 -0
- package/lib/commonjs/assets/components/UnlockRewards-2.png +0 -0
- package/lib/commonjs/assets/fonts/SpaceMono-Regular.ttf +0 -0
- package/lib/commonjs/assets/images/adaptive-icon.png +0 -0
- package/lib/commonjs/assets/images/face.jpg +0 -0
- package/lib/commonjs/assets/images/favicon.png +0 -0
- package/lib/commonjs/assets/images/giftvoucher.jpg +0 -0
- package/lib/commonjs/assets/images/icon.png +0 -0
- package/lib/commonjs/assets/images/insta.webp +0 -0
- package/lib/commonjs/assets/images/muse.jpg +0 -0
- package/lib/commonjs/assets/images/namshi-banner.png +0 -0
- package/lib/commonjs/assets/images/namshi.webp +0 -0
- package/lib/commonjs/assets/images/partial-react-logo.png +0 -0
- package/lib/commonjs/assets/images/pb-logo.jpg +0 -0
- package/lib/commonjs/assets/images/pb.jpg +0 -0
- package/lib/commonjs/assets/images/react-logo.png +0 -0
- package/lib/commonjs/assets/images/react-logo@2x.png +0 -0
- package/lib/commonjs/assets/images/react-logo@3x.png +0 -0
- package/lib/commonjs/assets/images/scratch_foreground.png +0 -0
- package/lib/commonjs/assets/images/splash-icon.png +0 -0
- package/lib/commonjs/assets/images/upgrade.png +0 -0
- package/lib/commonjs/components/Badges/Badge.js +65 -0
- package/lib/commonjs/components/Badges/Badge.js.map +1 -0
- package/lib/commonjs/components/Badges/README.md +98 -0
- package/lib/commonjs/components/Badges/index.js +29 -0
- package/lib/commonjs/components/Badges/index.js.map +1 -0
- package/lib/commonjs/components/Banner/Banner.js +135 -0
- package/lib/commonjs/components/Banner/Banner.js.map +1 -0
- package/lib/commonjs/components/Banner/BannerWithDetails.js +118 -0
- package/lib/commonjs/components/Banner/BannerWithDetails.js.map +1 -0
- package/lib/commonjs/components/Banner/README.md +101 -0
- package/lib/commonjs/components/Banner/index.js +48 -0
- package/lib/commonjs/components/Banner/index.js.map +1 -0
- package/lib/commonjs/components/BrandIcon/BrandIcon.js +103 -0
- package/lib/commonjs/components/BrandIcon/BrandIcon.js.map +1 -0
- package/lib/commonjs/components/BrandIcon/index.js +29 -0
- package/lib/commonjs/components/BrandIcon/index.js.map +1 -0
- package/lib/commonjs/components/Card/Card.js +124 -0
- package/lib/commonjs/components/Card/Card.js.map +1 -0
- package/lib/commonjs/components/Card/CardContent.js +42 -0
- package/lib/commonjs/components/Card/CardContent.js.map +1 -0
- package/lib/commonjs/components/Card/CardFooter.js +34 -0
- package/lib/commonjs/components/Card/CardFooter.js.map +1 -0
- package/lib/commonjs/components/Card/CardHeader.js +77 -0
- package/lib/commonjs/components/Card/CardHeader.js.map +1 -0
- package/lib/commonjs/components/Card/CardImage.js +51 -0
- package/lib/commonjs/components/Card/CardImage.js.map +1 -0
- package/lib/commonjs/components/Card/index.js +98 -0
- package/lib/commonjs/components/Card/index.js.map +1 -0
- package/lib/commonjs/components/Card/templates/DealCard.js +188 -0
- package/lib/commonjs/components/Card/templates/DealCard.js.map +1 -0
- package/lib/commonjs/components/Card/templates/DealCardWithBackgroundImage.js +195 -0
- package/lib/commonjs/components/Card/templates/DealCardWithBackgroundImage.js.map +1 -0
- package/lib/commonjs/components/Card/templates/README.md +233 -0
- package/lib/commonjs/components/Card/templates/SimpleTrendingCard.js +59 -0
- package/lib/commonjs/components/Card/templates/SimpleTrendingCard.js.map +1 -0
- package/lib/commonjs/components/Card/types.js +6 -0
- package/lib/commonjs/components/Card/types.js.map +1 -0
- package/lib/commonjs/components/CloseIcon/CloseIcon.js +71 -0
- package/lib/commonjs/components/CloseIcon/CloseIcon.js.map +1 -0
- package/lib/commonjs/components/CloseIcon/index.js +29 -0
- package/lib/commonjs/components/CloseIcon/index.js.map +1 -0
- package/lib/commonjs/components/Filters/Filters.js +339 -0
- package/lib/commonjs/components/Filters/Filters.js.map +1 -0
- package/lib/commonjs/components/Filters/PointsRangeSelector.js +262 -0
- package/lib/commonjs/components/Filters/PointsRangeSelector.js.map +1 -0
- package/lib/commonjs/components/Filters/README.md +212 -0
- package/lib/commonjs/components/Filters/index.js +47 -0
- package/lib/commonjs/components/Filters/index.js.map +1 -0
- package/lib/commonjs/components/Input/Input.js +156 -0
- package/lib/commonjs/components/Input/Input.js.map +1 -0
- package/lib/commonjs/components/Input/README.md +128 -0
- package/lib/commonjs/components/Input/index.js +29 -0
- package/lib/commonjs/components/Input/index.js.map +1 -0
- package/lib/commonjs/components/LockOverlay/LockOverlay.js +65 -0
- package/lib/commonjs/components/LockOverlay/LockOverlay.js.map +1 -0
- package/lib/commonjs/components/LockOverlay/index.js +29 -0
- package/lib/commonjs/components/LockOverlay/index.js.map +1 -0
- package/lib/commonjs/components/Popup/Popup.js +296 -0
- package/lib/commonjs/components/Popup/Popup.js.map +1 -0
- package/lib/commonjs/components/Popup/README.md +133 -0
- package/lib/commonjs/components/Popup/index.js +29 -0
- package/lib/commonjs/components/Popup/index.js.map +1 -0
- package/lib/commonjs/components/ProgressBar/ProgressBar.js +121 -0
- package/lib/commonjs/components/ProgressBar/ProgressBar.js.map +1 -0
- package/lib/commonjs/components/ProgressBar/index.js +29 -0
- package/lib/commonjs/components/ProgressBar/index.js.map +1 -0
- package/lib/commonjs/components/RedemptionOption/README.md +148 -0
- package/lib/commonjs/components/RedemptionOption/RedemptionOption.js +111 -0
- package/lib/commonjs/components/RedemptionOption/RedemptionOption.js.map +1 -0
- package/lib/commonjs/components/RedemptionOption/index.js +29 -0
- package/lib/commonjs/components/RedemptionOption/index.js.map +1 -0
- package/lib/commonjs/components/ScratchCard/README.md +119 -0
- package/lib/commonjs/components/ScratchCard/ScratchCard.js +153 -0
- package/lib/commonjs/components/ScratchCard/ScratchCard.js.map +1 -0
- package/lib/commonjs/components/ScratchCard/ScratchCardContent.js +28 -0
- package/lib/commonjs/components/ScratchCard/ScratchCardContent.js.map +1 -0
- package/lib/commonjs/components/ScratchCard/index.js +48 -0
- package/lib/commonjs/components/ScratchCard/index.js.map +1 -0
- package/lib/commonjs/components/UnlockRewards/README.md +187 -0
- package/lib/commonjs/components/UnlockRewards/RewardItem.js +125 -0
- package/lib/commonjs/components/UnlockRewards/RewardItem.js.map +1 -0
- package/lib/commonjs/components/UnlockRewards/UnlockRewards.js +207 -0
- package/lib/commonjs/components/UnlockRewards/UnlockRewards.js.map +1 -0
- package/lib/commonjs/components/UnlockRewards/index.js +48 -0
- package/lib/commonjs/components/UnlockRewards/index.js.map +1 -0
- package/lib/commonjs/components/Wheel/README.md +141 -0
- package/lib/commonjs/components/Wheel/Wheel.js +323 -0
- package/lib/commonjs/components/Wheel/Wheel.js.map +1 -0
- package/lib/commonjs/components/Wheel/index.js +29 -0
- package/lib/commonjs/components/Wheel/index.js.map +1 -0
- package/lib/commonjs/components/index.js +160 -0
- package/lib/commonjs/components/index.js.map +1 -0
- package/lib/commonjs/constants/BRANDS.js +57 -0
- package/lib/commonjs/constants/BRANDS.js.map +1 -0
- package/lib/commonjs/index.js +28 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/theme/Colors.js +120 -0
- package/lib/commonjs/theme/Colors.js.map +1 -0
- package/lib/commonjs/theme/ThemeContext.js +49 -0
- package/lib/commonjs/theme/ThemeContext.js.map +1 -0
- package/lib/commonjs/theme/index.js +28 -0
- package/lib/commonjs/theme/index.js.map +1 -0
- package/lib/module/app/_layout.js +36 -0
- package/lib/module/app/_layout.js.map +1 -0
- package/lib/module/app/index.js +143 -0
- package/lib/module/app/index.js.map +1 -0
- package/lib/module/assets/components/BannerWithDetails.png +0 -0
- package/lib/module/assets/components/DealCard-Horizontal.png +0 -0
- package/lib/module/assets/components/DealCard-Vertical.png +0 -0
- package/lib/module/assets/components/DealCard-floating.png +0 -0
- package/lib/module/assets/components/DealCard-nested.png +0 -0
- package/lib/module/assets/components/Filters.png +0 -0
- package/lib/module/assets/components/Popup-1.png +0 -0
- package/lib/module/assets/components/Popup-2.png +0 -0
- package/lib/module/assets/components/Popup-3.png +0 -0
- package/lib/module/assets/components/RedemptionOption-Horizontal.png +0 -0
- package/lib/module/assets/components/RedemptionOption-Vertical.png +0 -0
- package/lib/module/assets/components/SimpleBanner.png +0 -0
- package/lib/module/assets/components/SimpleTrendingCard.png +0 -0
- package/lib/module/assets/components/SimpleTrendingCardV2.png +0 -0
- package/lib/module/assets/components/UnlockRewards-1.png +0 -0
- package/lib/module/assets/components/UnlockRewards-2.png +0 -0
- package/lib/module/assets/fonts/SpaceMono-Regular.ttf +0 -0
- package/lib/module/assets/images/adaptive-icon.png +0 -0
- package/lib/module/assets/images/face.jpg +0 -0
- package/lib/module/assets/images/favicon.png +0 -0
- package/lib/module/assets/images/giftvoucher.jpg +0 -0
- package/lib/module/assets/images/icon.png +0 -0
- package/lib/module/assets/images/insta.webp +0 -0
- package/lib/module/assets/images/muse.jpg +0 -0
- package/lib/module/assets/images/namshi-banner.png +0 -0
- package/lib/module/assets/images/namshi.webp +0 -0
- package/lib/module/assets/images/partial-react-logo.png +0 -0
- package/lib/module/assets/images/pb-logo.jpg +0 -0
- package/lib/module/assets/images/pb.jpg +0 -0
- package/lib/module/assets/images/react-logo.png +0 -0
- package/lib/module/assets/images/react-logo@2x.png +0 -0
- package/lib/module/assets/images/react-logo@3x.png +0 -0
- package/lib/module/assets/images/scratch_foreground.png +0 -0
- package/lib/module/assets/images/splash-icon.png +0 -0
- package/lib/module/assets/images/upgrade.png +0 -0
- package/lib/module/components/Badges/Badge.js +59 -0
- package/lib/module/components/Badges/Badge.js.map +1 -0
- package/lib/module/components/Badges/README.md +98 -0
- package/lib/module/components/Badges/index.js +5 -0
- package/lib/module/components/Badges/index.js.map +1 -0
- package/lib/module/components/Banner/Banner.js +130 -0
- package/lib/module/components/Banner/Banner.js.map +1 -0
- package/lib/module/components/Banner/BannerWithDetails.js +111 -0
- package/lib/module/components/Banner/BannerWithDetails.js.map +1 -0
- package/lib/module/components/Banner/README.md +101 -0
- package/lib/module/components/Banner/index.js +7 -0
- package/lib/module/components/Banner/index.js.map +1 -0
- package/lib/module/components/BrandIcon/BrandIcon.js +98 -0
- package/lib/module/components/BrandIcon/BrandIcon.js.map +1 -0
- package/lib/module/components/BrandIcon/index.js +5 -0
- package/lib/module/components/BrandIcon/index.js.map +1 -0
- package/lib/module/components/Card/Card.js +119 -0
- package/lib/module/components/Card/Card.js.map +1 -0
- package/lib/module/components/Card/CardContent.js +37 -0
- package/lib/module/components/Card/CardContent.js.map +1 -0
- package/lib/module/components/Card/CardFooter.js +29 -0
- package/lib/module/components/Card/CardFooter.js.map +1 -0
- package/lib/module/components/Card/CardHeader.js +72 -0
- package/lib/module/components/Card/CardHeader.js.map +1 -0
- package/lib/module/components/Card/CardImage.js +46 -0
- package/lib/module/components/Card/CardImage.js.map +1 -0
- package/lib/module/components/Card/index.js +18 -0
- package/lib/module/components/Card/index.js.map +1 -0
- package/lib/module/components/Card/templates/DealCard.js +183 -0
- package/lib/module/components/Card/templates/DealCard.js.map +1 -0
- package/lib/module/components/Card/templates/DealCardWithBackgroundImage.js +188 -0
- package/lib/module/components/Card/templates/DealCardWithBackgroundImage.js.map +1 -0
- package/lib/module/components/Card/templates/README.md +233 -0
- package/lib/module/components/Card/templates/SimpleTrendingCard.js +54 -0
- package/lib/module/components/Card/templates/SimpleTrendingCard.js.map +1 -0
- package/lib/module/components/Card/types.js +4 -0
- package/lib/module/components/Card/types.js.map +1 -0
- package/lib/module/components/CloseIcon/CloseIcon.js +63 -0
- package/lib/module/components/CloseIcon/CloseIcon.js.map +1 -0
- package/lib/module/components/CloseIcon/index.js +5 -0
- package/lib/module/components/CloseIcon/index.js.map +1 -0
- package/lib/module/components/Filters/Filters.js +330 -0
- package/lib/module/components/Filters/Filters.js.map +1 -0
- package/lib/module/components/Filters/PointsRangeSelector.js +256 -0
- package/lib/module/components/Filters/PointsRangeSelector.js.map +1 -0
- package/lib/module/components/Filters/README.md +212 -0
- package/lib/module/components/Filters/index.js +7 -0
- package/lib/module/components/Filters/index.js.map +1 -0
- package/lib/module/components/Input/Input.js +150 -0
- package/lib/module/components/Input/Input.js.map +1 -0
- package/lib/module/components/Input/README.md +128 -0
- package/lib/module/components/Input/index.js +5 -0
- package/lib/module/components/Input/index.js.map +1 -0
- package/lib/module/components/LockOverlay/LockOverlay.js +60 -0
- package/lib/module/components/LockOverlay/LockOverlay.js.map +1 -0
- package/lib/module/components/LockOverlay/index.js +5 -0
- package/lib/module/components/LockOverlay/index.js.map +1 -0
- package/lib/module/components/Popup/Popup.js +291 -0
- package/lib/module/components/Popup/Popup.js.map +1 -0
- package/lib/module/components/Popup/README.md +133 -0
- package/lib/module/components/Popup/index.js +5 -0
- package/lib/module/components/Popup/index.js.map +1 -0
- package/lib/module/components/ProgressBar/ProgressBar.js +116 -0
- package/lib/module/components/ProgressBar/ProgressBar.js.map +1 -0
- package/lib/module/components/ProgressBar/index.js +5 -0
- package/lib/module/components/ProgressBar/index.js.map +1 -0
- package/lib/module/components/RedemptionOption/README.md +148 -0
- package/lib/module/components/RedemptionOption/RedemptionOption.js +106 -0
- package/lib/module/components/RedemptionOption/RedemptionOption.js.map +1 -0
- package/lib/module/components/RedemptionOption/index.js +5 -0
- package/lib/module/components/RedemptionOption/index.js.map +1 -0
- package/lib/module/components/ScratchCard/README.md +119 -0
- package/lib/module/components/ScratchCard/ScratchCard.js +147 -0
- package/lib/module/components/ScratchCard/ScratchCard.js.map +1 -0
- package/lib/module/components/ScratchCard/ScratchCardContent.js +24 -0
- package/lib/module/components/ScratchCard/ScratchCardContent.js.map +1 -0
- package/lib/module/components/ScratchCard/index.js +7 -0
- package/lib/module/components/ScratchCard/index.js.map +1 -0
- package/lib/module/components/UnlockRewards/README.md +187 -0
- package/lib/module/components/UnlockRewards/RewardItem.js +120 -0
- package/lib/module/components/UnlockRewards/RewardItem.js.map +1 -0
- package/lib/module/components/UnlockRewards/UnlockRewards.js +200 -0
- package/lib/module/components/UnlockRewards/UnlockRewards.js.map +1 -0
- package/lib/module/components/UnlockRewards/index.js +7 -0
- package/lib/module/components/UnlockRewards/index.js.map +1 -0
- package/lib/module/components/Wheel/README.md +141 -0
- package/lib/module/components/Wheel/Wheel.js +317 -0
- package/lib/module/components/Wheel/Wheel.js.map +1 -0
- package/lib/module/components/Wheel/index.js +5 -0
- package/lib/module/components/Wheel/index.js.map +1 -0
- package/lib/module/components/index.js +17 -0
- package/lib/module/components/index.js.map +1 -0
- package/lib/module/constants/BRANDS.js +53 -0
- package/lib/module/constants/BRANDS.js.map +1 -0
- package/lib/module/index.js +5 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/theme/Colors.js +116 -0
- package/lib/module/theme/Colors.js.map +1 -0
- package/lib/module/theme/ThemeContext.js +41 -0
- package/lib/module/theme/ThemeContext.js.map +1 -0
- package/lib/module/theme/index.js +5 -0
- package/lib/module/theme/index.js.map +1 -0
- package/lib/typescript/commonjs/app/_layout.d.ts +3 -0
- package/lib/typescript/commonjs/app/_layout.d.ts.map +1 -0
- package/lib/typescript/commonjs/app/index.d.ts +3 -0
- package/lib/typescript/commonjs/app/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Badges/Badge.d.ts +16 -0
- package/lib/typescript/commonjs/components/Badges/Badge.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Badges/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/Badges/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Banner/Banner.d.ts +26 -0
- package/lib/typescript/commonjs/components/Banner/Banner.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Banner/BannerWithDetails.d.ts +19 -0
- package/lib/typescript/commonjs/components/Banner/BannerWithDetails.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Banner/index.d.ts +5 -0
- package/lib/typescript/commonjs/components/Banner/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/BrandIcon/BrandIcon.d.ts +20 -0
- package/lib/typescript/commonjs/components/BrandIcon/BrandIcon.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/BrandIcon/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/BrandIcon/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Card/Card.d.ts +5 -0
- package/lib/typescript/commonjs/components/Card/Card.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Card/CardContent.d.ts +5 -0
- package/lib/typescript/commonjs/components/Card/CardContent.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Card/CardFooter.d.ts +5 -0
- package/lib/typescript/commonjs/components/Card/CardFooter.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Card/CardHeader.d.ts +5 -0
- package/lib/typescript/commonjs/components/Card/CardHeader.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Card/CardImage.d.ts +5 -0
- package/lib/typescript/commonjs/components/Card/CardImage.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Card/index.d.ts +11 -0
- package/lib/typescript/commonjs/components/Card/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Card/templates/DealCard.d.ts +33 -0
- package/lib/typescript/commonjs/components/Card/templates/DealCard.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Card/templates/DealCardWithBackgroundImage.d.ts +38 -0
- package/lib/typescript/commonjs/components/Card/templates/DealCardWithBackgroundImage.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Card/templates/SimpleTrendingCard.d.ts +14 -0
- package/lib/typescript/commonjs/components/Card/templates/SimpleTrendingCard.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Card/types.d.ts +78 -0
- package/lib/typescript/commonjs/components/Card/types.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/CloseIcon/CloseIcon.d.ts +16 -0
- package/lib/typescript/commonjs/components/CloseIcon/CloseIcon.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/CloseIcon/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/CloseIcon/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Filters/Filters.d.ts +74 -0
- package/lib/typescript/commonjs/components/Filters/Filters.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Filters/PointsRangeSelector.d.ts +29 -0
- package/lib/typescript/commonjs/components/Filters/PointsRangeSelector.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Filters/index.d.ts +5 -0
- package/lib/typescript/commonjs/components/Filters/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Input/Input.d.ts +23 -0
- package/lib/typescript/commonjs/components/Input/Input.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Input/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/Input/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/LockOverlay/LockOverlay.d.ts +16 -0
- package/lib/typescript/commonjs/components/LockOverlay/LockOverlay.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/LockOverlay/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/LockOverlay/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Popup/Popup.d.ts +38 -0
- package/lib/typescript/commonjs/components/Popup/Popup.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Popup/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/Popup/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/ProgressBar/ProgressBar.d.ts +26 -0
- package/lib/typescript/commonjs/components/ProgressBar/ProgressBar.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/ProgressBar/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/ProgressBar/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/RedemptionOption/RedemptionOption.d.ts +24 -0
- package/lib/typescript/commonjs/components/RedemptionOption/RedemptionOption.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/RedemptionOption/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/RedemptionOption/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/ScratchCard/ScratchCard.d.ts +20 -0
- package/lib/typescript/commonjs/components/ScratchCard/ScratchCard.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/ScratchCard/ScratchCardContent.d.ts +8 -0
- package/lib/typescript/commonjs/components/ScratchCard/ScratchCardContent.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/ScratchCard/index.d.ts +5 -0
- package/lib/typescript/commonjs/components/ScratchCard/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/UnlockRewards/RewardItem.d.ts +25 -0
- package/lib/typescript/commonjs/components/UnlockRewards/RewardItem.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/UnlockRewards/UnlockRewards.d.ts +59 -0
- package/lib/typescript/commonjs/components/UnlockRewards/UnlockRewards.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/UnlockRewards/index.d.ts +5 -0
- package/lib/typescript/commonjs/components/UnlockRewards/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Wheel/Wheel.d.ts +34 -0
- package/lib/typescript/commonjs/components/Wheel/Wheel.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Wheel/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/Wheel/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/index.d.ts +15 -0
- package/lib/typescript/commonjs/components/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/constants/BRANDS.d.ts +7 -0
- package/lib/typescript/commonjs/constants/BRANDS.d.ts.map +1 -0
- package/lib/typescript/commonjs/index.d.ts +3 -0
- package/lib/typescript/commonjs/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/package.json +1 -0
- package/lib/typescript/commonjs/theme/Colors.d.ts +28 -0
- package/lib/typescript/commonjs/theme/Colors.d.ts.map +1 -0
- package/lib/typescript/commonjs/theme/ThemeContext.d.ts +13 -0
- package/lib/typescript/commonjs/theme/ThemeContext.d.ts.map +1 -0
- package/lib/typescript/commonjs/theme/index.d.ts +3 -0
- package/lib/typescript/commonjs/theme/index.d.ts.map +1 -0
- package/lib/typescript/module/app/_layout.d.ts +3 -0
- package/lib/typescript/module/app/_layout.d.ts.map +1 -0
- package/lib/typescript/module/app/index.d.ts +3 -0
- package/lib/typescript/module/app/index.d.ts.map +1 -0
- package/lib/typescript/module/components/Badges/Badge.d.ts +16 -0
- package/lib/typescript/module/components/Badges/Badge.d.ts.map +1 -0
- package/lib/typescript/module/components/Badges/index.d.ts +3 -0
- package/lib/typescript/module/components/Badges/index.d.ts.map +1 -0
- package/lib/typescript/module/components/Banner/Banner.d.ts +26 -0
- package/lib/typescript/module/components/Banner/Banner.d.ts.map +1 -0
- package/lib/typescript/module/components/Banner/BannerWithDetails.d.ts +19 -0
- package/lib/typescript/module/components/Banner/BannerWithDetails.d.ts.map +1 -0
- package/lib/typescript/module/components/Banner/index.d.ts +5 -0
- package/lib/typescript/module/components/Banner/index.d.ts.map +1 -0
- package/lib/typescript/module/components/BrandIcon/BrandIcon.d.ts +20 -0
- package/lib/typescript/module/components/BrandIcon/BrandIcon.d.ts.map +1 -0
- package/lib/typescript/module/components/BrandIcon/index.d.ts +3 -0
- package/lib/typescript/module/components/BrandIcon/index.d.ts.map +1 -0
- package/lib/typescript/module/components/Card/Card.d.ts +5 -0
- package/lib/typescript/module/components/Card/Card.d.ts.map +1 -0
- package/lib/typescript/module/components/Card/CardContent.d.ts +5 -0
- package/lib/typescript/module/components/Card/CardContent.d.ts.map +1 -0
- package/lib/typescript/module/components/Card/CardFooter.d.ts +5 -0
- package/lib/typescript/module/components/Card/CardFooter.d.ts.map +1 -0
- package/lib/typescript/module/components/Card/CardHeader.d.ts +5 -0
- package/lib/typescript/module/components/Card/CardHeader.d.ts.map +1 -0
- package/lib/typescript/module/components/Card/CardImage.d.ts +5 -0
- package/lib/typescript/module/components/Card/CardImage.d.ts.map +1 -0
- package/lib/typescript/module/components/Card/index.d.ts +11 -0
- package/lib/typescript/module/components/Card/index.d.ts.map +1 -0
- package/lib/typescript/module/components/Card/templates/DealCard.d.ts +33 -0
- package/lib/typescript/module/components/Card/templates/DealCard.d.ts.map +1 -0
- package/lib/typescript/module/components/Card/templates/DealCardWithBackgroundImage.d.ts +38 -0
- package/lib/typescript/module/components/Card/templates/DealCardWithBackgroundImage.d.ts.map +1 -0
- package/lib/typescript/module/components/Card/templates/SimpleTrendingCard.d.ts +14 -0
- package/lib/typescript/module/components/Card/templates/SimpleTrendingCard.d.ts.map +1 -0
- package/lib/typescript/module/components/Card/types.d.ts +78 -0
- package/lib/typescript/module/components/Card/types.d.ts.map +1 -0
- package/lib/typescript/module/components/CloseIcon/CloseIcon.d.ts +16 -0
- package/lib/typescript/module/components/CloseIcon/CloseIcon.d.ts.map +1 -0
- package/lib/typescript/module/components/CloseIcon/index.d.ts +3 -0
- package/lib/typescript/module/components/CloseIcon/index.d.ts.map +1 -0
- package/lib/typescript/module/components/Filters/Filters.d.ts +74 -0
- package/lib/typescript/module/components/Filters/Filters.d.ts.map +1 -0
- package/lib/typescript/module/components/Filters/PointsRangeSelector.d.ts +29 -0
- package/lib/typescript/module/components/Filters/PointsRangeSelector.d.ts.map +1 -0
- package/lib/typescript/module/components/Filters/index.d.ts +5 -0
- package/lib/typescript/module/components/Filters/index.d.ts.map +1 -0
- package/lib/typescript/module/components/Input/Input.d.ts +23 -0
- package/lib/typescript/module/components/Input/Input.d.ts.map +1 -0
- package/lib/typescript/module/components/Input/index.d.ts +3 -0
- package/lib/typescript/module/components/Input/index.d.ts.map +1 -0
- package/lib/typescript/module/components/LockOverlay/LockOverlay.d.ts +16 -0
- package/lib/typescript/module/components/LockOverlay/LockOverlay.d.ts.map +1 -0
- package/lib/typescript/module/components/LockOverlay/index.d.ts +3 -0
- package/lib/typescript/module/components/LockOverlay/index.d.ts.map +1 -0
- package/lib/typescript/module/components/Popup/Popup.d.ts +38 -0
- package/lib/typescript/module/components/Popup/Popup.d.ts.map +1 -0
- package/lib/typescript/module/components/Popup/index.d.ts +3 -0
- package/lib/typescript/module/components/Popup/index.d.ts.map +1 -0
- package/lib/typescript/module/components/ProgressBar/ProgressBar.d.ts +26 -0
- package/lib/typescript/module/components/ProgressBar/ProgressBar.d.ts.map +1 -0
- package/lib/typescript/module/components/ProgressBar/index.d.ts +3 -0
- package/lib/typescript/module/components/ProgressBar/index.d.ts.map +1 -0
- package/lib/typescript/module/components/RedemptionOption/RedemptionOption.d.ts +24 -0
- package/lib/typescript/module/components/RedemptionOption/RedemptionOption.d.ts.map +1 -0
- package/lib/typescript/module/components/RedemptionOption/index.d.ts +3 -0
- package/lib/typescript/module/components/RedemptionOption/index.d.ts.map +1 -0
- package/lib/typescript/module/components/ScratchCard/ScratchCard.d.ts +20 -0
- package/lib/typescript/module/components/ScratchCard/ScratchCard.d.ts.map +1 -0
- package/lib/typescript/module/components/ScratchCard/ScratchCardContent.d.ts +8 -0
- package/lib/typescript/module/components/ScratchCard/ScratchCardContent.d.ts.map +1 -0
- package/lib/typescript/module/components/ScratchCard/index.d.ts +5 -0
- package/lib/typescript/module/components/ScratchCard/index.d.ts.map +1 -0
- package/lib/typescript/module/components/UnlockRewards/RewardItem.d.ts +25 -0
- package/lib/typescript/module/components/UnlockRewards/RewardItem.d.ts.map +1 -0
- package/lib/typescript/module/components/UnlockRewards/UnlockRewards.d.ts +59 -0
- package/lib/typescript/module/components/UnlockRewards/UnlockRewards.d.ts.map +1 -0
- package/lib/typescript/module/components/UnlockRewards/index.d.ts +5 -0
- package/lib/typescript/module/components/UnlockRewards/index.d.ts.map +1 -0
- package/lib/typescript/module/components/Wheel/Wheel.d.ts +34 -0
- package/lib/typescript/module/components/Wheel/Wheel.d.ts.map +1 -0
- package/lib/typescript/module/components/Wheel/index.d.ts +3 -0
- package/lib/typescript/module/components/Wheel/index.d.ts.map +1 -0
- package/lib/typescript/module/components/index.d.ts +15 -0
- package/lib/typescript/module/components/index.d.ts.map +1 -0
- package/lib/typescript/module/constants/BRANDS.d.ts +7 -0
- package/lib/typescript/module/constants/BRANDS.d.ts.map +1 -0
- package/lib/typescript/module/index.d.ts +3 -0
- package/lib/typescript/module/index.d.ts.map +1 -0
- package/lib/typescript/module/package.json +1 -0
- package/lib/typescript/module/theme/Colors.d.ts +28 -0
- package/lib/typescript/module/theme/Colors.d.ts.map +1 -0
- package/lib/typescript/module/theme/ThemeContext.d.ts +13 -0
- package/lib/typescript/module/theme/ThemeContext.d.ts.map +1 -0
- package/lib/typescript/module/theme/index.d.ts +3 -0
- package/lib/typescript/module/theme/index.d.ts.map +1 -0
- package/package.json +116 -0
- package/src/app/_layout.tsx +38 -0
- package/src/app/index.tsx +115 -0
- package/src/assets/components/BannerWithDetails.png +0 -0
- package/src/assets/components/DealCard-Horizontal.png +0 -0
- package/src/assets/components/DealCard-Vertical.png +0 -0
- package/src/assets/components/DealCard-floating.png +0 -0
- package/src/assets/components/DealCard-nested.png +0 -0
- package/src/assets/components/Filters.png +0 -0
- package/src/assets/components/Popup-1.png +0 -0
- package/src/assets/components/Popup-2.png +0 -0
- package/src/assets/components/Popup-3.png +0 -0
- package/src/assets/components/RedemptionOption-Horizontal.png +0 -0
- package/src/assets/components/RedemptionOption-Vertical.png +0 -0
- package/src/assets/components/SimpleBanner.png +0 -0
- package/src/assets/components/SimpleTrendingCard.png +0 -0
- package/src/assets/components/SimpleTrendingCardV2.png +0 -0
- package/src/assets/components/UnlockRewards-1.png +0 -0
- package/src/assets/components/UnlockRewards-2.png +0 -0
- package/src/assets/fonts/SpaceMono-Regular.ttf +0 -0
- package/src/assets/images/adaptive-icon.png +0 -0
- package/src/assets/images/face.jpg +0 -0
- package/src/assets/images/favicon.png +0 -0
- package/src/assets/images/giftvoucher.jpg +0 -0
- package/src/assets/images/icon.png +0 -0
- package/src/assets/images/insta.webp +0 -0
- package/src/assets/images/muse.jpg +0 -0
- package/src/assets/images/namshi-banner.png +0 -0
- package/src/assets/images/namshi.webp +0 -0
- package/src/assets/images/partial-react-logo.png +0 -0
- package/src/assets/images/pb-logo.jpg +0 -0
- package/src/assets/images/pb.jpg +0 -0
- package/src/assets/images/react-logo.png +0 -0
- package/src/assets/images/react-logo@2x.png +0 -0
- package/src/assets/images/react-logo@3x.png +0 -0
- package/src/assets/images/scratch_foreground.png +0 -0
- package/src/assets/images/splash-icon.png +0 -0
- package/src/assets/images/upgrade.png +0 -0
- package/src/components/Badges/Badge.tsx +81 -0
- package/src/components/Badges/README.md +98 -0
- package/src/components/Badges/index.ts +2 -0
- package/src/components/Banner/Banner.tsx +172 -0
- package/src/components/Banner/BannerWithDetails.tsx +133 -0
- package/src/components/Banner/README.md +101 -0
- package/src/components/Banner/index.ts +5 -0
- package/src/components/BrandIcon/BrandIcon.tsx +134 -0
- package/src/components/BrandIcon/index.ts +2 -0
- package/src/components/Card/Card.tsx +144 -0
- package/src/components/Card/CardContent.tsx +33 -0
- package/src/components/Card/CardFooter.tsx +33 -0
- package/src/components/Card/CardHeader.tsx +80 -0
- package/src/components/Card/CardImage.tsx +51 -0
- package/src/components/Card/index.ts +15 -0
- package/src/components/Card/templates/DealCard.tsx +255 -0
- package/src/components/Card/templates/DealCardWithBackgroundImage.tsx +273 -0
- package/src/components/Card/templates/README.md +233 -0
- package/src/components/Card/templates/SimpleTrendingCard.tsx +54 -0
- package/src/components/Card/types.ts +75 -0
- package/src/components/CloseIcon/CloseIcon.tsx +77 -0
- package/src/components/CloseIcon/index.ts +2 -0
- package/src/components/Filters/Filters.tsx +427 -0
- package/src/components/Filters/PointsRangeSelector.tsx +319 -0
- package/src/components/Filters/README.md +212 -0
- package/src/components/Filters/index.ts +4 -0
- package/src/components/Input/Input.tsx +218 -0
- package/src/components/Input/README.md +128 -0
- package/src/components/Input/index.ts +2 -0
- package/src/components/LockOverlay/LockOverlay.tsx +82 -0
- package/src/components/LockOverlay/index.ts +2 -0
- package/src/components/Popup/Popup.tsx +374 -0
- package/src/components/Popup/README.md +133 -0
- package/src/components/Popup/index.ts +2 -0
- package/src/components/ProgressBar/ProgressBar.tsx +157 -0
- package/src/components/ProgressBar/index.ts +2 -0
- package/src/components/RedemptionOption/README.md +148 -0
- package/src/components/RedemptionOption/RedemptionOption.tsx +158 -0
- package/src/components/RedemptionOption/index.ts +2 -0
- package/src/components/ScratchCard/README.md +119 -0
- package/src/components/ScratchCard/ScratchCard.tsx +190 -0
- package/src/components/ScratchCard/ScratchCardContent.tsx +25 -0
- package/src/components/ScratchCard/index.ts +4 -0
- package/src/components/UnlockRewards/README.md +187 -0
- package/src/components/UnlockRewards/RewardItem.tsx +172 -0
- package/src/components/UnlockRewards/UnlockRewards.tsx +293 -0
- package/src/components/UnlockRewards/index.ts +4 -0
- package/src/components/Wheel/README.md +141 -0
- package/src/components/Wheel/Wheel.tsx +374 -0
- package/src/components/Wheel/index.ts +2 -0
- package/src/components/index.ts +14 -0
- package/src/constants/BRANDS.ts +64 -0
- package/src/index.ts +2 -0
- package/src/theme/Colors.ts +107 -0
- package/src/theme/ThemeContext.tsx +46 -0
- package/src/theme/index.ts +2 -0
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
# RedemptionOption Component
|
|
2
|
+
|
|
3
|
+
A flexible, customizable touchable option component for React Native applications with support for icons, vertical/horizontal layouts, active states, and extensive styling options.
|
|
4
|
+
|
|
5
|
+
## Basic Usage
|
|
6
|
+
|
|
7
|
+
```jsx
|
|
8
|
+
import React from 'react';
|
|
9
|
+
import { View } from 'react-native';
|
|
10
|
+
import { RedemptionOption } from '@your-org/component-library';
|
|
11
|
+
import { GiftIcon } from '@your-org/icons';
|
|
12
|
+
|
|
13
|
+
const RewardsScreen = () => {
|
|
14
|
+
return (
|
|
15
|
+
<View style={{ padding: 16 }}>
|
|
16
|
+
<RedemptionOption
|
|
17
|
+
icon={<GiftIcon size={24} color="#FFFFFF" />}
|
|
18
|
+
text="Redeem Points"
|
|
19
|
+
onPress={() => console.log('Option pressed')}
|
|
20
|
+
/>
|
|
21
|
+
</View>
|
|
22
|
+
);
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export default RewardsScreen;
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Props
|
|
29
|
+
|
|
30
|
+
The `RedemptionOption` component provides extensive customization options through its props.
|
|
31
|
+
|
|
32
|
+
### Core Properties
|
|
33
|
+
|
|
34
|
+
| Prop | Type | Required | Default | Description |
|
|
35
|
+
|------|------|----------|---------|-------------|
|
|
36
|
+
| `icon` | `React.ReactNode` | ✅ | - | Icon component to display in the option |
|
|
37
|
+
| `text` | `string` | ✅ | - | Text label to display with the icon |
|
|
38
|
+
|
|
39
|
+
### Layout & Appearance Properties
|
|
40
|
+
|
|
41
|
+
| Prop | Type | Required | Default | Description |
|
|
42
|
+
|------|------|----------|---------|-------------|
|
|
43
|
+
| `orientation` | `"vertical" \| "horizontal"` | ❌ | `"vertical"` | Determines the layout direction of icon and text |
|
|
44
|
+
| `backgroundColor` | `string` | ❌ | theme.primary | Background color of the option |
|
|
45
|
+
| `textColor` | `string` | ❌ | theme.secondary | Color of the text label |
|
|
46
|
+
| `width` | `number \| string` | ❌ | - | Width of the option component |
|
|
47
|
+
| `height` | `number \| string` | ❌ | - | Height of the option component |
|
|
48
|
+
| `borderRadius` | `number` | ❌ | `8` | Corner radius of the option component |
|
|
49
|
+
| `padding` | `number` | ❌ | `12` | Padding inside the option component |
|
|
50
|
+
| `fontSize` | `number` | ❌ | `14` | Base font size for the text (actual size will be 90% of this value) |
|
|
51
|
+
|
|
52
|
+
### State Properties
|
|
53
|
+
|
|
54
|
+
| Prop | Type | Required | Default | Description |
|
|
55
|
+
|------|------|----------|---------|-------------|
|
|
56
|
+
| `disabled` | `boolean` | ❌ | `false` | Whether the option is disabled (reduces opacity and prevents interaction) |
|
|
57
|
+
| `isActive` | `boolean` | ❌ | `false` | Whether the option is in active state (adds a border) |
|
|
58
|
+
| `activeOpacityValue` | `number` | ❌ | `0.7` | The opacity value when the button is pressed |
|
|
59
|
+
|
|
60
|
+
### Style Customization
|
|
61
|
+
|
|
62
|
+
| Prop | Type | Required | Default | Description |
|
|
63
|
+
|------|------|----------|---------|-------------|
|
|
64
|
+
| `containerStyle` | `StyleProp<ViewStyle>` | ❌ | - | Style for the outer container |
|
|
65
|
+
| `textStyle` | `StyleProp<TextStyle>` | ❌ | - | Style for the text label |
|
|
66
|
+
| `iconContainerStyle` | `StyleProp<ViewStyle>` | ❌ | - | Style for the container around the icon |
|
|
67
|
+
|
|
68
|
+
### Behavior Props
|
|
69
|
+
|
|
70
|
+
| Prop | Type | Required | Default | Description |
|
|
71
|
+
|------|------|----------|---------|-------------|
|
|
72
|
+
| `onPress` | `() => void` | ❌ | - | Function to call when the option is pressed |
|
|
73
|
+
|
|
74
|
+
## Examples
|
|
75
|
+
|
|
76
|
+
### Vertical Layout (Default)
|
|
77
|
+
|
|
78
|
+
```jsx
|
|
79
|
+
<RedemptionOption
|
|
80
|
+
icon={<CoinIcon size={24} color="#FFD700" />}
|
|
81
|
+
text="Redeem Coins"
|
|
82
|
+
onPress={() => handleRedemption('coins')}
|
|
83
|
+
backgroundColor="#2C3E50"
|
|
84
|
+
textColor="#FFFFFF"
|
|
85
|
+
/>
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### Horizontal Layout
|
|
89
|
+
|
|
90
|
+
```jsx
|
|
91
|
+
<RedemptionOption
|
|
92
|
+
icon={<TicketIcon size={20} color="#FF5722" />}
|
|
93
|
+
text="Movie Tickets"
|
|
94
|
+
orientation="horizontal"
|
|
95
|
+
onPress={() => handleRedemption('tickets')}
|
|
96
|
+
width="100%"
|
|
97
|
+
padding={16}
|
|
98
|
+
/>
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### Active State
|
|
102
|
+
|
|
103
|
+
```jsx
|
|
104
|
+
<RedemptionOption
|
|
105
|
+
icon={<StarIcon size={22} color="#FFD700" />}
|
|
106
|
+
text="Premium Rewards"
|
|
107
|
+
isActive={selectedReward === 'premium'}
|
|
108
|
+
onPress={() => setSelectedReward('premium')}
|
|
109
|
+
backgroundColor="#1E88E5"
|
|
110
|
+
textColor="#FFFFFF"
|
|
111
|
+
/>
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### Disabled State
|
|
115
|
+
|
|
116
|
+
```jsx
|
|
117
|
+
<RedemptionOption
|
|
118
|
+
icon={<LockIcon size={20} color="#9E9E9E" />}
|
|
119
|
+
text="Locked Reward"
|
|
120
|
+
disabled={!hasEnoughPoints}
|
|
121
|
+
onPress={() => handleRedemption('locked')}
|
|
122
|
+
backgroundColor="#ECEFF1"
|
|
123
|
+
textColor="#757575"
|
|
124
|
+
/>
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
### Custom Styling
|
|
128
|
+
|
|
129
|
+
```jsx
|
|
130
|
+
<RedemptionOption
|
|
131
|
+
icon={<GiftIcon size={28} color="#E91E63" />}
|
|
132
|
+
text="Special Offer"
|
|
133
|
+
containerStyle={{
|
|
134
|
+
shadowColor: '#000',
|
|
135
|
+
shadowOffset: { width: 0, height: 2 },
|
|
136
|
+
shadowOpacity: 0.3,
|
|
137
|
+
shadowRadius: 4,
|
|
138
|
+
elevation: 5,
|
|
139
|
+
}}
|
|
140
|
+
iconContainerStyle={{
|
|
141
|
+
backgroundColor: 'rgba(233, 30, 99, 0.1)',
|
|
142
|
+
borderRadius: 20,
|
|
143
|
+
padding: 8
|
|
144
|
+
}}
|
|
145
|
+
textStyle={{ fontWeight: 'bold', letterSpacing: 0.5 }}
|
|
146
|
+
onPress={() => handleSpecialOffer()}
|
|
147
|
+
/>
|
|
148
|
+
```
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { useTheme } from "../../theme/index.js";
|
|
4
|
+
import React from "react";
|
|
5
|
+
import { TouchableOpacity, Text, View, StyleSheet } from "react-native";
|
|
6
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
|
+
const RedemptionOption = ({
|
|
8
|
+
icon,
|
|
9
|
+
text,
|
|
10
|
+
orientation = "vertical",
|
|
11
|
+
backgroundColor,
|
|
12
|
+
textColor,
|
|
13
|
+
width,
|
|
14
|
+
height,
|
|
15
|
+
borderRadius = 8,
|
|
16
|
+
padding = 12,
|
|
17
|
+
fontSize = 14,
|
|
18
|
+
disabled = false,
|
|
19
|
+
isActive = false,
|
|
20
|
+
onPress,
|
|
21
|
+
containerStyle,
|
|
22
|
+
textStyle,
|
|
23
|
+
iconContainerStyle,
|
|
24
|
+
activeOpacityValue = 0.7
|
|
25
|
+
}) => {
|
|
26
|
+
const theme = useTheme();
|
|
27
|
+
textColor = textColor || theme.onSurface;
|
|
28
|
+
// Dynamic styles based on props
|
|
29
|
+
let dynamicContainerStyle = {
|
|
30
|
+
backgroundColor: backgroundColor || theme.surface,
|
|
31
|
+
borderRadius,
|
|
32
|
+
padding,
|
|
33
|
+
borderWidth: isActive ? 2 : 0,
|
|
34
|
+
borderColor: isActive ? textColor : undefined
|
|
35
|
+
};
|
|
36
|
+
if (width) dynamicContainerStyle.width = width;
|
|
37
|
+
if (height) dynamicContainerStyle.height = height;
|
|
38
|
+
const dynamicTextStyle = {
|
|
39
|
+
color: textColor,
|
|
40
|
+
fontSize: fontSize * 0.9,
|
|
41
|
+
lineHeight: fontSize * 1.1
|
|
42
|
+
};
|
|
43
|
+
return /*#__PURE__*/_jsxs(TouchableOpacity, {
|
|
44
|
+
style: [styles.container, orientation === "vertical" ? styles.vertical : styles.horizontal, dynamicContainerStyle, disabled && styles.disabled, containerStyle],
|
|
45
|
+
onPress: onPress,
|
|
46
|
+
disabled: disabled,
|
|
47
|
+
activeOpacity: activeOpacityValue,
|
|
48
|
+
accessibilityRole: "button",
|
|
49
|
+
accessibilityState: {
|
|
50
|
+
disabled,
|
|
51
|
+
selected: isActive
|
|
52
|
+
},
|
|
53
|
+
children: [/*#__PURE__*/_jsx(View, {
|
|
54
|
+
style: [styles.iconContainer, orientation === "horizontal" && styles.iconHorizontal, iconContainerStyle],
|
|
55
|
+
children: icon
|
|
56
|
+
}), /*#__PURE__*/_jsx(View, {
|
|
57
|
+
style: {
|
|
58
|
+
minHeight: 40,
|
|
59
|
+
justifyContent: "center"
|
|
60
|
+
},
|
|
61
|
+
children: /*#__PURE__*/_jsx(Text, {
|
|
62
|
+
style: [styles.text, orientation === "horizontal" ? {} : styles.textVertical, dynamicTextStyle, textStyle],
|
|
63
|
+
numberOfLines: 2,
|
|
64
|
+
ellipsizeMode: "tail",
|
|
65
|
+
adjustsFontSizeToFit: orientation === "vertical",
|
|
66
|
+
minimumFontScale: 0.8,
|
|
67
|
+
children: text
|
|
68
|
+
})
|
|
69
|
+
})]
|
|
70
|
+
});
|
|
71
|
+
};
|
|
72
|
+
const styles = StyleSheet.create({
|
|
73
|
+
container: {
|
|
74
|
+
alignItems: "center",
|
|
75
|
+
justifyContent: "center"
|
|
76
|
+
},
|
|
77
|
+
vertical: {
|
|
78
|
+
flexDirection: "column",
|
|
79
|
+
justifyContent: "center"
|
|
80
|
+
},
|
|
81
|
+
horizontal: {
|
|
82
|
+
flexDirection: "row",
|
|
83
|
+
justifyContent: "flex-start",
|
|
84
|
+
alignItems: "center"
|
|
85
|
+
},
|
|
86
|
+
iconContainer: {
|
|
87
|
+
marginBottom: 8,
|
|
88
|
+
justifyContent: "center",
|
|
89
|
+
alignItems: "center"
|
|
90
|
+
},
|
|
91
|
+
iconHorizontal: {
|
|
92
|
+
marginBottom: 0,
|
|
93
|
+
marginRight: 12
|
|
94
|
+
},
|
|
95
|
+
text: {
|
|
96
|
+
fontWeight: "500"
|
|
97
|
+
},
|
|
98
|
+
textVertical: {
|
|
99
|
+
textAlign: "center"
|
|
100
|
+
},
|
|
101
|
+
disabled: {
|
|
102
|
+
opacity: 0.6
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
export default RedemptionOption;
|
|
106
|
+
//# sourceMappingURL=RedemptionOption.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useTheme","React","TouchableOpacity","Text","View","StyleSheet","jsx","_jsx","jsxs","_jsxs","RedemptionOption","icon","text","orientation","backgroundColor","textColor","width","height","borderRadius","padding","fontSize","disabled","isActive","onPress","containerStyle","textStyle","iconContainerStyle","activeOpacityValue","theme","onSurface","dynamicContainerStyle","surface","borderWidth","borderColor","undefined","dynamicTextStyle","color","lineHeight","style","styles","container","vertical","horizontal","activeOpacity","accessibilityRole","accessibilityState","selected","children","iconContainer","iconHorizontal","minHeight","justifyContent","textVertical","numberOfLines","ellipsizeMode","adjustsFontSizeToFit","minimumFontScale","create","alignItems","flexDirection","marginBottom","marginRight","fontWeight","textAlign","opacity"],"sourceRoot":"..\\..\\..\\..\\src","sources":["components/RedemptionOption/RedemptionOption.tsx"],"mappings":";;AAAA,SAASA,QAAQ,QAAQ,sBAAa;AACtC,OAAOC,KAAK,MAAM,OAAO;AACzB,SACEC,gBAAgB,EAChBC,IAAI,EACJC,IAAI,EACJC,UAAU,QAML,cAAc;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAyBtB,MAAMC,gBAAiD,GAAGA,CAAC;EACzDC,IAAI;EACJC,IAAI;EACJC,WAAW,GAAG,UAAU;EACxBC,eAAe;EACfC,SAAS;EACTC,K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;EACDV,YAAY,EAAE;IACZW,SAAS,EAAE;EACb,CAAC;EACD1C,QAAQ,EAAE;IACR2C,OAAO,EAAE;EACX;AACF,CAAC,CAAC;AAEF,eAAetD,gBAAgB","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["default","RedemptionOption"],"sourceRoot":"..\\..\\..\\..\\src","sources":["components/RedemptionOption/index.ts"],"mappings":";;AAAA,SAASA,OAAO,IAAIC,gBAAgB,QAAO,uBAAoB;AAC/D,cAAc,uBAAoB","ignoreList":[]}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
## ScratchCard Documentation
|
|
2
|
+
|
|
3
|
+
The `ScratchCard` is an interactive component that creates a scratch-to-reveal experience commonly used for promotions, rewards, and gamification features. It leverages the Shopify React Native Skia library to provide a smooth scratching animation with customizable appearance. The component tracks scratching progress and can trigger an action when a sufficient area has been revealed.
|
|
4
|
+
|
|
5
|
+
### Usage
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
import ScratchCard from "@/components/ScratchCard/ScratchCard";
|
|
9
|
+
import ScratchCardContent from "@/components/ScratchCard/ScratchCardContent";
|
|
10
|
+
import { Image, Text, View } from "react-native";
|
|
11
|
+
|
|
12
|
+
const MyComponent = () => {
|
|
13
|
+
const handleRevealed = () => {
|
|
14
|
+
// Handle card fully revealed action
|
|
15
|
+
console.log("Scratch card revealed!");
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
return (
|
|
19
|
+
<View style={{ width: 300, height: 200 }}>
|
|
20
|
+
<ScratchCard
|
|
21
|
+
image={require("@/assets/images/scratch_foreground.png")}
|
|
22
|
+
onScratched={handleRevealed}
|
|
23
|
+
brushStrokeWidth={40}
|
|
24
|
+
revealThreshold={0.7}
|
|
25
|
+
>
|
|
26
|
+
<ScratchCardContent>
|
|
27
|
+
<Image
|
|
28
|
+
source={require("@/assets/images/reward-banner.png")}
|
|
29
|
+
style={{ width: 250, height: 150 }}
|
|
30
|
+
/>
|
|
31
|
+
</ScratchCardContent>
|
|
32
|
+
</ScratchCard>
|
|
33
|
+
</View>
|
|
34
|
+
);
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export default MyComponent;
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Text-Based Example
|
|
41
|
+
|
|
42
|
+
```tsx
|
|
43
|
+
<ScratchCard
|
|
44
|
+
backgroundColor="#8A2BE2"
|
|
45
|
+
text="Scratch to reveal your prize!"
|
|
46
|
+
textFontColor="#FFFFFF"
|
|
47
|
+
textFontSize={18}
|
|
48
|
+
width={300}
|
|
49
|
+
height={150}
|
|
50
|
+
onScratched={() => alert("Congratulations! You won a prize!")}
|
|
51
|
+
>
|
|
52
|
+
<ScratchCardContent style={{ backgroundColor: "#FFD700" }}>
|
|
53
|
+
<Text style={{ fontSize: 24, fontWeight: "bold", color: "#000" }}>
|
|
54
|
+
50% OFF COUPON
|
|
55
|
+
</Text>
|
|
56
|
+
<Text style={{ marginTop: 8, color: "#333" }}>
|
|
57
|
+
Use code: SCRATCH50
|
|
58
|
+
</Text>
|
|
59
|
+
</ScratchCardContent>
|
|
60
|
+
</ScratchCard>
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### Props
|
|
64
|
+
|
|
65
|
+
#### Core Props
|
|
66
|
+
|
|
67
|
+
| Prop | Type | Default | Description |
|
|
68
|
+
|------|------|---------|-------------|
|
|
69
|
+
| `style` | `StyleProp<ViewStyle>` | `undefined` | Additional styles for the container |
|
|
70
|
+
| `children` | `React.ReactNode` | Required | Content to reveal underneath the scratch layer |
|
|
71
|
+
| `image` | `ImageRequireSource` | `null` | Image to use as the scratch layer |
|
|
72
|
+
| `width` | `number` | `300` | Width of the scratch card |
|
|
73
|
+
| `height` | `number` | `300` | Height of the scratch card |
|
|
74
|
+
| `onScratched` | `() => void` | `undefined` | Function to call when scratch threshold is reached |
|
|
75
|
+
|
|
76
|
+
#### Scratch Behavior Props
|
|
77
|
+
|
|
78
|
+
| Prop | Type | Default | Description |
|
|
79
|
+
|------|------|---------|-------------|
|
|
80
|
+
| `brushStrokeWidth` | `number` | `50` | Width of the scratching stroke |
|
|
81
|
+
| `revealThreshold` | `number` | `0.8` | Percentage (0.0-1.0) that needs to be scratched to trigger the reveal |
|
|
82
|
+
|
|
83
|
+
#### Appearance Props
|
|
84
|
+
|
|
85
|
+
| Prop | Type | Default | Description |
|
|
86
|
+
|------|------|---------|-------------|
|
|
87
|
+
| `backgroundColor` | `string` | `"#CCCCCC"` | Background color of the scratch layer (used if no image is provided) |
|
|
88
|
+
| `text` | `string` | `""` | Optional text to display on the scratch layer |
|
|
89
|
+
| `textFont` | `ImageRequireSource` | `undefined` (required if text is present) | Font for the scratch layer text |
|
|
90
|
+
| `textFontColor` | `string` | `"#CCCCCC"` | Color for the scratch layer text |
|
|
91
|
+
| `textFontSize` | `number` | `16` | Font size for the scratch layer text |
|
|
92
|
+
|
|
93
|
+
### ScratchCardContent
|
|
94
|
+
|
|
95
|
+
The `ScratchCardContent` is a companion component that provides styling for the content underneath the scratch layer.
|
|
96
|
+
|
|
97
|
+
#### Usage
|
|
98
|
+
|
|
99
|
+
```tsx
|
|
100
|
+
import ScratchCardContent from "@/components/ScratchCard/ScratchCardContent";
|
|
101
|
+
|
|
102
|
+
<ScratchCardContent style={{ backgroundColor: "#f5f5f5" }}>
|
|
103
|
+
<Text>Your revealed content here</Text>
|
|
104
|
+
</ScratchCardContent>
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
#### Props
|
|
108
|
+
|
|
109
|
+
| Prop | Type | Default | Description |
|
|
110
|
+
|------|------|---------|-------------|
|
|
111
|
+
| `children` | `React.ReactNode` | Required | Content to display underneath the scratch layer |
|
|
112
|
+
| `style` | `StyleProp<ViewStyle>` | `undefined` | Additional styles for the content container |
|
|
113
|
+
|
|
114
|
+
### Related Components
|
|
115
|
+
|
|
116
|
+
- `ScratchCardContent`: Used for styling the revealed content
|
|
117
|
+
- `Image`: Used to display images in the scratch content or as the scratch layer
|
|
118
|
+
- `Text`: Used to display text in both the scratch layer and revealed content
|
|
119
|
+
- `View`: The foundation component for layout structure
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import React, { useRef, useState } from "react";
|
|
4
|
+
import { Canvas, Group, Image, Mask, Path, Rect, Skia, useImage, Text, useFont } from "@shopify/react-native-skia";
|
|
5
|
+
import { View, StyleSheet } from "react-native";
|
|
6
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
|
+
const ScratchCard = ({
|
|
8
|
+
style,
|
|
9
|
+
children,
|
|
10
|
+
image = null,
|
|
11
|
+
brushStrokeWidth = 50,
|
|
12
|
+
revealThreshold = 0.8,
|
|
13
|
+
width = 300,
|
|
14
|
+
height = 300,
|
|
15
|
+
backgroundColor = "#CCCCCC",
|
|
16
|
+
text = "",
|
|
17
|
+
textFont,
|
|
18
|
+
textFontColor = "#CCCCCC",
|
|
19
|
+
textFontSize = 16,
|
|
20
|
+
onScratched
|
|
21
|
+
}) => {
|
|
22
|
+
const img = useImage(image);
|
|
23
|
+
const font = useFont(textFont, textFontSize);
|
|
24
|
+
const [[areaWidth, areaHeight], setSize] = useState([0, 0]);
|
|
25
|
+
const [isScratched, setScratched] = useState(false);
|
|
26
|
+
const [_, setRefresh] = useState(0);
|
|
27
|
+
const path = useRef(Skia.Path.Make());
|
|
28
|
+
const lastKnownY = useRef(null);
|
|
29
|
+
|
|
30
|
+
//Check scratch progress
|
|
31
|
+
const checkScratchProgress = () => {
|
|
32
|
+
const bounds = path.current.getBounds();
|
|
33
|
+
const scratchedArea = bounds.height * bounds.width;
|
|
34
|
+
const totalArea = areaWidth * areaHeight;
|
|
35
|
+
if (scratchedArea / totalArea > revealThreshold && !isScratched) {
|
|
36
|
+
setScratched(true);
|
|
37
|
+
if (onScratched) {
|
|
38
|
+
onScratched();
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
//Handle path movement on canvas
|
|
44
|
+
const handleMove = nativeEvent => {
|
|
45
|
+
let {
|
|
46
|
+
locationX,
|
|
47
|
+
locationY
|
|
48
|
+
} = nativeEvent;
|
|
49
|
+
if (lastKnownY.current != null && nativeEvent.locationY - lastKnownY.current > 50) {
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
path.current.lineTo(locationX, locationY);
|
|
53
|
+
lastKnownY.current = locationY;
|
|
54
|
+
setRefresh(prev => prev + 1);
|
|
55
|
+
checkScratchProgress();
|
|
56
|
+
};
|
|
57
|
+
return /*#__PURE__*/_jsxs(View, {
|
|
58
|
+
onLayout: e => {
|
|
59
|
+
setSize([e.nativeEvent.layout.width, e.nativeEvent.layout.height]);
|
|
60
|
+
},
|
|
61
|
+
style: [styles.container, style, {
|
|
62
|
+
width,
|
|
63
|
+
height
|
|
64
|
+
}],
|
|
65
|
+
children: [/*#__PURE__*/_jsx(View, {
|
|
66
|
+
style: styles.content,
|
|
67
|
+
children: children
|
|
68
|
+
}), !isScratched && /*#__PURE__*/_jsx(Canvas, {
|
|
69
|
+
style: styles.canvas,
|
|
70
|
+
onTouchStart: ({
|
|
71
|
+
nativeEvent
|
|
72
|
+
}) => {
|
|
73
|
+
path.current.moveTo(nativeEvent.locationX, nativeEvent.locationY);
|
|
74
|
+
setRefresh(prev => prev + 1);
|
|
75
|
+
},
|
|
76
|
+
onTouchMove: ({
|
|
77
|
+
nativeEvent
|
|
78
|
+
}) => handleMove(nativeEvent),
|
|
79
|
+
onTouchEnd: () => lastKnownY.current = null,
|
|
80
|
+
children: /*#__PURE__*/_jsx(Mask, {
|
|
81
|
+
mode: "luminance",
|
|
82
|
+
mask: /*#__PURE__*/_jsxs(Group, {
|
|
83
|
+
children: [/*#__PURE__*/_jsx(Rect, {
|
|
84
|
+
x: 0,
|
|
85
|
+
y: 0,
|
|
86
|
+
width: 1000,
|
|
87
|
+
height: 1000,
|
|
88
|
+
color: "white"
|
|
89
|
+
}), /*#__PURE__*/_jsx(Path, {
|
|
90
|
+
path: path.current,
|
|
91
|
+
color: "black",
|
|
92
|
+
style: "stroke",
|
|
93
|
+
strokeJoin: "round",
|
|
94
|
+
strokeCap: "round",
|
|
95
|
+
strokeWidth: brushStrokeWidth
|
|
96
|
+
})]
|
|
97
|
+
}),
|
|
98
|
+
children: img ? /*#__PURE__*/_jsx(Image, {
|
|
99
|
+
image: img,
|
|
100
|
+
fit: "cover",
|
|
101
|
+
x: 0,
|
|
102
|
+
y: 0,
|
|
103
|
+
width: areaWidth,
|
|
104
|
+
height: areaHeight
|
|
105
|
+
}) : /*#__PURE__*/_jsxs(Group, {
|
|
106
|
+
children: [/*#__PURE__*/_jsx(Rect, {
|
|
107
|
+
x: 0,
|
|
108
|
+
y: 0,
|
|
109
|
+
width: areaWidth,
|
|
110
|
+
height: areaHeight,
|
|
111
|
+
color: backgroundColor
|
|
112
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
113
|
+
x: areaWidth / 2 - (font?.measureText(text).width || 0) / 2,
|
|
114
|
+
y: areaHeight / 2 + (font?.measureText(text).height || 0) / 2,
|
|
115
|
+
text: text,
|
|
116
|
+
color: textFontColor,
|
|
117
|
+
font: font
|
|
118
|
+
})]
|
|
119
|
+
})
|
|
120
|
+
})
|
|
121
|
+
})]
|
|
122
|
+
});
|
|
123
|
+
};
|
|
124
|
+
const styles = StyleSheet.create({
|
|
125
|
+
container: {
|
|
126
|
+
position: "relative",
|
|
127
|
+
overflow: "hidden",
|
|
128
|
+
width: "100%",
|
|
129
|
+
height: "100%"
|
|
130
|
+
},
|
|
131
|
+
content: {
|
|
132
|
+
position: "absolute",
|
|
133
|
+
top: 0,
|
|
134
|
+
left: 0,
|
|
135
|
+
width: "100%",
|
|
136
|
+
height: "100%"
|
|
137
|
+
},
|
|
138
|
+
canvas: {
|
|
139
|
+
position: "absolute",
|
|
140
|
+
top: 0,
|
|
141
|
+
left: 0,
|
|
142
|
+
width: "100%",
|
|
143
|
+
height: "100%"
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
export default ScratchCard;
|
|
147
|
+
//# sourceMappingURL=ScratchCard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","useRef","useState","Canvas","Group","Image","Mask","Path","Rect","Skia","useImage","Text","useFont","View","StyleSheet","jsx","_jsx","jsxs","_jsxs","ScratchCard","style","children","image","brushStrokeWidth","revealThreshold","width","height","backgroundColor","text","textFont","textFontColor","textFontSize","onScratched","img","font","areaWidth","areaHeight","setSize","isScratched","setScratched","_","setRefresh","path","Make","lastKnownY","checkScratchProgress","bounds","current","getBounds","scratchedArea","totalArea","handleMove","nativeEvent","locationX","locationY","lineTo","prev","onLayout","e","layout","styles","container","content","canvas","onTouchStart","moveTo","onTouchMove","onTouchEnd","mode","mask","x","y","color","strokeJoin","strokeCap","strokeWidth","fit","measureText","create","position","overflow","top","left"],"sourceRoot":"..\\..\\..\\..\\src","sources":["components/ScratchCard/ScratchCard.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AAC/C,SACEC,MAAM,EACNC,KAAK,EACLC,KAAK,EACLC,IAAI,EACJC,IAAI,EACJC,IAAI,EACJC,IAAI,EAGJC,QAAQ,EACRC,IAAI,EACJC,OAAO,QACF,4BAA4B;AACnC,SAEEC,IAAI,EAEJC,UAAU,QAGL,cAAc;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAkBtB,MAAMC,WAAuC,GAAGA,CAAC;EAC/CC,KAAK;EACLC,QAAQ;EACRC,KAAK,GAAG,IAAI;EACZC,gBAAgB,GAAG,EAAE;EACrBC,eAAe,GAAG,GAAG;EACrBC,KAAK,GAAG,GAAG;EACXC,MAAM,GAAG,GAAG;EACZC,eAAe,GAAG,SAAS;EAC3BC,IAAI,GAAG,EAAE;EACTC,QAAQ;EACRC,aAAa,GAAG,SAAS;EACzBC,YAAY,GAAG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AAM0B,MAAM,GAAG9C,UAAU,CAACgE,MAAM,CAAC;EAC/BjB,SAAS,EAAE;IACTkB,QAAQ,EAAE,UAAU;IACpBC,QAAQ,EAAE,QAAQ;IAClBvD,KAAK,EAAE,MAAM;IACbC,MAAM,EAAE;EACV,CAAC;EACDoC,OAAO,EAAE;IACPiB,QAAQ,EAAE,UAAU;IACpBE,GAAG,EAAE,CAAC;IACNC,IAAI,EAAE,CAAC;IACPzD,KAAK,EAAE,MAAM;IACbC,MAAM,EAAE;EACV,CAAC;EACDqC,MAAM,EAAE;IACNgB,QAAQ,EAAE,UAAU;IACpBE,GAAG,EAAE,CAAC;IACNC,IAAI,EAAE,CAAC;IACPzD,KAAK,EAAE,MAAM;IACbC,MAAM,EAAE;EACV;AACF,CAAC,CAAC;AAEF,eAAeP,WAAW","ignoreList":[]}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { View, StyleSheet } from "react-native";
|
|
4
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
|
+
const ScratchCardContent = ({
|
|
6
|
+
children,
|
|
7
|
+
style
|
|
8
|
+
}) => {
|
|
9
|
+
return /*#__PURE__*/_jsx(View, {
|
|
10
|
+
style: [styles.card, style],
|
|
11
|
+
children: children
|
|
12
|
+
});
|
|
13
|
+
};
|
|
14
|
+
const styles = StyleSheet.create({
|
|
15
|
+
card: {
|
|
16
|
+
backgroundColor: "#ffffff",
|
|
17
|
+
width: "100%",
|
|
18
|
+
height: "100%",
|
|
19
|
+
alignItems: "center",
|
|
20
|
+
justifyContent: "center"
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
export default ScratchCardContent;
|
|
24
|
+
//# sourceMappingURL=ScratchCardContent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["View","StyleSheet","jsx","_jsx","ScratchCardContent","children","style","styles","card","create","backgroundColor","width","height","alignItems","justifyContent"],"sourceRoot":"..\\..\\..\\..\\src","sources":["components/ScratchCard/ScratchCardContent.tsx"],"mappings":";;AAAA,SAA+BA,IAAI,EAAEC,UAAU,QAAQ,cAAc;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAOtE,MAAMC,kBAAqD,GAAGA,CAAC;EAC7DC,QAAQ;EACRC;AACF,CAAC,KAAK;EACJ,oBAAOH,IAAA,CAACH,IAAI;IAACM,KAAK,EAAE,CAACC,MAAM,CAACC,IAAI,EAAEF,KAAK,CAAE;IAAAD,QAAA,EAAEA;EAAQ,CAAO,CAAC;AAC7D,CAAC;AAED,MAAME,MAAM,GAAGN,UAAU,CAACQ,MAAM,CAAC;EAC/BD,IAAI,EAAE;IACJE,eAAe,EAAE,SAAS;IAC1BC,KAAK,EAAE,MAAM;IACbC,MAAM,EAAE,MAAM;IACdC,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE;EAClB;AACF,CAAC,CAAC;AAEF,eAAeV,kBAAkB","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["default","ScratchCard","ScratchCardContent"],"sourceRoot":"..\\..\\..\\..\\src","sources":["components/ScratchCard/index.ts"],"mappings":";;AAAA,SAAQA,OAAO,IAAIC,WAAW,QAAO,kBAAe;AACpD,SAAQD,OAAO,IAAIE,kBAAkB,QAAO,yBAAsB;AAClE,cAAc,kBAAe;AAC7B,cAAc,yBAAsB","ignoreList":[]}
|