@zezosoft/zezo-ott-react-native-ui-kit 1.3.6 → 1.3.7
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 +40 -36
- package/package.json +1 -3
- package/src/assets/animations/135037-payment-processing-error.json +0 -1347
- package/src/assets/animations/7227-vui-animation.json +0 -3377
- package/src/assets/animations/Failed.json +0 -2103
- package/src/assets/animations/Pending.json +0 -522
- package/src/assets/animations/Successful.json +0 -2289
- package/src/assets/animations/heart.json +0 -788
- package/src/assets/animations/succesfull-payment.json +0 -2379
- package/src/assets/animations/voice-icon.json +0 -542
- package/src/assets/img/back.png +0 -0
- package/src/assets/img/bottom-panel.png +0 -0
- package/src/assets/img/camera.png +0 -0
- package/src/assets/img/camera2.png +0 -0
- package/src/assets/img/home.png +0 -0
- package/src/assets/img/lock.png +0 -0
- package/src/assets/img/play.png +0 -0
- package/src/assets/img/profile.jpg +0 -0
- package/src/assets/img/qr-code.png +0 -0
- package/src/assets/img/shadow.png +0 -0
- package/src/assets/img/shadow2.png +0 -0
- package/src/assets/img/user.png +0 -0
- package/src/assets/svg/Account.svg +0 -4
- package/src/assets/svg/Favourite.svg +0 -14
- package/src/assets/svg/Upcoming.svg +0 -4
- package/src/assets/svg/content-error.svg +0 -28
- package/src/assets/svg/download.svg +0 -3
- package/src/assets/svg/eye-off.svg +0 -10
- package/src/assets/svg/favorites.svg +0 -3
- package/src/assets/svg/h.svg +0 -4
- package/src/assets/svg/home.svg +0 -5
- package/src/assets/svg/home1.svg +0 -3
- package/src/assets/svg/menu-bar.svg +0 -4
- package/src/assets/svg/my-space.svg +0 -14
- package/src/assets/svg/play-icon-with-bg.svg +0 -5
- package/src/assets/svg/profile.svg +0 -4
- package/src/assets/svg/search.svg +0 -5
- package/src/assets/svg/search1.svg +0 -4
- package/src/assets/svg/server-error.svg +0 -139
- package/src/components/Account/Account.tsx +0 -354
- package/src/components/Account/index.ts +0 -6
- package/src/components/Alert/AlertDialog.tsx +0 -253
- package/src/components/Alert/UAAlert.tsx +0 -176
- package/src/components/Alert/index.ts +0 -7
- package/src/components/Auth/AuthProvider/AuthProvider.tsx +0 -412
- package/src/components/Auth/One/ForgotPassword/ForgotPassword.tsx +0 -333
- package/src/components/Auth/One/Login/LoginWithEmail.tsx +0 -449
- package/src/components/Auth/One/Login/LoginWithPhone.tsx +0 -309
- package/src/components/Auth/One/OTP/OTP.tsx +0 -539
- package/src/components/Auth/One/QrLogin/QrLogin.tsx +0 -329
- package/src/components/Auth/One/QrLogin/components/index.ts +0 -8
- package/src/components/Auth/One/QrLogin/components/qr-scanner-fallback.tsx +0 -158
- package/src/components/Auth/One/QrLogin/components/qr-scanner-frame.tsx +0 -207
- package/src/components/Auth/One/QrLogin/components/qr-scanner-header.tsx +0 -65
- package/src/components/Auth/One/QrLogin/components/qr-scanner-intro.tsx +0 -255
- package/src/components/Auth/One/QrLogin/components/qr-scanner-overlay.tsx +0 -291
- package/src/components/Auth/One/SignUp/SignUp.tsx +0 -470
- package/src/components/Auth/One/SplashScreen/SplashScreen.tsx +0 -229
- package/src/components/Auth/One/SplashScreen/components/SplashImage/SplashImage.tsx +0 -92
- package/src/components/Auth/One/SplashScreen/components/SplashLottie/SplashLottie.tsx +0 -129
- package/src/components/Auth/One/SplashScreen/components/SplashVideo/SplashVideo.tsx +0 -172
- package/src/components/Auth/One/SplashScreen/utils/splashUtils.ts +0 -23
- package/src/components/Auth/One/index.ts +0 -24
- package/src/components/Auth/Two/AuthHeader/AuthHeader.tsx +0 -130
- package/src/components/Auth/Two/ForgotPassword/ForgotPassword.tsx +0 -331
- package/src/components/Auth/Two/Login/EmailOrPhoneLogin.tsx +0 -612
- package/src/components/Auth/Two/OTP/OTP.tsx +0 -504
- package/src/components/Auth/Two/SignUp/SignUp.tsx +0 -439
- package/src/components/Auth/Two/index.ts +0 -20
- package/src/components/Auth/index.ts +0 -16
- package/src/components/BackgroundLayout/One/One.tsx +0 -184
- package/src/components/BackgroundLayout/Two/Two.tsx +0 -65
- package/src/components/BackgroundLayout/index.ts +0 -14
- package/src/components/BlogView/BlogView.tsx +0 -282
- package/src/components/BlogView/index.ts +0 -8
- package/src/components/BlurView/BlurView.tsx +0 -199
- package/src/components/BlurView/index.ts +0 -7
- package/src/components/BottomSheet/BottomSheet.tsx +0 -204
- package/src/components/BottomSheet/BottomSheetOne.tsx +0 -223
- package/src/components/BottomSheet/index.ts +0 -9
- package/src/components/Button/BackBtn.tsx +0 -149
- package/src/components/Button/MenuBtn.tsx +0 -220
- package/src/components/Button/PrimaryBtn.tsx +0 -123
- package/src/components/Button/SecondaryBtn.tsx +0 -123
- package/src/components/Button/TextButton.tsx +0 -150
- package/src/components/Button/index.ts +0 -18
- package/src/components/Button/types.ts +0 -33
- package/src/components/Content/Card/Category/Category.tsx +0 -436
- package/src/components/Content/Card/Category/CategroyTwo.tsx +0 -429
- package/src/components/Content/Card/NowWatching/NowWatching.tsx +0 -607
- package/src/components/Content/Card/Sliders/Styles/One.tsx +0 -490
- package/src/components/Content/Card/Sliders/Styles/Three.tsx +0 -1017
- package/src/components/Content/Card/Sliders/Styles/Two.tsx +0 -395
- package/src/components/Content/Card/Sliders/index.ts +0 -18
- package/src/components/Content/Card/Styles/Five.tsx +0 -367
- package/src/components/Content/Card/Styles/Four.tsx +0 -366
- package/src/components/Content/Card/Styles/One.tsx +0 -372
- package/src/components/Content/Card/Styles/RotateInOut.tsx +0 -413
- package/src/components/Content/Card/Styles/Six.tsx +0 -378
- package/src/components/Content/Card/Styles/Three.tsx +0 -312
- package/src/components/Content/Card/Styles/TopTen.tsx +0 -402
- package/src/components/Content/Card/Styles/Two.tsx +0 -404
- package/src/components/Content/Card/components/AdsPoster.tsx +0 -207
- package/src/components/Content/Card/components/CardPoster.tsx +0 -377
- package/src/components/Content/Card/components/LiveBadge.tsx +0 -125
- package/src/components/Content/Card/components/NavigateToMore.tsx +0 -97
- package/src/components/Content/Card/components/RentOrBuyIcon.tsx +0 -134
- package/src/components/Content/Card/components/ShowAllButton.tsx +0 -92
- package/src/components/Content/Card/components/ThumbnailCard.tsx +0 -219
- package/src/components/Content/Card/components/index.ts +0 -12
- package/src/components/Content/Card/index.ts +0 -31
- package/src/components/Content/Content.tsx +0 -338
- package/src/components/Content/Sections.tsx +0 -239
- package/src/components/Content/types.ts +0 -180
- package/src/components/ContentView/MoreContentList.tsx +0 -330
- package/src/components/ContentView/One/ContentViewOne.tsx +0 -251
- package/src/components/ContentView/One/components/CastCard.tsx +0 -266
- package/src/components/ContentView/One/components/HeroBanner.tsx +0 -413
- package/src/components/ContentView/One/components/MiniInfo.tsx +0 -343
- package/src/components/ContentView/One/components/Title.tsx +0 -149
- package/src/components/ContentView/Two/ContentViewTwo.tsx +0 -332
- package/src/components/ContentView/Two/components/Details.tsx +0 -196
- package/src/components/ContentView/Two/components/HeroBanner.tsx +0 -267
- package/src/components/ContentView/Two/components/LikeShareActions.tsx +0 -125
- package/src/components/ContentView/Two/components/MoreLikeThisContentList .tsx +0 -308
- package/src/components/ContentView/Two/components/PlayOrTrailer.tsx +0 -162
- package/src/components/ContentView/Two/components/SectionTabs.tsx +0 -181
- package/src/components/ContentView/Two/components/Title.tsx +0 -229
- package/src/components/ContentView/Two/components/index.ts +0 -12
- package/src/components/ContentView/index.ts +0 -13
- package/src/components/ContentView/shared/AboutSection.tsx +0 -226
- package/src/components/ContentView/shared/EpisodeCard.tsx +0 -600
- package/src/components/ContentView/shared/GenreTags.tsx +0 -189
- package/src/components/ContentView/shared/PlayButton.tsx +0 -52
- package/src/components/ContentView/shared/TrailerButton.tsx +0 -76
- package/src/components/Fallbacks/NoContentFallback.tsx +0 -175
- package/src/components/Fallbacks/NotFoundFallback.tsx +0 -94
- package/src/components/Fallbacks/index.ts +0 -7
- package/src/components/Headers/AppHeader.tsx +0 -151
- package/src/components/Headers/Four.tsx +0 -84
- package/src/components/Headers/One.tsx +0 -115
- package/src/components/Headers/Three.tsx +0 -137
- package/src/components/Headers/Two.tsx +0 -101
- package/src/components/Headers/index.ts +0 -34
- package/src/components/Input/Input.ts +0 -18
- package/src/components/Input/InputOne.tsx +0 -265
- package/src/components/Input/InputThree.tsx +0 -205
- package/src/components/Input/InputTwo.tsx +0 -217
- package/src/components/Input/PhoneInput/One/One.tsx +0 -415
- package/src/components/Input/PhoneInput/Two/Two.tsx +0 -406
- package/src/components/Input/PhoneInput/index.ts +0 -14
- package/src/components/Keyboard/HideKeyboard.tsx +0 -91
- package/src/components/Loader/Loader.tsx +0 -49
- package/src/components/Logo/Logo.tsx +0 -150
- package/src/components/NewRelease/NewReleaseSheet.tsx +0 -260
- package/src/components/NewRelease/index.ts +0 -6
- package/src/components/Reels/ReelsSeries/MediaControls/BottomControls.tsx +0 -226
- package/src/components/Reels/ReelsSeries/MediaControls/MediaControlsProvider.tsx +0 -324
- package/src/components/Reels/ReelsSeries/MediaControls/MiddleControls.tsx +0 -201
- package/src/components/Reels/ReelsSeries/MediaControls/RightControls.tsx +0 -100
- package/src/components/Reels/ReelsSeries/MediaControls/TopControls.tsx +0 -168
- package/src/components/Reels/ReelsSeries/Model/DetailsModal.tsx +0 -207
- package/src/components/Reels/ReelsSeries/Model/SettingModal.tsx +0 -151
- package/src/components/Reels/ReelsSeries/Model/UnlockModal.tsx +0 -159
- package/src/components/Reels/ReelsSeries/ReelsSeries.tsx +0 -278
- package/src/components/Reels/ReelsSeries/ReelsSeriesItem.tsx +0 -569
- package/src/components/Reels/ReelsSeries/components/AnimatedThreeLines.tsx +0 -189
- package/src/components/Reels/ReelsSeries/components/Episodes.tsx +0 -159
- package/src/components/Reels/ReelsSeries/components/GradientOverlay.tsx +0 -46
- package/src/components/Reels/ReelsSeries/components/Like.tsx +0 -45
- package/src/components/Reels/ReelsSeries/components/RotatingLoader.tsx +0 -84
- package/src/components/Reels/ReelsSeries/components/Synopsis.tsx +0 -338
- package/src/components/Reels/ReelsSeries/components/VideoControls/QualityControl.tsx +0 -185
- package/src/components/Reels/ReelsSeries/components/VideoControls/SpeedControl.tsx +0 -77
- package/src/components/Reels/ReelsSeries/components/VideoControls/index.ts +0 -7
- package/src/components/Reels/ReelsSeries/types.ts +0 -78
- package/src/components/Reels/ReelsSeries/useReelsWatchProgress.ts +0 -90
- package/src/components/Reels/ReelsSeries/utils/quality.ts +0 -72
- package/src/components/Reels/index.ts +0 -9
- package/src/components/Reels/utils/Controls/gestureUtils.ts +0 -46
- package/src/components/Reels/utils/Controls/index.ts +0 -9
- package/src/components/Reels/utils/Controls/overlayUtils.ts +0 -40
- package/src/components/Reels/utils/Controls/videoControlsConstants.ts +0 -30
- package/src/components/Reels/utils/Controls/videoRef.ts +0 -9
- package/src/components/Reels/utils/index.ts +0 -6
- package/src/components/Reels/utils/timeoutUtils.ts +0 -34
- package/src/components/Search/One.tsx +0 -262
- package/src/components/Search/components/RecentSearchesSection.tsx +0 -181
- package/src/components/Search/components/SearchCard.tsx +0 -285
- package/src/components/Search/index.ts +0 -16
- package/src/components/Settings/AppSettings.tsx +0 -442
- package/src/components/Settings/index.ts +0 -6
- package/src/components/Subscription/SubOne.tsx +0 -423
- package/src/components/Subscription/components/SubsDetailsModal.tsx +0 -347
- package/src/components/Subscription/components/SubscriptionCard.tsx +0 -342
- package/src/components/Subscription/index.ts +0 -12
- package/src/components/TabBar/One.tsx +0 -145
- package/src/components/TabBar/Three.tsx +0 -162
- package/src/components/TabBar/Two.tsx +0 -179
- package/src/components/TabBar/index.ts +0 -20
- package/src/components/Text/Text.tsx +0 -90
- package/src/components/Text/index.ts +0 -6
- package/src/components/User/DeviceSessions/DeviceSessions.tsx +0 -468
- package/src/components/User/ProfileUpdate/ProfileUpdate.tsx +0 -293
- package/src/components/User/PurchaseHistory/PurchaseHistory.tsx +0 -504
- package/src/components/User/WatchHistory/WatchHistory.tsx +0 -214
- package/src/components/User/WatchLater/WatchLater.tsx +0 -400
- package/src/components/User/components/UserAvatar.tsx +0 -121
- package/src/components/User/components/UserSection.tsx +0 -218
- package/src/components/User/index.ts +0 -18
- package/src/components/View/View.tsx +0 -38
- package/src/components/View/index.ts +0 -6
- package/src/components/common/AppStatusBar.tsx +0 -57
- package/src/components/common/index.ts +0 -1
- package/src/components/index.ts +0 -30
- package/src/components/layout/SafeAreaWrapper.tsx +0 -50
- package/src/components/layout/index.ts +0 -6
- package/src/constants/dummySections.ts +0 -103
- package/src/hooks/Images/index.ts +0 -6
- package/src/hooks/Images/useImageLoader.ts +0 -209
- package/src/hooks/index.ts +0 -16
- package/src/hooks/useAdTracking.ts +0 -354
- package/src/hooks/useCards.ts +0 -247
- package/src/hooks/useDebounce.ts +0 -40
- package/src/hooks/useKeyboard.ts +0 -43
- package/src/hooks/useNavigationMode.ts +0 -48
- package/src/hooks/usePaginatedSection.ts +0 -108
- package/src/hooks/usePrevious.ts +0 -28
- package/src/hooks/useSafeCallback.ts +0 -29
- package/src/hooks/useSkeletonItems.ts +0 -30
- package/src/hooks/useSplashCache.ts +0 -245
- package/src/index.tsx +0 -9
- package/src/store/RecentSearchesStore.ts +0 -72
- package/src/store/splashStore.ts +0 -86
- package/src/store/storage.ts +0 -29
- package/src/theme/ThemeContext.ts +0 -19
- package/src/theme/ThemeProvider.tsx +0 -87
- package/src/theme/hooks/index.ts +0 -6
- package/src/theme/hooks/useTheme.ts +0 -118
- package/src/theme/index.ts +0 -8
- package/src/theme/store/theme.ts +0 -50
- package/src/theme/themes.ts +0 -262
- package/src/theme/utils/cleanColors.ts +0 -71
- package/src/theme/utils/toRgba.ts +0 -150
- package/src/types/content/content-view.types.ts +0 -209
- package/src/types/hook/index.ts +0 -6
- package/src/types/hook/usePaginatedSection.ts +0 -20
- package/src/types/index.ts +0 -10
- package/src/types/navigation.ts +0 -17
- package/src/types/sections/index.ts +0 -87
- package/src/types/user.ts +0 -18
- package/src/utils/Display.ts +0 -15
- package/src/utils/Formater.ts +0 -33
- package/src/utils/SizeMatters.ts +0 -8
- package/src/utils/Spacing.ts +0 -27
- package/src/utils/colorUtils.ts +0 -70
- package/src/utils/imageValidation.ts +0 -36
- package/src/utils/interaction.ts +0 -19
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { View, Text, StyleSheet } from 'react-native';
|
|
3
|
-
import { RFValue } from 'react-native-responsive-fontsize';
|
|
4
|
-
import { verticalScale } from 'react-native-size-matters';
|
|
5
|
-
|
|
6
|
-
import { useTheme } from '../../../../../theme';
|
|
7
|
-
|
|
8
|
-
type Props = {
|
|
9
|
-
title?: string;
|
|
10
|
-
description?: string;
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
const QrScannerHeader: React.FC<Props> = ({
|
|
14
|
-
title = 'Scan QR Code',
|
|
15
|
-
description = 'Hold steady to scan',
|
|
16
|
-
}) => {
|
|
17
|
-
const { theme } = useTheme();
|
|
18
|
-
const { colors } = theme;
|
|
19
|
-
|
|
20
|
-
return (
|
|
21
|
-
<View style={styles.container}>
|
|
22
|
-
<Text
|
|
23
|
-
style={[
|
|
24
|
-
styles.title,
|
|
25
|
-
{
|
|
26
|
-
color: colors.white,
|
|
27
|
-
},
|
|
28
|
-
]}
|
|
29
|
-
>
|
|
30
|
-
{title}
|
|
31
|
-
</Text>
|
|
32
|
-
|
|
33
|
-
<Text
|
|
34
|
-
style={[
|
|
35
|
-
styles.description,
|
|
36
|
-
{
|
|
37
|
-
color: colors.white,
|
|
38
|
-
},
|
|
39
|
-
]}
|
|
40
|
-
>
|
|
41
|
-
{description}
|
|
42
|
-
</Text>
|
|
43
|
-
</View>
|
|
44
|
-
);
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
export default QrScannerHeader;
|
|
48
|
-
|
|
49
|
-
const styles = StyleSheet.create({
|
|
50
|
-
container: {
|
|
51
|
-
alignItems: 'center',
|
|
52
|
-
marginTop: verticalScale(10),
|
|
53
|
-
},
|
|
54
|
-
|
|
55
|
-
title: {
|
|
56
|
-
fontSize: RFValue(15),
|
|
57
|
-
fontWeight: '700',
|
|
58
|
-
marginBottom: verticalScale(6),
|
|
59
|
-
},
|
|
60
|
-
|
|
61
|
-
description: {
|
|
62
|
-
fontSize: RFValue(11),
|
|
63
|
-
opacity: 0.8,
|
|
64
|
-
},
|
|
65
|
-
});
|
|
@@ -1,255 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { View, StyleSheet, ActivityIndicator } from 'react-native';
|
|
3
|
-
import { Camera as CameraIcon, QrCode } from 'lucide-react-native';
|
|
4
|
-
import { RFValue } from 'react-native-responsive-fontsize';
|
|
5
|
-
import { moderateScale, scale, verticalScale } from 'react-native-size-matters';
|
|
6
|
-
|
|
7
|
-
import { Button } from '../../../../Button';
|
|
8
|
-
import { Text } from '../../../../Text';
|
|
9
|
-
import { useTheme } from '../../../../../theme';
|
|
10
|
-
import { toRgba } from '../../../../../theme/utils/toRgba';
|
|
11
|
-
|
|
12
|
-
type Props = {
|
|
13
|
-
title?: string;
|
|
14
|
-
description?: string;
|
|
15
|
-
scanButtonText?: string;
|
|
16
|
-
loading?: boolean;
|
|
17
|
-
onPress?: () => void;
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
const QrScannerIntro: React.FC<Props> = ({
|
|
21
|
-
title = 'Scan QR to Sign In',
|
|
22
|
-
description = 'Open your TV app, go to Settings → Scan QR and point the code at your camera',
|
|
23
|
-
scanButtonText = 'Open Scanner',
|
|
24
|
-
loading = false,
|
|
25
|
-
onPress,
|
|
26
|
-
}) => {
|
|
27
|
-
const { theme } = useTheme();
|
|
28
|
-
const { colors } = theme;
|
|
29
|
-
|
|
30
|
-
return (
|
|
31
|
-
<View style={styles.container}>
|
|
32
|
-
<View
|
|
33
|
-
style={[
|
|
34
|
-
styles.iconWrapper,
|
|
35
|
-
{
|
|
36
|
-
backgroundColor: toRgba(colors.primary, 0.1),
|
|
37
|
-
},
|
|
38
|
-
]}
|
|
39
|
-
>
|
|
40
|
-
<CameraIcon size={scale(34)} color={colors.primary} strokeWidth={2.4} />
|
|
41
|
-
</View>
|
|
42
|
-
|
|
43
|
-
<Text
|
|
44
|
-
style={[
|
|
45
|
-
styles.title,
|
|
46
|
-
{
|
|
47
|
-
color: colors.textPrimary,
|
|
48
|
-
},
|
|
49
|
-
]}
|
|
50
|
-
>
|
|
51
|
-
{title}
|
|
52
|
-
</Text>
|
|
53
|
-
|
|
54
|
-
<Text
|
|
55
|
-
style={[
|
|
56
|
-
styles.description,
|
|
57
|
-
{
|
|
58
|
-
color: toRgba(colors.textPrimary, 0.65),
|
|
59
|
-
},
|
|
60
|
-
]}
|
|
61
|
-
>
|
|
62
|
-
{description}
|
|
63
|
-
</Text>
|
|
64
|
-
|
|
65
|
-
<View
|
|
66
|
-
style={[
|
|
67
|
-
styles.heroCard,
|
|
68
|
-
{
|
|
69
|
-
backgroundColor: colors.surface,
|
|
70
|
-
borderColor: toRgba(colors.primary, 0.1),
|
|
71
|
-
shadowColor: colors.primary,
|
|
72
|
-
},
|
|
73
|
-
]}
|
|
74
|
-
>
|
|
75
|
-
<View
|
|
76
|
-
style={[
|
|
77
|
-
styles.scannerBox,
|
|
78
|
-
{
|
|
79
|
-
borderColor: toRgba(colors.primary, 0.2),
|
|
80
|
-
},
|
|
81
|
-
]}
|
|
82
|
-
>
|
|
83
|
-
<View
|
|
84
|
-
style={[
|
|
85
|
-
styles.corner,
|
|
86
|
-
styles.cornerTL,
|
|
87
|
-
{ borderColor: colors.primary },
|
|
88
|
-
]}
|
|
89
|
-
/>
|
|
90
|
-
<View
|
|
91
|
-
style={[
|
|
92
|
-
styles.corner,
|
|
93
|
-
styles.cornerTR,
|
|
94
|
-
{ borderColor: colors.primary },
|
|
95
|
-
]}
|
|
96
|
-
/>
|
|
97
|
-
<View
|
|
98
|
-
style={[
|
|
99
|
-
styles.corner,
|
|
100
|
-
styles.cornerBL,
|
|
101
|
-
{ borderColor: colors.primary },
|
|
102
|
-
]}
|
|
103
|
-
/>
|
|
104
|
-
<View
|
|
105
|
-
style={[
|
|
106
|
-
styles.corner,
|
|
107
|
-
styles.cornerBR,
|
|
108
|
-
{ borderColor: colors.primary },
|
|
109
|
-
]}
|
|
110
|
-
/>
|
|
111
|
-
|
|
112
|
-
<QrCode
|
|
113
|
-
size={moderateScale(190)}
|
|
114
|
-
color={toRgba(colors.primary, 0.85)}
|
|
115
|
-
strokeWidth={1.6}
|
|
116
|
-
/>
|
|
117
|
-
</View>
|
|
118
|
-
</View>
|
|
119
|
-
|
|
120
|
-
{loading ? (
|
|
121
|
-
<ActivityIndicator color={colors.primary} style={styles.loader} />
|
|
122
|
-
) : (
|
|
123
|
-
<Button.Primary
|
|
124
|
-
title={scanButtonText}
|
|
125
|
-
onPress={onPress}
|
|
126
|
-
disabled={loading}
|
|
127
|
-
leftIcon={
|
|
128
|
-
<CameraIcon
|
|
129
|
-
size={scale(14)}
|
|
130
|
-
color={colors.buttonText}
|
|
131
|
-
strokeWidth={2.3}
|
|
132
|
-
/>
|
|
133
|
-
}
|
|
134
|
-
containerStyle={styles.button}
|
|
135
|
-
titleStyle={styles.buttonText}
|
|
136
|
-
/>
|
|
137
|
-
)}
|
|
138
|
-
</View>
|
|
139
|
-
);
|
|
140
|
-
};
|
|
141
|
-
|
|
142
|
-
export default QrScannerIntro;
|
|
143
|
-
|
|
144
|
-
const styles = StyleSheet.create({
|
|
145
|
-
container: {
|
|
146
|
-
flex: 1,
|
|
147
|
-
justifyContent: 'center',
|
|
148
|
-
alignItems: 'center',
|
|
149
|
-
paddingHorizontal: '6%',
|
|
150
|
-
paddingBottom: '22%',
|
|
151
|
-
},
|
|
152
|
-
|
|
153
|
-
iconWrapper: {
|
|
154
|
-
width: moderateScale(72),
|
|
155
|
-
height: moderateScale(72),
|
|
156
|
-
borderRadius: 999,
|
|
157
|
-
justifyContent: 'center',
|
|
158
|
-
alignItems: 'center',
|
|
159
|
-
marginBottom: verticalScale(16),
|
|
160
|
-
},
|
|
161
|
-
|
|
162
|
-
title: {
|
|
163
|
-
fontSize: RFValue(20),
|
|
164
|
-
lineHeight: RFValue(26),
|
|
165
|
-
fontWeight: '700',
|
|
166
|
-
letterSpacing: 0.3,
|
|
167
|
-
textAlign: 'center',
|
|
168
|
-
marginBottom: verticalScale(8),
|
|
169
|
-
},
|
|
170
|
-
|
|
171
|
-
description: {
|
|
172
|
-
fontSize: RFValue(12),
|
|
173
|
-
lineHeight: RFValue(18),
|
|
174
|
-
textAlign: 'center',
|
|
175
|
-
width: '82%',
|
|
176
|
-
marginBottom: verticalScale(24),
|
|
177
|
-
},
|
|
178
|
-
|
|
179
|
-
heroCard: {
|
|
180
|
-
width: '72%',
|
|
181
|
-
alignItems: 'center',
|
|
182
|
-
justifyContent: 'center',
|
|
183
|
-
borderWidth: 1,
|
|
184
|
-
borderRadius: moderateScale(24),
|
|
185
|
-
padding: scale(16),
|
|
186
|
-
marginBottom: verticalScale(28),
|
|
187
|
-
shadowOffset: { width: 0, height: 8 },
|
|
188
|
-
shadowOpacity: 0.07,
|
|
189
|
-
shadowRadius: 16,
|
|
190
|
-
elevation: 4,
|
|
191
|
-
},
|
|
192
|
-
|
|
193
|
-
scannerBox: {
|
|
194
|
-
width: '100%',
|
|
195
|
-
aspectRatio: 1,
|
|
196
|
-
borderRadius: moderateScale(18),
|
|
197
|
-
borderWidth: 1.5,
|
|
198
|
-
justifyContent: 'center',
|
|
199
|
-
alignItems: 'center',
|
|
200
|
-
backgroundColor: 'transparent',
|
|
201
|
-
},
|
|
202
|
-
|
|
203
|
-
corner: {
|
|
204
|
-
position: 'absolute',
|
|
205
|
-
width: '20%',
|
|
206
|
-
aspectRatio: 1,
|
|
207
|
-
},
|
|
208
|
-
|
|
209
|
-
cornerTL: {
|
|
210
|
-
top: 0,
|
|
211
|
-
left: 0,
|
|
212
|
-
borderTopWidth: 3,
|
|
213
|
-
borderLeftWidth: 3,
|
|
214
|
-
borderTopLeftRadius: moderateScale(16),
|
|
215
|
-
},
|
|
216
|
-
|
|
217
|
-
cornerTR: {
|
|
218
|
-
top: 0,
|
|
219
|
-
right: 0,
|
|
220
|
-
borderTopWidth: 3,
|
|
221
|
-
borderRightWidth: 3,
|
|
222
|
-
borderTopRightRadius: moderateScale(16),
|
|
223
|
-
},
|
|
224
|
-
|
|
225
|
-
cornerBL: {
|
|
226
|
-
bottom: 0,
|
|
227
|
-
left: 0,
|
|
228
|
-
borderBottomWidth: 3,
|
|
229
|
-
borderLeftWidth: 3,
|
|
230
|
-
borderBottomLeftRadius: moderateScale(16),
|
|
231
|
-
},
|
|
232
|
-
|
|
233
|
-
cornerBR: {
|
|
234
|
-
bottom: 0,
|
|
235
|
-
right: 0,
|
|
236
|
-
borderBottomWidth: 3,
|
|
237
|
-
borderRightWidth: 3,
|
|
238
|
-
borderBottomRightRadius: moderateScale(16),
|
|
239
|
-
},
|
|
240
|
-
|
|
241
|
-
button: {
|
|
242
|
-
width: '55%',
|
|
243
|
-
alignSelf: 'center',
|
|
244
|
-
minHeight: verticalScale(38),
|
|
245
|
-
paddingVertical: verticalScale(8),
|
|
246
|
-
},
|
|
247
|
-
|
|
248
|
-
buttonText: {
|
|
249
|
-
fontSize: RFValue(12),
|
|
250
|
-
},
|
|
251
|
-
|
|
252
|
-
loader: {
|
|
253
|
-
marginTop: verticalScale(8),
|
|
254
|
-
},
|
|
255
|
-
});
|
|
@@ -1,291 +0,0 @@
|
|
|
1
|
-
import React, { useState, useCallback, useMemo } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
StyleSheet,
|
|
4
|
-
View,
|
|
5
|
-
ActivityIndicator,
|
|
6
|
-
Text,
|
|
7
|
-
useWindowDimensions,
|
|
8
|
-
} from 'react-native';
|
|
9
|
-
import type { LayoutChangeEvent } from 'react-native';
|
|
10
|
-
import Animated, {
|
|
11
|
-
useAnimatedStyle,
|
|
12
|
-
useSharedValue,
|
|
13
|
-
withTiming,
|
|
14
|
-
Easing,
|
|
15
|
-
} from 'react-native-reanimated';
|
|
16
|
-
import {
|
|
17
|
-
Canvas,
|
|
18
|
-
Path,
|
|
19
|
-
Skia,
|
|
20
|
-
rect,
|
|
21
|
-
rrect,
|
|
22
|
-
FillType,
|
|
23
|
-
RoundedRect,
|
|
24
|
-
} from '@shopify/react-native-skia';
|
|
25
|
-
import { moderateScale, scale, verticalScale } from 'react-native-size-matters';
|
|
26
|
-
import { RFValue } from 'react-native-responsive-fontsize';
|
|
27
|
-
import { CheckCircle2, AlertTriangle } from 'lucide-react-native';
|
|
28
|
-
|
|
29
|
-
import { useTheme } from '../../../../../theme';
|
|
30
|
-
import { toRgba } from '../../../../../theme/utils/toRgba';
|
|
31
|
-
|
|
32
|
-
const SCANNER_SIZE = moderateScale(260);
|
|
33
|
-
const BORDER_RADIUS = moderateScale(28);
|
|
34
|
-
const BORDER_WIDTH = moderateScale(3);
|
|
35
|
-
|
|
36
|
-
type Props = {
|
|
37
|
-
header?: React.ReactNode;
|
|
38
|
-
scanner?: React.ReactNode;
|
|
39
|
-
footer?: React.ReactNode;
|
|
40
|
-
isProcessing?: boolean;
|
|
41
|
-
opacity?: number;
|
|
42
|
-
containerHeight?: number;
|
|
43
|
-
status?: 'idle' | 'loading' | 'success' | 'error';
|
|
44
|
-
statusMessage?: string;
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
const QrScannerOverlay: React.FC<Props> = ({
|
|
48
|
-
header,
|
|
49
|
-
scanner,
|
|
50
|
-
footer,
|
|
51
|
-
isProcessing = false,
|
|
52
|
-
opacity = 0.82,
|
|
53
|
-
containerHeight,
|
|
54
|
-
status = 'idle',
|
|
55
|
-
statusMessage,
|
|
56
|
-
}) => {
|
|
57
|
-
const { width: windowWidth, height: windowHeight } = useWindowDimensions();
|
|
58
|
-
const [layout, setLayout] = useState<{
|
|
59
|
-
width: number;
|
|
60
|
-
height: number;
|
|
61
|
-
} | null>(null);
|
|
62
|
-
|
|
63
|
-
const { theme } = useTheme();
|
|
64
|
-
const { colors } = theme;
|
|
65
|
-
|
|
66
|
-
const mountOpacity = useSharedValue(0);
|
|
67
|
-
|
|
68
|
-
React.useEffect(() => {
|
|
69
|
-
mountOpacity.value = withTiming(1, {
|
|
70
|
-
duration: 250,
|
|
71
|
-
easing: Easing.out(Easing.ease),
|
|
72
|
-
});
|
|
73
|
-
}, [mountOpacity]);
|
|
74
|
-
|
|
75
|
-
const animatedStyle = useAnimatedStyle(() => ({
|
|
76
|
-
opacity: mountOpacity.value,
|
|
77
|
-
flex: 1,
|
|
78
|
-
}));
|
|
79
|
-
|
|
80
|
-
const onLayout = useCallback((event: LayoutChangeEvent) => {
|
|
81
|
-
const { width: w, height: h } = event.nativeEvent.layout;
|
|
82
|
-
setLayout({ width: w, height: h });
|
|
83
|
-
}, []);
|
|
84
|
-
|
|
85
|
-
const width = layout?.width ?? windowWidth;
|
|
86
|
-
const height =
|
|
87
|
-
layout?.height ??
|
|
88
|
-
(containerHeight && containerHeight > 0 ? containerHeight : windowHeight);
|
|
89
|
-
|
|
90
|
-
const overlayColor = toRgba(
|
|
91
|
-
colors.background,
|
|
92
|
-
isProcessing ? Math.min(opacity + 0.1, 0.95) : opacity
|
|
93
|
-
);
|
|
94
|
-
|
|
95
|
-
const scannerX = (width - SCANNER_SIZE) / 2;
|
|
96
|
-
const scannerY = (height - SCANNER_SIZE) / 2;
|
|
97
|
-
|
|
98
|
-
const overlayPath = React.useMemo(() => {
|
|
99
|
-
const path = Skia.Path.Make();
|
|
100
|
-
path.addRect(rect(0, 0, width, height));
|
|
101
|
-
path.addRRect(
|
|
102
|
-
rrect(
|
|
103
|
-
rect(scannerX, scannerY, SCANNER_SIZE, SCANNER_SIZE),
|
|
104
|
-
BORDER_RADIUS,
|
|
105
|
-
BORDER_RADIUS
|
|
106
|
-
)
|
|
107
|
-
);
|
|
108
|
-
path.setFillType(FillType.EvenOdd);
|
|
109
|
-
return path;
|
|
110
|
-
}, [width, height, scannerX, scannerY]);
|
|
111
|
-
|
|
112
|
-
const loadingPillStyle = useMemo(
|
|
113
|
-
() => [
|
|
114
|
-
styles.processingRow,
|
|
115
|
-
{
|
|
116
|
-
backgroundColor: toRgba(colors.surface, 0.92),
|
|
117
|
-
borderColor: toRgba(colors.primary, 0.15),
|
|
118
|
-
},
|
|
119
|
-
],
|
|
120
|
-
[colors.surface, colors.primary]
|
|
121
|
-
);
|
|
122
|
-
|
|
123
|
-
const loadingTextStyle = useMemo(
|
|
124
|
-
() => [styles.processingText, { color: colors.textPrimary }],
|
|
125
|
-
[colors.textPrimary]
|
|
126
|
-
);
|
|
127
|
-
|
|
128
|
-
const successPillStyle = useMemo(
|
|
129
|
-
() => [
|
|
130
|
-
styles.processingRow,
|
|
131
|
-
{
|
|
132
|
-
backgroundColor: toRgba(colors.alert.success, 0.95),
|
|
133
|
-
borderColor: toRgba(colors.alert.success, 0.2),
|
|
134
|
-
},
|
|
135
|
-
],
|
|
136
|
-
[colors.alert.success]
|
|
137
|
-
);
|
|
138
|
-
|
|
139
|
-
const errorPillStyle = useMemo(
|
|
140
|
-
() => [
|
|
141
|
-
styles.processingRow,
|
|
142
|
-
{
|
|
143
|
-
backgroundColor: toRgba(colors.alert.error, 0.95),
|
|
144
|
-
borderColor: toRgba(colors.alert.error, 0.2),
|
|
145
|
-
},
|
|
146
|
-
],
|
|
147
|
-
[colors.alert.error]
|
|
148
|
-
);
|
|
149
|
-
|
|
150
|
-
const scannerPositionStyle = useMemo(
|
|
151
|
-
() => [
|
|
152
|
-
styles.scannerContainer,
|
|
153
|
-
{
|
|
154
|
-
top: scannerY,
|
|
155
|
-
left: scannerX,
|
|
156
|
-
},
|
|
157
|
-
],
|
|
158
|
-
[scannerY, scannerX]
|
|
159
|
-
);
|
|
160
|
-
|
|
161
|
-
const renderStatusPill = () => {
|
|
162
|
-
if (status === 'loading' || isProcessing) {
|
|
163
|
-
return (
|
|
164
|
-
<View style={loadingPillStyle}>
|
|
165
|
-
<ActivityIndicator size="small" color={colors.primary} />
|
|
166
|
-
<Text style={loadingTextStyle}>{statusMessage || 'Signing in…'}</Text>
|
|
167
|
-
</View>
|
|
168
|
-
);
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
if (status === 'success') {
|
|
172
|
-
return (
|
|
173
|
-
<View style={successPillStyle}>
|
|
174
|
-
<CheckCircle2 size={scale(14)} color="#FFFFFF" strokeWidth={2.5} />
|
|
175
|
-
<Text style={[styles.processingText, styles.textWhite]}>
|
|
176
|
-
{statusMessage || 'Login success!'}
|
|
177
|
-
</Text>
|
|
178
|
-
</View>
|
|
179
|
-
);
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
if (status === 'error') {
|
|
183
|
-
return (
|
|
184
|
-
<View style={errorPillStyle}>
|
|
185
|
-
<AlertTriangle size={scale(14)} color="#FFFFFF" strokeWidth={2.5} />
|
|
186
|
-
<Text style={[styles.processingText, styles.textWhite]}>
|
|
187
|
-
{statusMessage || 'Failed to verify.'}
|
|
188
|
-
</Text>
|
|
189
|
-
</View>
|
|
190
|
-
);
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
return footer;
|
|
194
|
-
};
|
|
195
|
-
|
|
196
|
-
return (
|
|
197
|
-
<Animated.View
|
|
198
|
-
style={[styles.container, animatedStyle]}
|
|
199
|
-
onLayout={onLayout}
|
|
200
|
-
>
|
|
201
|
-
<Canvas style={StyleSheet.absoluteFill}>
|
|
202
|
-
<Path path={overlayPath} color={overlayColor} />
|
|
203
|
-
<RoundedRect
|
|
204
|
-
x={scannerX}
|
|
205
|
-
y={scannerY}
|
|
206
|
-
width={SCANNER_SIZE}
|
|
207
|
-
height={SCANNER_SIZE}
|
|
208
|
-
r={BORDER_RADIUS}
|
|
209
|
-
color={
|
|
210
|
-
isProcessing
|
|
211
|
-
? toRgba(colors.primary, 0.5)
|
|
212
|
-
: toRgba(colors.primary, 0.22)
|
|
213
|
-
}
|
|
214
|
-
style="stroke"
|
|
215
|
-
strokeWidth={BORDER_WIDTH}
|
|
216
|
-
/>
|
|
217
|
-
</Canvas>
|
|
218
|
-
|
|
219
|
-
<View style={styles.topContainer}>{header}</View>
|
|
220
|
-
|
|
221
|
-
<View pointerEvents="box-none" style={scannerPositionStyle}>
|
|
222
|
-
{scanner}
|
|
223
|
-
</View>
|
|
224
|
-
|
|
225
|
-
<View style={styles.bottomContainer}>{renderStatusPill()}</View>
|
|
226
|
-
</Animated.View>
|
|
227
|
-
);
|
|
228
|
-
};
|
|
229
|
-
|
|
230
|
-
export default React.memo(QrScannerOverlay);
|
|
231
|
-
|
|
232
|
-
const styles = StyleSheet.create({
|
|
233
|
-
container: {
|
|
234
|
-
...StyleSheet.absoluteFill,
|
|
235
|
-
},
|
|
236
|
-
|
|
237
|
-
topContainer: {
|
|
238
|
-
position: 'absolute',
|
|
239
|
-
top: verticalScale(20),
|
|
240
|
-
left: 0,
|
|
241
|
-
right: 0,
|
|
242
|
-
alignItems: 'center',
|
|
243
|
-
paddingHorizontal: scale(24),
|
|
244
|
-
zIndex: 10,
|
|
245
|
-
},
|
|
246
|
-
|
|
247
|
-
scannerContainer: {
|
|
248
|
-
position: 'absolute',
|
|
249
|
-
width: SCANNER_SIZE,
|
|
250
|
-
height: SCANNER_SIZE,
|
|
251
|
-
justifyContent: 'center',
|
|
252
|
-
alignItems: 'center',
|
|
253
|
-
backgroundColor: 'transparent',
|
|
254
|
-
zIndex: 20,
|
|
255
|
-
},
|
|
256
|
-
|
|
257
|
-
bottomContainer: {
|
|
258
|
-
position: 'absolute',
|
|
259
|
-
bottom: verticalScale(40),
|
|
260
|
-
left: 0,
|
|
261
|
-
right: 0,
|
|
262
|
-
alignItems: 'center',
|
|
263
|
-
paddingHorizontal: scale(24),
|
|
264
|
-
zIndex: 10,
|
|
265
|
-
},
|
|
266
|
-
|
|
267
|
-
processingRow: {
|
|
268
|
-
flexDirection: 'row',
|
|
269
|
-
alignItems: 'center',
|
|
270
|
-
gap: scale(6),
|
|
271
|
-
paddingVertical: verticalScale(5),
|
|
272
|
-
paddingHorizontal: scale(10),
|
|
273
|
-
borderRadius: moderateScale(99),
|
|
274
|
-
borderWidth: 1,
|
|
275
|
-
shadowColor: '#000',
|
|
276
|
-
shadowOffset: { width: 0, height: 4 },
|
|
277
|
-
shadowOpacity: 0.15,
|
|
278
|
-
shadowRadius: 8,
|
|
279
|
-
elevation: 4,
|
|
280
|
-
},
|
|
281
|
-
|
|
282
|
-
processingText: {
|
|
283
|
-
fontSize: RFValue(11),
|
|
284
|
-
fontWeight: '600',
|
|
285
|
-
opacity: 0.95,
|
|
286
|
-
},
|
|
287
|
-
|
|
288
|
-
textWhite: {
|
|
289
|
-
color: '#FFFFFF',
|
|
290
|
-
},
|
|
291
|
-
});
|