@zezosoft/zezo-ott-react-native-ui-kit 1.1.5 → 1.1.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/lib/module/components/Content/Card/Sliders/Styles/Three.js +5 -4
- package/lib/module/components/Content/Card/Sliders/Styles/Three.js.map +1 -1
- package/lib/module/components/Headers/Four.js +1 -1
- package/lib/module/components/Headers/Three.js +2 -1
- package/lib/module/components/Headers/Three.js.map +1 -1
- package/lib/typescript/src/components/Content/Card/Sliders/Styles/Three.d.ts.map +1 -1
- package/package.json +2 -14
- package/src/Styles/globalStyles.ts +0 -70
- 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 -367
- package/src/components/Account/index.ts +0 -1
- package/src/components/Alert/AlertDialog.tsx +0 -247
- package/src/components/Alert/UAAlert.tsx +0 -170
- package/src/components/Alert/index.ts +0 -2
- package/src/components/Auth/AuthProvider/AuthProvider.tsx +0 -419
- package/src/components/Auth/One/ForgotPassword/ForgotPassword.tsx +0 -324
- package/src/components/Auth/One/Login/LoginWithEmail.tsx +0 -455
- package/src/components/Auth/One/Login/LoginWithPhone.tsx +0 -306
- package/src/components/Auth/One/OTP/OTP.tsx +0 -465
- package/src/components/Auth/One/QrLogin/QrLogin.tsx +0 -602
- package/src/components/Auth/One/QrLogin/components/QrViewArea.tsx +0 -423
- package/src/components/Auth/One/SignUp/SignUp.tsx +0 -479
- package/src/components/Auth/One/SplashScreen/SplashScreen.tsx +0 -249
- package/src/components/Auth/One/SplashScreen/components/SplashImage/SplashImage.tsx +0 -103
- package/src/components/Auth/One/SplashScreen/components/SplashLottie/SplashLottie.tsx +0 -77
- package/src/components/Auth/One/SplashScreen/components/SplashVideo/SplashVideo.tsx +0 -174
- package/src/components/Auth/One/index.ts +0 -24
- package/src/components/Auth/Two/AuthHeader/AuthHeader.tsx +0 -108
- package/src/components/Auth/Two/ForgotPassword/ForgotPassword.tsx +0 -335
- package/src/components/Auth/Two/Login/AuthLoginShell.tsx +0 -173
- package/src/components/Auth/Two/Login/LoginWithEmail.tsx +0 -279
- package/src/components/Auth/Two/Login/LoginWithPhone.tsx +0 -188
- package/src/components/Auth/Two/OTP/OTP.tsx +0 -465
- package/src/components/Auth/Two/QrLogin/QrLogin.tsx +0 -602
- package/src/components/Auth/Two/QrLogin/components/QrViewArea.tsx +0 -423
- package/src/components/Auth/Two/SignUp/SignUp.tsx +0 -472
- package/src/components/Auth/Two/SplashScreen/SplashScreen.tsx +0 -248
- package/src/components/Auth/Two/SplashScreen/components/SplashImage/SplashImage.tsx +0 -92
- package/src/components/Auth/Two/SplashScreen/components/SplashLottie/SplashLottie.tsx +0 -77
- package/src/components/Auth/Two/SplashScreen/components/SplashVideo/SplashVideo.tsx +0 -178
- package/src/components/Auth/Two/index.ts +0 -28
- package/src/components/Auth/index.ts +0 -11
- package/src/components/BackgroundLayout/BackgroundLayout.tsx +0 -174
- package/src/components/BackgroundLayout/BackgroundLayoutOne.tsx +0 -56
- package/src/components/BlogView/BlogView.tsx +0 -276
- 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 -200
- package/src/components/BottomSheet/BottomSheetOne.tsx +0 -220
- package/src/components/BottomSheet/index.ts +0 -4
- package/src/components/Button/BackBtn.tsx +0 -168
- package/src/components/Button/MenuBtn.tsx +0 -229
- package/src/components/Button/PrimaryBtn.tsx +0 -134
- package/src/components/Button/SecondaryBtn.tsx +0 -132
- package/src/components/Button/TextButton.tsx +0 -145
- package/src/components/Button/index.ts +0 -18
- 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 -624
- package/src/components/Content/Card/Sliders/Styles/One.tsx +0 -490
- package/src/components/Content/Card/Sliders/Styles/Three.tsx +0 -935
- package/src/components/Content/Card/Sliders/Styles/Two.tsx +0 -391
- package/src/components/Content/Card/Sliders/index.ts +0 -17
- package/src/components/Content/Card/Styles/Five.tsx +0 -385
- package/src/components/Content/Card/Styles/Four.tsx +0 -379
- package/src/components/Content/Card/Styles/One.tsx +0 -386
- package/src/components/Content/Card/Styles/RotateInOut.tsx +0 -413
- package/src/components/Content/Card/Styles/Six.tsx +0 -392
- package/src/components/Content/Card/Styles/Three.tsx +0 -314
- package/src/components/Content/Card/Styles/TopTen.tsx +0 -412
- package/src/components/Content/Card/Styles/Two.tsx +0 -416
- package/src/components/Content/Card/components/AdsPoster.tsx +0 -202
- package/src/components/Content/Card/components/CardPoster.tsx +0 -377
- package/src/components/Content/Card/components/NavigateToMore.tsx +0 -97
- package/src/components/Content/Card/components/RentOrBuyIcon.tsx +0 -129
- package/src/components/Content/Card/components/ShowAllButton.tsx +0 -92
- package/src/components/Content/Card/components/ThumbnailCard.tsx +0 -234
- package/src/components/Content/Card/components/index.ts +0 -1
- package/src/components/Content/Card/index.ts +0 -30
- package/src/components/Content/Content.tsx +0 -315
- package/src/components/Content/Sections.tsx +0 -238
- package/src/components/Content/types.ts +0 -176
- package/src/components/ContentView/MoreContentList.tsx +0 -327
- package/src/components/ContentView/One/ContentViewOne.tsx +0 -243
- package/src/components/ContentView/One/components/AboutSection.tsx +0 -216
- package/src/components/ContentView/One/components/CastCard.tsx +0 -265
- package/src/components/ContentView/One/components/EpisodeCard.tsx +0 -535
- package/src/components/ContentView/One/components/GenreTags.tsx +0 -132
- package/src/components/ContentView/One/components/HeroBanner.tsx +0 -357
- package/src/components/ContentView/One/components/MiniInfo.tsx +0 -356
- package/src/components/ContentView/One/components/PlayButton.tsx +0 -56
- package/src/components/ContentView/One/components/Title.tsx +0 -149
- package/src/components/ContentView/One/components/TrailerButton.tsx +0 -76
- package/src/components/ContentView/Two/ContentViewTwo.tsx +0 -343
- package/src/components/ContentView/Two/components/AboutSection.tsx +0 -216
- package/src/components/ContentView/Two/components/Details.tsx +0 -193
- package/src/components/ContentView/Two/components/EpisodeCard.tsx +0 -602
- package/src/components/ContentView/Two/components/GenreTags.tsx +0 -123
- package/src/components/ContentView/Two/components/HeroBanner.tsx +0 -402
- package/src/components/ContentView/Two/components/LikeShareActions.tsx +0 -125
- package/src/components/ContentView/Two/components/MoreLikeThisContentList .tsx +0 -305
- package/src/components/ContentView/Two/components/PlayOrTrailer.tsx +0 -133
- package/src/components/ContentView/Two/components/SectionTabs.tsx +0 -177
- package/src/components/ContentView/Two/components/Title.tsx +0 -226
- package/src/components/ContentView/Two/components/index.ts +0 -15
- package/src/components/ContentView/index.ts +0 -13
- package/src/components/Fallbacks/NoContentFallback.tsx +0 -176
- package/src/components/Fallbacks/NotFoundFallback.tsx +0 -94
- package/src/components/Fallbacks/index.ts +0 -2
- package/src/components/Headers/AppHeader.tsx +0 -150
- package/src/components/Headers/Four.tsx +0 -83
- package/src/components/Headers/One.tsx +0 -115
- package/src/components/Headers/Three.tsx +0 -135
- package/src/components/Headers/Two.tsx +0 -100
- package/src/components/Headers/index.ts +0 -18
- package/src/components/Input/Input.ts +0 -20
- package/src/components/Input/InputOne.tsx +0 -259
- package/src/components/Input/InputThree.tsx +0 -212
- package/src/components/Input/InputTwo.tsx +0 -212
- package/src/components/Input/PhoneNumberInput.tsx +0 -431
- package/src/components/Input/PhoneNumberInputTwo.tsx +0 -418
- package/src/components/Keyboard/HideKeyboard.tsx +0 -88
- package/src/components/Loader/Loader.tsx +0 -44
- package/src/components/Logo/Logo.tsx +0 -145
- package/src/components/NewRelease/NewReleaseSheet.tsx +0 -250
- package/src/components/NewRelease/index.ts +0 -1
- package/src/components/Reels/ReelsSeries/MediaControls/BottomControls.tsx +0 -221
- package/src/components/Reels/ReelsSeries/MediaControls/MediaControlsProvider.tsx +0 -314
- package/src/components/Reels/ReelsSeries/MediaControls/MiddleControls.tsx +0 -196
- package/src/components/Reels/ReelsSeries/MediaControls/RightControls.tsx +0 -95
- package/src/components/Reels/ReelsSeries/MediaControls/TopControls.tsx +0 -163
- package/src/components/Reels/ReelsSeries/Model/DetailsModal.tsx +0 -210
- package/src/components/Reels/ReelsSeries/Model/SettingModal.tsx +0 -146
- package/src/components/Reels/ReelsSeries/Model/UnlockModal.tsx +0 -154
- package/src/components/Reels/ReelsSeries/ReelsSeries.tsx +0 -264
- package/src/components/Reels/ReelsSeries/ReelsSeriesItem.tsx +0 -494
- package/src/components/Reels/ReelsSeries/components/AnimatedThreeLines.tsx +0 -184
- package/src/components/Reels/ReelsSeries/components/Episodes.tsx +0 -154
- package/src/components/Reels/ReelsSeries/components/GradientOverlay.tsx +0 -41
- package/src/components/Reels/ReelsSeries/components/Like.tsx +0 -40
- package/src/components/Reels/ReelsSeries/components/RotatingLoader.tsx +0 -79
- package/src/components/Reels/ReelsSeries/components/Synopsis.tsx +0 -332
- package/src/components/Reels/ReelsSeries/components/VideoControls/QualityControl.tsx +0 -187
- package/src/components/Reels/ReelsSeries/components/VideoControls/SpeedControl.tsx +0 -80
- package/src/components/Reels/ReelsSeries/components/VideoControls/index.ts +0 -2
- package/src/components/Reels/ReelsSeries/types.ts +0 -54
- package/src/components/Reels/ReelsSeries/useReelsWatchProgress.ts +0 -85
- package/src/components/Reels/ReelsSeries/utils/quality.ts +0 -48
- package/src/components/Reels/index.ts +0 -9
- package/src/components/Reels/utils/Controls/gestureUtils.ts +0 -42
- package/src/components/Reels/utils/Controls/index.ts +0 -4
- package/src/components/Reels/utils/Controls/overlayUtils.ts +0 -35
- package/src/components/Reels/utils/Controls/videoControlsConstants.ts +0 -25
- package/src/components/Reels/utils/Controls/videoRef.ts +0 -4
- package/src/components/Reels/utils/index.ts +0 -1
- package/src/components/Reels/utils/timeoutUtils.ts +0 -29
- package/src/components/Search/One.tsx +0 -256
- package/src/components/Search/components/RecentSearchesSection.tsx +0 -181
- package/src/components/Search/components/SearchCard.tsx +0 -275
- package/src/components/Search/index.ts +0 -16
- package/src/components/Settings/AppSettings.tsx +0 -428
- package/src/components/Settings/index.ts +0 -1
- package/src/components/Subscription/SubOne.tsx +0 -874
- package/src/components/Subscription/index.ts +0 -12
- package/src/components/TabBar/One.tsx +0 -148
- package/src/components/TabBar/Three.tsx +0 -169
- package/src/components/TabBar/Two.tsx +0 -189
- package/src/components/TabBar/index.ts +0 -20
- package/src/components/Text/Text.tsx +0 -85
- package/src/components/Text/index.ts +0 -5
- package/src/components/User/DeviceSessions/DeviceSessions.tsx +0 -468
- package/src/components/User/ProfileUpdate/ProfileUpdate.tsx +0 -278
- package/src/components/User/PurchaseHistory/PurchaseHistory.tsx +0 -494
- package/src/components/User/WatchHistory/WatchHistory.tsx +0 -227
- package/src/components/User/WatchLater/WatchLater.tsx +0 -397
- package/src/components/User/components/UserAvatar.tsx +0 -120
- package/src/components/User/components/UserSection.tsx +0 -228
- package/src/components/User/index.ts +0 -18
- package/src/components/View/View.tsx +0 -37
- package/src/components/View/index.ts +0 -5
- package/src/components/common/AppStatusBar.tsx +0 -57
- package/src/components/index.ts +0 -29
- package/src/components/layout/SafeAreaWrapper.tsx +0 -45
- package/src/components/layout/index.ts +0 -1
- package/src/constants/dummySections.ts +0 -98
- package/src/hooks/Images/index.ts +0 -2
- package/src/hooks/Images/useImageLoader.ts +0 -206
- package/src/hooks/Images/useImageValidation.ts +0 -36
- package/src/hooks/index.ts +0 -17
- package/src/hooks/useAdTracking.ts +0 -349
- package/src/hooks/useCards.ts +0 -228
- package/src/hooks/useDebounce.ts +0 -35
- package/src/hooks/useKeyboard.ts +0 -43
- package/src/hooks/useNavigationMode.ts +0 -46
- package/src/hooks/usePaginatedSection.ts +0 -101
- package/src/hooks/usePrevious.ts +0 -28
- package/src/hooks/useSafeCallback.ts +0 -43
- package/src/hooks/useSkeletonItems.ts +0 -30
- package/src/hooks/useSplashCache.ts +0 -186
- package/src/hooks/useThemeColors.ts +0 -51
- package/src/index.tsx +0 -8
- package/src/store/RecentSearchesStore.ts +0 -78
- package/src/store/splashStore.ts +0 -91
- package/src/store/themeStore.ts +0 -43
- package/src/theme/ThemeProvider.tsx +0 -112
- package/src/theme/hook/index.ts +0 -1
- package/src/theme/hook/useInternalTheme.ts +0 -98
- package/src/theme/index.ts +0 -7
- package/src/theme/themes.ts +0 -336
- package/src/theme/utils/validateColor.ts +0 -127
- package/src/types/content/content-view.types.ts +0 -206
- package/src/types/hook/index.ts +0 -5
- package/src/types/hook/usePaginatedSetion.ts +0 -19
- package/src/types/index.ts +0 -7
- package/src/types/sections/index.ts +0 -84
- package/src/utils/Display.ts +0 -14
- package/src/utils/Formater.ts +0 -14
- package/src/utils/PlatformSelector.ts +0 -29
- package/src/utils/SizeMatters.ts +0 -7
- package/src/utils/Spacing.ts +0 -27
- package/src/utils/colorUtils.ts +0 -70
|
@@ -1,200 +0,0 @@
|
|
|
1
|
-
import React, { useCallback, useMemo } from 'react';
|
|
2
|
-
import type { ReactNode } from 'react';
|
|
3
|
-
import {
|
|
4
|
-
TouchableOpacity,
|
|
5
|
-
StyleSheet,
|
|
6
|
-
View,
|
|
7
|
-
ScrollView,
|
|
8
|
-
Dimensions,
|
|
9
|
-
} from 'react-native';
|
|
10
|
-
import type { ViewStyle } from 'react-native';
|
|
11
|
-
import Modal from 'react-native-modal';
|
|
12
|
-
import { X } from 'lucide-react-native';
|
|
13
|
-
import { moderateScale, verticalScale } from 'react-native-size-matters';
|
|
14
|
-
import { RFValue } from 'react-native-responsive-fontsize';
|
|
15
|
-
import Animated from 'react-native-reanimated';
|
|
16
|
-
import type { ITheme } from '../../theme';
|
|
17
|
-
import { Text } from '../Text';
|
|
18
|
-
|
|
19
|
-
const { height: SCREEN_HEIGHT } = Dimensions.get('window');
|
|
20
|
-
|
|
21
|
-
export interface BottomSheetProps {
|
|
22
|
-
theme: ITheme;
|
|
23
|
-
children: ReactNode;
|
|
24
|
-
title?: string;
|
|
25
|
-
height?: string | number;
|
|
26
|
-
showCloseButton?: boolean;
|
|
27
|
-
visible?: boolean;
|
|
28
|
-
onClose?: () => void;
|
|
29
|
-
handleIndicatorStyle?: ViewStyle;
|
|
30
|
-
scrollable?: boolean;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
const BottomSheet: React.FC<BottomSheetProps> = ({
|
|
34
|
-
theme,
|
|
35
|
-
children,
|
|
36
|
-
title,
|
|
37
|
-
height,
|
|
38
|
-
showCloseButton = true,
|
|
39
|
-
visible = false,
|
|
40
|
-
onClose,
|
|
41
|
-
handleIndicatorStyle,
|
|
42
|
-
scrollable = true,
|
|
43
|
-
}) => {
|
|
44
|
-
const calculatedHeight = useMemo(() => {
|
|
45
|
-
if (!height) return SCREEN_HEIGHT * 0.75;
|
|
46
|
-
|
|
47
|
-
if (typeof height === 'number') return height;
|
|
48
|
-
|
|
49
|
-
if (typeof height === 'string' && height.includes('%')) {
|
|
50
|
-
const num = parseFloat(height);
|
|
51
|
-
if (!isNaN(num)) {
|
|
52
|
-
return (num / 100) * SCREEN_HEIGHT;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
return SCREEN_HEIGHT * 0.75;
|
|
57
|
-
}, [height]);
|
|
58
|
-
|
|
59
|
-
const handleClosePress = useCallback(() => {
|
|
60
|
-
onClose?.();
|
|
61
|
-
}, [onClose]);
|
|
62
|
-
|
|
63
|
-
const renderHeader = useMemo(() => {
|
|
64
|
-
if (title) {
|
|
65
|
-
return (
|
|
66
|
-
<Text style={[styles.title, { color: theme.colors.textPrimary }]}>
|
|
67
|
-
{title}
|
|
68
|
-
</Text>
|
|
69
|
-
);
|
|
70
|
-
}
|
|
71
|
-
return null;
|
|
72
|
-
}, [title, theme.colors.textPrimary]);
|
|
73
|
-
|
|
74
|
-
const renderCloseButton = useMemo(() => {
|
|
75
|
-
if (!showCloseButton) return null;
|
|
76
|
-
return (
|
|
77
|
-
<TouchableOpacity
|
|
78
|
-
onPress={handleClosePress}
|
|
79
|
-
style={[
|
|
80
|
-
styles.closeButtonWrapper,
|
|
81
|
-
{ backgroundColor: theme.colors.button },
|
|
82
|
-
]}
|
|
83
|
-
activeOpacity={0.8}
|
|
84
|
-
>
|
|
85
|
-
<X size={moderateScale(16)} color={theme.colors.buttonText} />
|
|
86
|
-
</TouchableOpacity>
|
|
87
|
-
);
|
|
88
|
-
}, [showCloseButton, handleClosePress, theme.colors]);
|
|
89
|
-
|
|
90
|
-
return (
|
|
91
|
-
<Modal
|
|
92
|
-
isVisible={visible}
|
|
93
|
-
onBackdropPress={handleClosePress}
|
|
94
|
-
onBackButtonPress={handleClosePress}
|
|
95
|
-
onSwipeComplete={handleClosePress}
|
|
96
|
-
style={styles.modal}
|
|
97
|
-
backdropOpacity={0.45}
|
|
98
|
-
swipeDirection="down"
|
|
99
|
-
animationIn="slideInUp"
|
|
100
|
-
animationOut="slideOutDown"
|
|
101
|
-
animationInTiming={260}
|
|
102
|
-
animationOutTiming={220}
|
|
103
|
-
backdropTransitionInTiming={200}
|
|
104
|
-
backdropTransitionOutTiming={180}
|
|
105
|
-
useNativeDriver
|
|
106
|
-
useNativeDriverForBackdrop
|
|
107
|
-
propagateSwipe
|
|
108
|
-
avoidKeyboard
|
|
109
|
-
statusBarTranslucent={false}
|
|
110
|
-
hardwareAccelerated
|
|
111
|
-
hideModalContentWhileAnimating={false}
|
|
112
|
-
deviceHeight={SCREEN_HEIGHT}
|
|
113
|
-
>
|
|
114
|
-
<Animated.View
|
|
115
|
-
style={[
|
|
116
|
-
styles.bottomSheetContainer,
|
|
117
|
-
{
|
|
118
|
-
backgroundColor: theme.colors.background,
|
|
119
|
-
maxHeight: calculatedHeight,
|
|
120
|
-
},
|
|
121
|
-
]}
|
|
122
|
-
>
|
|
123
|
-
{renderCloseButton}
|
|
124
|
-
<View
|
|
125
|
-
style={[
|
|
126
|
-
styles.handleIndicator,
|
|
127
|
-
{ backgroundColor: theme.colors.button },
|
|
128
|
-
handleIndicatorStyle,
|
|
129
|
-
]}
|
|
130
|
-
/>
|
|
131
|
-
|
|
132
|
-
{scrollable ? (
|
|
133
|
-
<ScrollView
|
|
134
|
-
showsVerticalScrollIndicator={false}
|
|
135
|
-
bounces={false}
|
|
136
|
-
nestedScrollEnabled
|
|
137
|
-
keyboardShouldPersistTaps="handled"
|
|
138
|
-
contentContainerStyle={styles.scrollContent}
|
|
139
|
-
>
|
|
140
|
-
{renderHeader}
|
|
141
|
-
{children}
|
|
142
|
-
</ScrollView>
|
|
143
|
-
) : (
|
|
144
|
-
<View style={styles.viewContent}>
|
|
145
|
-
{renderHeader}
|
|
146
|
-
{children}
|
|
147
|
-
</View>
|
|
148
|
-
)}
|
|
149
|
-
</Animated.View>
|
|
150
|
-
</Modal>
|
|
151
|
-
);
|
|
152
|
-
};
|
|
153
|
-
|
|
154
|
-
export default BottomSheet;
|
|
155
|
-
|
|
156
|
-
const styles = StyleSheet.create({
|
|
157
|
-
modal: {
|
|
158
|
-
justifyContent: 'flex-end',
|
|
159
|
-
margin: 0,
|
|
160
|
-
},
|
|
161
|
-
bottomSheetContainer: {
|
|
162
|
-
borderTopLeftRadius: moderateScale(22),
|
|
163
|
-
borderTopRightRadius: moderateScale(22),
|
|
164
|
-
overflow: 'hidden',
|
|
165
|
-
position: 'relative',
|
|
166
|
-
flex: 1,
|
|
167
|
-
},
|
|
168
|
-
handleIndicator: {
|
|
169
|
-
width: moderateScale(45),
|
|
170
|
-
height: verticalScale(4),
|
|
171
|
-
borderRadius: moderateScale(3),
|
|
172
|
-
alignSelf: 'center',
|
|
173
|
-
marginVertical: verticalScale(10),
|
|
174
|
-
},
|
|
175
|
-
scrollContent: {
|
|
176
|
-
flex: 1,
|
|
177
|
-
paddingBottom: verticalScale(30),
|
|
178
|
-
paddingHorizontal: moderateScale(12),
|
|
179
|
-
},
|
|
180
|
-
viewContent: {
|
|
181
|
-
paddingBottom: verticalScale(10),
|
|
182
|
-
paddingHorizontal: moderateScale(12),
|
|
183
|
-
flex: 1,
|
|
184
|
-
},
|
|
185
|
-
closeButtonWrapper: {
|
|
186
|
-
position: 'absolute',
|
|
187
|
-
top: verticalScale(10),
|
|
188
|
-
right: moderateScale(14),
|
|
189
|
-
borderRadius: moderateScale(18),
|
|
190
|
-
padding: moderateScale(6),
|
|
191
|
-
zIndex: 1000,
|
|
192
|
-
elevation: 10,
|
|
193
|
-
},
|
|
194
|
-
title: {
|
|
195
|
-
fontSize: RFValue(16),
|
|
196
|
-
fontWeight: '700',
|
|
197
|
-
textAlign: 'center',
|
|
198
|
-
marginBottom: verticalScale(15),
|
|
199
|
-
},
|
|
200
|
-
});
|
|
@@ -1,220 +0,0 @@
|
|
|
1
|
-
import React, { useCallback, useMemo } from 'react';
|
|
2
|
-
import type { ReactNode } from 'react';
|
|
3
|
-
import {
|
|
4
|
-
TouchableOpacity,
|
|
5
|
-
StyleSheet,
|
|
6
|
-
View,
|
|
7
|
-
ScrollView,
|
|
8
|
-
Dimensions,
|
|
9
|
-
ImageBackground,
|
|
10
|
-
Platform,
|
|
11
|
-
} from 'react-native';
|
|
12
|
-
import type { ViewStyle } from 'react-native';
|
|
13
|
-
import Modal from 'react-native-modal';
|
|
14
|
-
import { X } from 'lucide-react-native';
|
|
15
|
-
import { moderateScale, verticalScale } from 'react-native-size-matters';
|
|
16
|
-
import { RFValue } from 'react-native-responsive-fontsize';
|
|
17
|
-
import Animated from 'react-native-reanimated';
|
|
18
|
-
import type { ITheme } from '../../theme';
|
|
19
|
-
import { Text } from '../Text';
|
|
20
|
-
import FastImage from 'react-native-fast-image';
|
|
21
|
-
|
|
22
|
-
const { height: SCREEN_HEIGHT } = Dimensions.get('window');
|
|
23
|
-
|
|
24
|
-
export interface BottomSheetOneProps {
|
|
25
|
-
theme: ITheme;
|
|
26
|
-
children: ReactNode;
|
|
27
|
-
backgroundImage?: string;
|
|
28
|
-
title?: string;
|
|
29
|
-
height?: string | number;
|
|
30
|
-
showCloseButton?: boolean;
|
|
31
|
-
visible?: boolean;
|
|
32
|
-
onClose?: () => void;
|
|
33
|
-
handleIndicatorStyle?: ViewStyle;
|
|
34
|
-
scrollable?: boolean;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
const BottomSheetOne: React.FC<BottomSheetOneProps> = ({
|
|
38
|
-
theme,
|
|
39
|
-
children,
|
|
40
|
-
title,
|
|
41
|
-
height,
|
|
42
|
-
backgroundImage,
|
|
43
|
-
showCloseButton = true,
|
|
44
|
-
visible = false,
|
|
45
|
-
onClose,
|
|
46
|
-
handleIndicatorStyle,
|
|
47
|
-
scrollable = true,
|
|
48
|
-
}) => {
|
|
49
|
-
const calculatedHeight = useMemo(() => {
|
|
50
|
-
if (!height) return SCREEN_HEIGHT * 0.75;
|
|
51
|
-
|
|
52
|
-
if (typeof height === 'number') return height;
|
|
53
|
-
|
|
54
|
-
if (typeof height === 'string' && height.includes('%')) {
|
|
55
|
-
const num = parseFloat(height);
|
|
56
|
-
if (!isNaN(num)) {
|
|
57
|
-
return (num / 100) * SCREEN_HEIGHT;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
return SCREEN_HEIGHT * 0.75;
|
|
62
|
-
}, [height]);
|
|
63
|
-
|
|
64
|
-
const handleClosePress = useCallback(() => {
|
|
65
|
-
onClose?.();
|
|
66
|
-
}, [onClose]);
|
|
67
|
-
|
|
68
|
-
const renderHeader = useMemo(() => {
|
|
69
|
-
if (title) {
|
|
70
|
-
return (
|
|
71
|
-
<Text style={[styles.title, { color: theme.colors.textPrimary }]}>
|
|
72
|
-
{title}
|
|
73
|
-
</Text>
|
|
74
|
-
);
|
|
75
|
-
}
|
|
76
|
-
return null;
|
|
77
|
-
}, [title, theme.colors.textPrimary]);
|
|
78
|
-
|
|
79
|
-
const renderCloseButton = useMemo(() => {
|
|
80
|
-
if (!showCloseButton) return null;
|
|
81
|
-
return (
|
|
82
|
-
<TouchableOpacity
|
|
83
|
-
onPress={handleClosePress}
|
|
84
|
-
style={[
|
|
85
|
-
styles.closeButtonWrapper,
|
|
86
|
-
{ backgroundColor: theme.colors.black },
|
|
87
|
-
]}
|
|
88
|
-
activeOpacity={0.8}
|
|
89
|
-
>
|
|
90
|
-
<X size={moderateScale(22)} color={theme.colors.white} />
|
|
91
|
-
</TouchableOpacity>
|
|
92
|
-
);
|
|
93
|
-
}, [showCloseButton, handleClosePress, theme.colors]);
|
|
94
|
-
|
|
95
|
-
return (
|
|
96
|
-
<Modal
|
|
97
|
-
isVisible={visible}
|
|
98
|
-
onBackdropPress={handleClosePress}
|
|
99
|
-
onSwipeComplete={handleClosePress}
|
|
100
|
-
style={styles.modal}
|
|
101
|
-
backdropOpacity={0.45}
|
|
102
|
-
// swipeDirection="down"
|
|
103
|
-
animationIn="slideInUp"
|
|
104
|
-
animationOut="slideOutDown"
|
|
105
|
-
animationInTiming={260}
|
|
106
|
-
animationOutTiming={220}
|
|
107
|
-
useNativeDriver
|
|
108
|
-
useNativeDriverForBackdrop
|
|
109
|
-
propagateSwipe
|
|
110
|
-
avoidKeyboard
|
|
111
|
-
statusBarTranslucent={false}
|
|
112
|
-
hardwareAccelerated
|
|
113
|
-
>
|
|
114
|
-
<Animated.View
|
|
115
|
-
style={[
|
|
116
|
-
styles.bottomSheetContainer,
|
|
117
|
-
{
|
|
118
|
-
backgroundColor: theme.colors.background,
|
|
119
|
-
height: calculatedHeight,
|
|
120
|
-
},
|
|
121
|
-
]}
|
|
122
|
-
>
|
|
123
|
-
{backgroundImage && (
|
|
124
|
-
<>
|
|
125
|
-
<ImageBackground
|
|
126
|
-
source={{ uri: backgroundImage }}
|
|
127
|
-
style={[
|
|
128
|
-
StyleSheet.absoluteFillObject,
|
|
129
|
-
{ backgroundColor: theme.colors.background },
|
|
130
|
-
]}
|
|
131
|
-
resizeMode={FastImage.resizeMode.cover}
|
|
132
|
-
blurRadius={Platform.OS === 'ios' ? 15 : 25}
|
|
133
|
-
/>
|
|
134
|
-
<View style={styles.backgroundOverlay} />
|
|
135
|
-
</>
|
|
136
|
-
)}
|
|
137
|
-
|
|
138
|
-
{renderCloseButton}
|
|
139
|
-
|
|
140
|
-
<View
|
|
141
|
-
style={[
|
|
142
|
-
styles.handleIndicator,
|
|
143
|
-
{ backgroundColor: theme.colors.textSecondary },
|
|
144
|
-
handleIndicatorStyle,
|
|
145
|
-
]}
|
|
146
|
-
/>
|
|
147
|
-
|
|
148
|
-
{scrollable ? (
|
|
149
|
-
<ScrollView
|
|
150
|
-
showsVerticalScrollIndicator={false}
|
|
151
|
-
bounces={false}
|
|
152
|
-
nestedScrollEnabled
|
|
153
|
-
keyboardShouldPersistTaps="handled"
|
|
154
|
-
contentContainerStyle={styles.scrollContent}
|
|
155
|
-
>
|
|
156
|
-
{renderHeader}
|
|
157
|
-
{children}
|
|
158
|
-
</ScrollView>
|
|
159
|
-
) : (
|
|
160
|
-
<View style={styles.viewContent}>
|
|
161
|
-
{renderHeader}
|
|
162
|
-
{children}
|
|
163
|
-
</View>
|
|
164
|
-
)}
|
|
165
|
-
</Animated.View>
|
|
166
|
-
</Modal>
|
|
167
|
-
);
|
|
168
|
-
};
|
|
169
|
-
|
|
170
|
-
export default BottomSheetOne;
|
|
171
|
-
|
|
172
|
-
const styles = StyleSheet.create({
|
|
173
|
-
modal: {
|
|
174
|
-
justifyContent: 'flex-end',
|
|
175
|
-
margin: 0,
|
|
176
|
-
},
|
|
177
|
-
bottomSheetContainer: {
|
|
178
|
-
borderTopLeftRadius: moderateScale(22),
|
|
179
|
-
borderTopRightRadius: moderateScale(22),
|
|
180
|
-
overflow: 'hidden',
|
|
181
|
-
position: 'relative',
|
|
182
|
-
},
|
|
183
|
-
backgroundOverlay: {
|
|
184
|
-
...StyleSheet.absoluteFillObject,
|
|
185
|
-
backgroundColor: 'rgba(0,0,0,0.55)',
|
|
186
|
-
},
|
|
187
|
-
|
|
188
|
-
handleIndicator: {
|
|
189
|
-
width: moderateScale(60),
|
|
190
|
-
height: verticalScale(4),
|
|
191
|
-
borderRadius: moderateScale(30),
|
|
192
|
-
alignSelf: 'center',
|
|
193
|
-
marginVertical: verticalScale(10),
|
|
194
|
-
},
|
|
195
|
-
scrollContent: {
|
|
196
|
-
flex: 1,
|
|
197
|
-
paddingBottom: verticalScale(30),
|
|
198
|
-
paddingHorizontal: moderateScale(12),
|
|
199
|
-
},
|
|
200
|
-
viewContent: {
|
|
201
|
-
paddingBottom: verticalScale(10),
|
|
202
|
-
paddingHorizontal: moderateScale(12),
|
|
203
|
-
flex: 1,
|
|
204
|
-
},
|
|
205
|
-
closeButtonWrapper: {
|
|
206
|
-
position: 'absolute',
|
|
207
|
-
top: verticalScale(10),
|
|
208
|
-
right: moderateScale(14),
|
|
209
|
-
borderRadius: moderateScale(30),
|
|
210
|
-
padding: moderateScale(10),
|
|
211
|
-
zIndex: 1000,
|
|
212
|
-
elevation: 10,
|
|
213
|
-
},
|
|
214
|
-
title: {
|
|
215
|
-
fontSize: RFValue(16),
|
|
216
|
-
fontWeight: '700',
|
|
217
|
-
textAlign: 'center',
|
|
218
|
-
marginBottom: verticalScale(15),
|
|
219
|
-
},
|
|
220
|
-
});
|
|
@@ -1,168 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @author Naresh Dhamu
|
|
3
|
-
* @lastModified Wed 02 Jul 2025 at 09:30 AM
|
|
4
|
-
*/
|
|
5
|
-
import React, { useMemo, useCallback } from 'react';
|
|
6
|
-
import {
|
|
7
|
-
TouchableOpacity,
|
|
8
|
-
StyleSheet,
|
|
9
|
-
Alert,
|
|
10
|
-
Platform,
|
|
11
|
-
type ViewStyle,
|
|
12
|
-
type TextStyle,
|
|
13
|
-
type StyleProp,
|
|
14
|
-
} from 'react-native';
|
|
15
|
-
import { ArrowLeft } from 'lucide-react-native';
|
|
16
|
-
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
17
|
-
import { useInternalTheme } from '../../theme/hook/useInternalTheme';
|
|
18
|
-
import { scale, verticalScale } from 'react-native-size-matters';
|
|
19
|
-
import { BlurView } from '@react-native-community/blur';
|
|
20
|
-
import type { ThemeOverride } from '../../theme/themes';
|
|
21
|
-
import { Text } from '../Text';
|
|
22
|
-
|
|
23
|
-
type BackBtnProps = {
|
|
24
|
-
size?: number;
|
|
25
|
-
color?: string;
|
|
26
|
-
onPress?: () => void;
|
|
27
|
-
style?: StyleProp<ViewStyle>;
|
|
28
|
-
theme?: ThemeOverride;
|
|
29
|
-
enableBlur?: boolean;
|
|
30
|
-
label?: string;
|
|
31
|
-
textStyle?: StyleProp<TextStyle>;
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
const BackBtn: React.FC<BackBtnProps> = ({
|
|
35
|
-
size = scale(24),
|
|
36
|
-
color,
|
|
37
|
-
onPress,
|
|
38
|
-
style,
|
|
39
|
-
theme,
|
|
40
|
-
enableBlur = false,
|
|
41
|
-
label,
|
|
42
|
-
textStyle,
|
|
43
|
-
}) => {
|
|
44
|
-
const insets = useSafeAreaInsets();
|
|
45
|
-
const { theme: appliedTheme } = useInternalTheme(theme);
|
|
46
|
-
|
|
47
|
-
const handlePress = useCallback(() => {
|
|
48
|
-
if (onPress) {
|
|
49
|
-
onPress();
|
|
50
|
-
} else {
|
|
51
|
-
Alert.alert(
|
|
52
|
-
'Back Action Not Provided',
|
|
53
|
-
'Please define the back action using onPress prop.'
|
|
54
|
-
);
|
|
55
|
-
}
|
|
56
|
-
}, [onPress]);
|
|
57
|
-
|
|
58
|
-
const flattenedStyle = useMemo(
|
|
59
|
-
() => StyleSheet.flatten(style) || {},
|
|
60
|
-
[style]
|
|
61
|
-
);
|
|
62
|
-
|
|
63
|
-
const hasTopInStyle = useMemo(
|
|
64
|
-
() => style && flattenedStyle.top !== undefined,
|
|
65
|
-
[style, flattenedStyle.top]
|
|
66
|
-
);
|
|
67
|
-
|
|
68
|
-
const calculatedTop = useMemo(
|
|
69
|
-
() =>
|
|
70
|
-
Platform.select({
|
|
71
|
-
ios: insets.top > 20 ? insets.top - verticalScale(5) : insets.top,
|
|
72
|
-
android: insets.top + verticalScale(5),
|
|
73
|
-
default: insets.top,
|
|
74
|
-
}),
|
|
75
|
-
[insets.top]
|
|
76
|
-
);
|
|
77
|
-
|
|
78
|
-
const hasBackground = useMemo(
|
|
79
|
-
() => !!flattenedStyle.backgroundColor,
|
|
80
|
-
[flattenedStyle.backgroundColor]
|
|
81
|
-
);
|
|
82
|
-
|
|
83
|
-
const shouldRenderBlur = useMemo(
|
|
84
|
-
() => enableBlur && hasBackground,
|
|
85
|
-
[enableBlur, hasBackground]
|
|
86
|
-
);
|
|
87
|
-
|
|
88
|
-
const hasLabel = useMemo(() => !!label, [label]);
|
|
89
|
-
|
|
90
|
-
const iconColor = useMemo(
|
|
91
|
-
() => color || appliedTheme.colors.textPrimary,
|
|
92
|
-
[color, appliedTheme.colors.textPrimary]
|
|
93
|
-
);
|
|
94
|
-
|
|
95
|
-
const containerStyle = useMemo(
|
|
96
|
-
() => [
|
|
97
|
-
styles.container,
|
|
98
|
-
hasLabel && styles.containerWithText,
|
|
99
|
-
!hasTopInStyle && { top: calculatedTop },
|
|
100
|
-
style,
|
|
101
|
-
],
|
|
102
|
-
[hasLabel, hasTopInStyle, calculatedTop, style]
|
|
103
|
-
);
|
|
104
|
-
|
|
105
|
-
const textStyleMemo = useMemo(
|
|
106
|
-
() => [styles.text, { color: iconColor }, textStyle],
|
|
107
|
-
[iconColor, textStyle]
|
|
108
|
-
);
|
|
109
|
-
|
|
110
|
-
const blurFallbackColor = useMemo(
|
|
111
|
-
() =>
|
|
112
|
-
(typeof flattenedStyle.backgroundColor === 'string'
|
|
113
|
-
? flattenedStyle.backgroundColor
|
|
114
|
-
: undefined) || String(appliedTheme.colors.backdrop),
|
|
115
|
-
[flattenedStyle.backgroundColor, appliedTheme.colors.backdrop]
|
|
116
|
-
);
|
|
117
|
-
|
|
118
|
-
return (
|
|
119
|
-
<TouchableOpacity
|
|
120
|
-
activeOpacity={0.8}
|
|
121
|
-
style={containerStyle}
|
|
122
|
-
onPress={handlePress}
|
|
123
|
-
>
|
|
124
|
-
{shouldRenderBlur && (
|
|
125
|
-
<BlurView
|
|
126
|
-
style={StyleSheet.absoluteFill}
|
|
127
|
-
blurType="light"
|
|
128
|
-
blurAmount={10}
|
|
129
|
-
reducedTransparencyFallbackColor={blurFallbackColor}
|
|
130
|
-
/>
|
|
131
|
-
)}
|
|
132
|
-
|
|
133
|
-
<ArrowLeft size={size} color={iconColor} />
|
|
134
|
-
{hasLabel && (
|
|
135
|
-
<Text style={textStyleMemo} color={iconColor}>
|
|
136
|
-
{label}
|
|
137
|
-
</Text>
|
|
138
|
-
)}
|
|
139
|
-
</TouchableOpacity>
|
|
140
|
-
);
|
|
141
|
-
};
|
|
142
|
-
|
|
143
|
-
export default React.memo(BackBtn);
|
|
144
|
-
|
|
145
|
-
const styles = StyleSheet.create({
|
|
146
|
-
container: {
|
|
147
|
-
position: 'absolute',
|
|
148
|
-
left: scale(13),
|
|
149
|
-
padding: scale(6),
|
|
150
|
-
borderRadius: scale(100),
|
|
151
|
-
justifyContent: 'center',
|
|
152
|
-
alignItems: 'center',
|
|
153
|
-
overflow: 'hidden',
|
|
154
|
-
},
|
|
155
|
-
containerWithText: {
|
|
156
|
-
flexDirection: 'row',
|
|
157
|
-
borderRadius: scale(20),
|
|
158
|
-
paddingHorizontal: scale(12),
|
|
159
|
-
},
|
|
160
|
-
text: {
|
|
161
|
-
fontSize: scale(14),
|
|
162
|
-
fontWeight: '600',
|
|
163
|
-
marginLeft: scale(8),
|
|
164
|
-
textShadowColor: 'rgba(0, 0, 0, 0.75)',
|
|
165
|
-
textShadowOffset: { width: 0, height: 1 },
|
|
166
|
-
textShadowRadius: 3,
|
|
167
|
-
},
|
|
168
|
-
});
|