@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,397 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @author Naresh Dhamu
|
|
3
|
-
* @lastModified Tue 24 Jun 2025 at 10:15 PM
|
|
4
|
-
**/
|
|
5
|
-
|
|
6
|
-
import React, { memo, useMemo, useCallback } from 'react';
|
|
7
|
-
import {
|
|
8
|
-
StyleSheet,
|
|
9
|
-
View,
|
|
10
|
-
TouchableOpacity,
|
|
11
|
-
FlatList,
|
|
12
|
-
type TextStyle,
|
|
13
|
-
type StyleProp,
|
|
14
|
-
type ViewStyle,
|
|
15
|
-
type ListRenderItem,
|
|
16
|
-
} from 'react-native';
|
|
17
|
-
import { FlatGrid } from 'react-native-super-grid';
|
|
18
|
-
import { scale } from 'react-native-size-matters';
|
|
19
|
-
import { Search } from 'lucide-react-native';
|
|
20
|
-
import SkeletonPlaceholder from 'react-native-skeleton-placeholder';
|
|
21
|
-
|
|
22
|
-
import { useInternalTheme } from '../../../theme/hook/useInternalTheme';
|
|
23
|
-
|
|
24
|
-
import AppHeader from '../../Headers/AppHeader';
|
|
25
|
-
import { Text } from '../../Text';
|
|
26
|
-
import { ThumbnailCard } from '../../Content/Card/components/ThumbnailCard';
|
|
27
|
-
import CardPoster from '../../Content/Card/components/CardPoster';
|
|
28
|
-
import type { ITheme, ThemeOverride } from '../../../theme/themes';
|
|
29
|
-
import { RFValue } from 'react-native-responsive-fontsize';
|
|
30
|
-
import type { IContentData } from '@zezosoft/zezo-ott-api-client';
|
|
31
|
-
|
|
32
|
-
type IWatchLaterItem = {
|
|
33
|
-
_id: string;
|
|
34
|
-
user_id?: string;
|
|
35
|
-
content: IContentData;
|
|
36
|
-
updatedAt?: string;
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
export type WatchLaterProps = {
|
|
40
|
-
data: IWatchLaterItem[];
|
|
41
|
-
isLoading?: boolean;
|
|
42
|
-
title?: string;
|
|
43
|
-
headerComponent?: React.ReactNode;
|
|
44
|
-
onBackPress?: () => void;
|
|
45
|
-
onSearchPress?: () => void;
|
|
46
|
-
showSearchIcon?: boolean;
|
|
47
|
-
itemDimension?: number;
|
|
48
|
-
spacing?: number;
|
|
49
|
-
titleStyle?: StyleProp<TextStyle>;
|
|
50
|
-
listStyle?: StyleProp<ViewStyle>;
|
|
51
|
-
contentContainerStyle?: StyleProp<ViewStyle>;
|
|
52
|
-
theme?: ThemeOverride;
|
|
53
|
-
viewMode?: 'poster' | 'detailed';
|
|
54
|
-
renderItem?: (
|
|
55
|
-
item: IWatchLaterItem,
|
|
56
|
-
index: number
|
|
57
|
-
) => React.ReactElement | null;
|
|
58
|
-
skeletonCount?: number;
|
|
59
|
-
skeletonComponent?: React.ReactElement;
|
|
60
|
-
noDataComponent?: React.ReactNode;
|
|
61
|
-
noDataText?: string;
|
|
62
|
-
onPressItem?: (item: IWatchLaterItem) => void;
|
|
63
|
-
onEndReached?: () => void;
|
|
64
|
-
onEndReachedThreshold?: number;
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
const DefaultSkeleton: React.FC<{
|
|
68
|
-
theme: ITheme;
|
|
69
|
-
viewMode: 'poster' | 'detailed';
|
|
70
|
-
}> = memo(({ theme, viewMode }) => {
|
|
71
|
-
if (viewMode === 'detailed') {
|
|
72
|
-
return (
|
|
73
|
-
<SkeletonPlaceholder
|
|
74
|
-
borderRadius={6}
|
|
75
|
-
highlightColor={theme.colors.skeletonHighlightColor}
|
|
76
|
-
backgroundColor={theme.colors.skeletonBaseColor}
|
|
77
|
-
>
|
|
78
|
-
<View style={styles.detailedItem}>
|
|
79
|
-
<View style={styles.thumbnailWrapper} />
|
|
80
|
-
<View style={[styles.detailedInfo, { justifyContent: 'center' }]}>
|
|
81
|
-
<View
|
|
82
|
-
style={{
|
|
83
|
-
width: '60%',
|
|
84
|
-
height: scale(12),
|
|
85
|
-
marginBottom: scale(6),
|
|
86
|
-
}}
|
|
87
|
-
/>
|
|
88
|
-
<View
|
|
89
|
-
style={{
|
|
90
|
-
width: '90%',
|
|
91
|
-
height: scale(10),
|
|
92
|
-
marginBottom: scale(4),
|
|
93
|
-
}}
|
|
94
|
-
/>
|
|
95
|
-
<View
|
|
96
|
-
style={{
|
|
97
|
-
width: '70%',
|
|
98
|
-
height: scale(10),
|
|
99
|
-
marginBottom: scale(4),
|
|
100
|
-
}}
|
|
101
|
-
/>
|
|
102
|
-
<View
|
|
103
|
-
style={{
|
|
104
|
-
width: '40%',
|
|
105
|
-
height: scale(10),
|
|
106
|
-
marginBottom: scale(4),
|
|
107
|
-
}}
|
|
108
|
-
/>
|
|
109
|
-
<View style={{ width: '30%', height: scale(10) }} />
|
|
110
|
-
</View>
|
|
111
|
-
</View>
|
|
112
|
-
</SkeletonPlaceholder>
|
|
113
|
-
);
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
return (
|
|
117
|
-
<SkeletonPlaceholder
|
|
118
|
-
borderRadius={6}
|
|
119
|
-
highlightColor={theme.colors.skeletonHighlightColor}
|
|
120
|
-
backgroundColor={theme.colors.skeletonBaseColor}
|
|
121
|
-
>
|
|
122
|
-
<View
|
|
123
|
-
style={{ height: scale(140), borderRadius: scale(6), margin: scale(1) }}
|
|
124
|
-
/>
|
|
125
|
-
</SkeletonPlaceholder>
|
|
126
|
-
);
|
|
127
|
-
});
|
|
128
|
-
|
|
129
|
-
DefaultSkeleton.displayName = 'DefaultSkeleton';
|
|
130
|
-
|
|
131
|
-
const WatchLaterComponent: React.FC<WatchLaterProps> = ({
|
|
132
|
-
data = [],
|
|
133
|
-
isLoading = false,
|
|
134
|
-
title = 'Watch Later',
|
|
135
|
-
headerComponent,
|
|
136
|
-
onBackPress,
|
|
137
|
-
onSearchPress = () => {},
|
|
138
|
-
showSearchIcon = true,
|
|
139
|
-
itemDimension = 90,
|
|
140
|
-
spacing = 10,
|
|
141
|
-
listStyle,
|
|
142
|
-
titleStyle,
|
|
143
|
-
contentContainerStyle,
|
|
144
|
-
theme,
|
|
145
|
-
renderItem,
|
|
146
|
-
skeletonCount = 9,
|
|
147
|
-
skeletonComponent,
|
|
148
|
-
noDataComponent,
|
|
149
|
-
noDataText = 'No Watch Later Found',
|
|
150
|
-
onPressItem,
|
|
151
|
-
onEndReached,
|
|
152
|
-
onEndReachedThreshold,
|
|
153
|
-
viewMode = 'poster',
|
|
154
|
-
}) => {
|
|
155
|
-
const { theme: appliedTheme } = useInternalTheme(theme);
|
|
156
|
-
|
|
157
|
-
const listData = useMemo(
|
|
158
|
-
() =>
|
|
159
|
-
isLoading
|
|
160
|
-
? (Array.from({ length: skeletonCount }, (_, i) => ({
|
|
161
|
-
_id: `skeleton-${i}`,
|
|
162
|
-
content: {
|
|
163
|
-
name: '',
|
|
164
|
-
description: '',
|
|
165
|
-
poster: '',
|
|
166
|
-
thumbnail: '',
|
|
167
|
-
},
|
|
168
|
-
})) as any)
|
|
169
|
-
: data,
|
|
170
|
-
[isLoading, skeletonCount, data]
|
|
171
|
-
);
|
|
172
|
-
|
|
173
|
-
const handleItemPress = useCallback(
|
|
174
|
-
(item: IWatchLaterItem) => {
|
|
175
|
-
onPressItem?.(item);
|
|
176
|
-
},
|
|
177
|
-
[onPressItem]
|
|
178
|
-
);
|
|
179
|
-
|
|
180
|
-
const detailedDescStyle = useMemo(
|
|
181
|
-
() => [styles.detailedDesc, { color: appliedTheme.colors.textSecondary }],
|
|
182
|
-
[appliedTheme.colors.textSecondary]
|
|
183
|
-
);
|
|
184
|
-
|
|
185
|
-
const renderGridItem: ListRenderItem<IWatchLaterItem> = useCallback(
|
|
186
|
-
({ item, index }) => {
|
|
187
|
-
if (isLoading) {
|
|
188
|
-
return (
|
|
189
|
-
skeletonComponent ?? (
|
|
190
|
-
<DefaultSkeleton theme={appliedTheme} viewMode={viewMode} />
|
|
191
|
-
)
|
|
192
|
-
);
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
if (renderItem) return renderItem(item, index);
|
|
196
|
-
|
|
197
|
-
if (viewMode === 'detailed') {
|
|
198
|
-
return (
|
|
199
|
-
<TouchableOpacity
|
|
200
|
-
key={item._id}
|
|
201
|
-
onPress={() => handleItemPress(item)}
|
|
202
|
-
activeOpacity={0.8}
|
|
203
|
-
style={styles.detailedItem}
|
|
204
|
-
>
|
|
205
|
-
<View style={styles.thumbnailWrapper}>
|
|
206
|
-
<ThumbnailCard
|
|
207
|
-
theme={appliedTheme}
|
|
208
|
-
isLoading={false}
|
|
209
|
-
thumbnailUri={item?.content?.thumbnail}
|
|
210
|
-
wrapperStyle={styles.thumbnailImage}
|
|
211
|
-
/>
|
|
212
|
-
</View>
|
|
213
|
-
<View style={styles.detailedInfo}>
|
|
214
|
-
<Text
|
|
215
|
-
theme={theme}
|
|
216
|
-
numberOfLines={1}
|
|
217
|
-
style={styles.detailedTitle}
|
|
218
|
-
>
|
|
219
|
-
{item?.content?.name}
|
|
220
|
-
</Text>
|
|
221
|
-
<Text theme={theme} numberOfLines={5} style={detailedDescStyle}>
|
|
222
|
-
{item?.content?.description}
|
|
223
|
-
</Text>
|
|
224
|
-
</View>
|
|
225
|
-
</TouchableOpacity>
|
|
226
|
-
);
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
return (
|
|
230
|
-
<TouchableOpacity
|
|
231
|
-
key={item._id || index}
|
|
232
|
-
onPress={() => handleItemPress(item)}
|
|
233
|
-
activeOpacity={0.8}
|
|
234
|
-
>
|
|
235
|
-
<CardPoster
|
|
236
|
-
content_offering_type={item?.content?.content_offering_type}
|
|
237
|
-
contentType={item?.content?.type}
|
|
238
|
-
theme={appliedTheme}
|
|
239
|
-
isLoading={isLoading}
|
|
240
|
-
posterUri={item?.content?.poster}
|
|
241
|
-
/>
|
|
242
|
-
</TouchableOpacity>
|
|
243
|
-
);
|
|
244
|
-
},
|
|
245
|
-
[
|
|
246
|
-
isLoading,
|
|
247
|
-
skeletonComponent,
|
|
248
|
-
appliedTheme,
|
|
249
|
-
viewMode,
|
|
250
|
-
renderItem,
|
|
251
|
-
handleItemPress,
|
|
252
|
-
theme,
|
|
253
|
-
detailedDescStyle,
|
|
254
|
-
]
|
|
255
|
-
);
|
|
256
|
-
|
|
257
|
-
const keyExtractor = useCallback(
|
|
258
|
-
(item: IWatchLaterItem, index: number) => item._id || `item-${index}`,
|
|
259
|
-
[]
|
|
260
|
-
);
|
|
261
|
-
|
|
262
|
-
const contentContainerStyleMemo = useMemo(
|
|
263
|
-
() => [styles.contentContainerFlatStyle, contentContainerStyle],
|
|
264
|
-
[contentContainerStyle]
|
|
265
|
-
);
|
|
266
|
-
|
|
267
|
-
const titleStyleMemo = useMemo(
|
|
268
|
-
() => ({
|
|
269
|
-
...(titleStyle ? StyleSheet.flatten(titleStyle) : {}),
|
|
270
|
-
color: appliedTheme.colors.onBackground,
|
|
271
|
-
}),
|
|
272
|
-
[titleStyle, appliedTheme.colors.onBackground]
|
|
273
|
-
);
|
|
274
|
-
|
|
275
|
-
return (
|
|
276
|
-
<View style={styles.container}>
|
|
277
|
-
{React.isValidElement(headerComponent) ? (
|
|
278
|
-
headerComponent
|
|
279
|
-
) : (
|
|
280
|
-
<AppHeader
|
|
281
|
-
onBackPress={onBackPress}
|
|
282
|
-
title={title}
|
|
283
|
-
titleAlign="left"
|
|
284
|
-
theme={theme}
|
|
285
|
-
titleStyle={titleStyleMemo}
|
|
286
|
-
onRightPress={onSearchPress}
|
|
287
|
-
rightIcon={
|
|
288
|
-
showSearchIcon ? (
|
|
289
|
-
<Search
|
|
290
|
-
size={scale(23)}
|
|
291
|
-
color={appliedTheme.colors.onBackground}
|
|
292
|
-
/>
|
|
293
|
-
) : undefined
|
|
294
|
-
}
|
|
295
|
-
/>
|
|
296
|
-
)}
|
|
297
|
-
|
|
298
|
-
{isLoading || data.length > 0 ? (
|
|
299
|
-
viewMode === 'poster' ? (
|
|
300
|
-
<FlatGrid
|
|
301
|
-
itemDimension={itemDimension}
|
|
302
|
-
spacing={spacing}
|
|
303
|
-
data={listData}
|
|
304
|
-
keyExtractor={keyExtractor}
|
|
305
|
-
style={listStyle}
|
|
306
|
-
showsVerticalScrollIndicator={false}
|
|
307
|
-
contentContainerStyle={contentContainerStyleMemo}
|
|
308
|
-
renderItem={renderGridItem}
|
|
309
|
-
onEndReached={onEndReached}
|
|
310
|
-
onEndReachedThreshold={onEndReachedThreshold ?? 0.5}
|
|
311
|
-
/>
|
|
312
|
-
) : (
|
|
313
|
-
<FlatList
|
|
314
|
-
data={listData}
|
|
315
|
-
keyExtractor={keyExtractor}
|
|
316
|
-
renderItem={renderGridItem}
|
|
317
|
-
style={listStyle}
|
|
318
|
-
contentContainerStyle={contentContainerStyleMemo}
|
|
319
|
-
onEndReached={onEndReached}
|
|
320
|
-
onEndReachedThreshold={onEndReachedThreshold ?? 0.5}
|
|
321
|
-
showsVerticalScrollIndicator={false}
|
|
322
|
-
/>
|
|
323
|
-
)
|
|
324
|
-
) : noDataComponent ? (
|
|
325
|
-
<>{noDataComponent}</>
|
|
326
|
-
) : (
|
|
327
|
-
<View style={styles.noData}>
|
|
328
|
-
<Text style={styles.noDataText}>{noDataText}</Text>
|
|
329
|
-
</View>
|
|
330
|
-
)}
|
|
331
|
-
</View>
|
|
332
|
-
);
|
|
333
|
-
};
|
|
334
|
-
|
|
335
|
-
export const WatchLater = memo(WatchLaterComponent);
|
|
336
|
-
|
|
337
|
-
const styles = StyleSheet.create({
|
|
338
|
-
container: {
|
|
339
|
-
flex: 1,
|
|
340
|
-
},
|
|
341
|
-
noData: {
|
|
342
|
-
flex: 1,
|
|
343
|
-
alignItems: 'center',
|
|
344
|
-
justifyContent: 'center',
|
|
345
|
-
},
|
|
346
|
-
noDataText: {
|
|
347
|
-
fontSize: RFValue(13),
|
|
348
|
-
opacity: 0.5,
|
|
349
|
-
},
|
|
350
|
-
contentContainerFlatStyle: {
|
|
351
|
-
paddingBottom: scale(50),
|
|
352
|
-
},
|
|
353
|
-
thumbnailWrapper: {
|
|
354
|
-
width: scale(150),
|
|
355
|
-
aspectRatio: 16 / 9,
|
|
356
|
-
borderRadius: scale(6),
|
|
357
|
-
overflow: 'hidden',
|
|
358
|
-
backgroundColor: '#222',
|
|
359
|
-
alignSelf: 'stretch',
|
|
360
|
-
},
|
|
361
|
-
thumbnailImage: {
|
|
362
|
-
width: '100%',
|
|
363
|
-
height: '100%',
|
|
364
|
-
borderRadius: 0,
|
|
365
|
-
},
|
|
366
|
-
detailedItem: {
|
|
367
|
-
flexDirection: 'row',
|
|
368
|
-
marginVertical: scale(6),
|
|
369
|
-
paddingHorizontal: scale(10),
|
|
370
|
-
alignItems: 'flex-start',
|
|
371
|
-
},
|
|
372
|
-
detailedPoster: {
|
|
373
|
-
width: scale(80),
|
|
374
|
-
height: scale(120),
|
|
375
|
-
borderRadius: scale(6),
|
|
376
|
-
},
|
|
377
|
-
detailedInfo: {
|
|
378
|
-
flex: 1,
|
|
379
|
-
marginLeft: scale(5),
|
|
380
|
-
},
|
|
381
|
-
detailedTitle: {
|
|
382
|
-
fontSize: RFValue(11),
|
|
383
|
-
fontWeight: '500',
|
|
384
|
-
},
|
|
385
|
-
detailedDesc: {
|
|
386
|
-
fontSize: RFValue(9),
|
|
387
|
-
textAlign: 'auto',
|
|
388
|
-
fontWeight: '400',
|
|
389
|
-
marginTop: scale(1),
|
|
390
|
-
},
|
|
391
|
-
});
|
|
392
|
-
|
|
393
|
-
export namespace WatchLater {
|
|
394
|
-
export type Props = WatchLaterProps;
|
|
395
|
-
export type Data = Props['data'];
|
|
396
|
-
export type Item = Props['data'][number];
|
|
397
|
-
}
|
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @author Naresh Dhamu
|
|
3
|
-
* @lastModified Fri 17 Oct 2025 at 10:16 PM
|
|
4
|
-
*/
|
|
5
|
-
import React, { useState, memo, useMemo, useCallback } from 'react';
|
|
6
|
-
import { Image, StyleSheet, View } from 'react-native';
|
|
7
|
-
import SkeletonPlaceholder from 'react-native-skeleton-placeholder';
|
|
8
|
-
import { scale } from 'react-native-size-matters';
|
|
9
|
-
import { useInternalTheme } from '../../../theme/hook/useInternalTheme';
|
|
10
|
-
import type { ThemeOverride } from '../../../theme/themes';
|
|
11
|
-
|
|
12
|
-
const fallbackAvatar = require('../../../assets/img/profile.jpg');
|
|
13
|
-
|
|
14
|
-
type UserAvatarProps = {
|
|
15
|
-
avatarUri?: string;
|
|
16
|
-
size?: number;
|
|
17
|
-
theme?: ThemeOverride;
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
const UserAvatarComponent: React.FC<UserAvatarProps> = ({
|
|
21
|
-
avatarUri,
|
|
22
|
-
size = scale(80),
|
|
23
|
-
theme,
|
|
24
|
-
}) => {
|
|
25
|
-
const { theme: appliedTheme } = useInternalTheme(theme);
|
|
26
|
-
const [imageError, setImageError] = useState(false);
|
|
27
|
-
const [loading, setLoading] = useState(!!avatarUri);
|
|
28
|
-
|
|
29
|
-
// Memoize colors
|
|
30
|
-
const borderColor = useMemo(
|
|
31
|
-
() => appliedTheme.colors.primary || '#ccc',
|
|
32
|
-
[appliedTheme.colors.primary]
|
|
33
|
-
);
|
|
34
|
-
|
|
35
|
-
const skeletonBaseColor = useMemo(
|
|
36
|
-
() => appliedTheme.colors.skeletonBaseColor || '#E0E0E0',
|
|
37
|
-
[appliedTheme.colors.skeletonBaseColor]
|
|
38
|
-
);
|
|
39
|
-
|
|
40
|
-
const skeletonHighlightColor = useMemo(
|
|
41
|
-
() => appliedTheme.colors.skeletonHighlightColor || '#F5F5F5',
|
|
42
|
-
[appliedTheme.colors.skeletonHighlightColor]
|
|
43
|
-
);
|
|
44
|
-
|
|
45
|
-
// Memoize handlers
|
|
46
|
-
const handleError = useCallback(() => {
|
|
47
|
-
setImageError(true);
|
|
48
|
-
setLoading(false);
|
|
49
|
-
}, []);
|
|
50
|
-
|
|
51
|
-
const handleLoadStart = useCallback(() => {
|
|
52
|
-
setLoading(true);
|
|
53
|
-
}, []);
|
|
54
|
-
|
|
55
|
-
const handleLoadEnd = useCallback(() => {
|
|
56
|
-
setLoading(false);
|
|
57
|
-
}, []);
|
|
58
|
-
|
|
59
|
-
// Memoize image source
|
|
60
|
-
const imageSource = useMemo(
|
|
61
|
-
() => (imageError || !avatarUri ? fallbackAvatar : { uri: avatarUri }),
|
|
62
|
-
[imageError, avatarUri]
|
|
63
|
-
);
|
|
64
|
-
|
|
65
|
-
// Memoize styles
|
|
66
|
-
const avatarStyles = useMemo(() => styles(size), [size]);
|
|
67
|
-
const avatarImageStyle = useMemo(
|
|
68
|
-
() => [avatarStyles.avatar, { borderColor, position: 'absolute' as const }],
|
|
69
|
-
[avatarStyles.avatar, borderColor]
|
|
70
|
-
);
|
|
71
|
-
|
|
72
|
-
// Memoize skeleton borderRadius
|
|
73
|
-
const skeletonBorderRadius = useMemo(() => size / 2, [size]);
|
|
74
|
-
|
|
75
|
-
return (
|
|
76
|
-
<View style={avatarStyles.wrapper}>
|
|
77
|
-
{loading && (
|
|
78
|
-
<SkeletonPlaceholder
|
|
79
|
-
backgroundColor={skeletonBaseColor}
|
|
80
|
-
highlightColor={skeletonHighlightColor}
|
|
81
|
-
borderRadius={skeletonBorderRadius}
|
|
82
|
-
>
|
|
83
|
-
<SkeletonPlaceholder.Item
|
|
84
|
-
width={size}
|
|
85
|
-
height={size}
|
|
86
|
-
borderRadius={skeletonBorderRadius}
|
|
87
|
-
/>
|
|
88
|
-
</SkeletonPlaceholder>
|
|
89
|
-
)}
|
|
90
|
-
|
|
91
|
-
<Image
|
|
92
|
-
source={imageSource}
|
|
93
|
-
style={avatarImageStyle}
|
|
94
|
-
onError={handleError}
|
|
95
|
-
onLoadStart={handleLoadStart}
|
|
96
|
-
onLoadEnd={handleLoadEnd}
|
|
97
|
-
/>
|
|
98
|
-
</View>
|
|
99
|
-
);
|
|
100
|
-
};
|
|
101
|
-
|
|
102
|
-
const UserAvatar = memo(UserAvatarComponent);
|
|
103
|
-
export default UserAvatar;
|
|
104
|
-
|
|
105
|
-
const styles = (size: number) =>
|
|
106
|
-
StyleSheet.create({
|
|
107
|
-
wrapper: {
|
|
108
|
-
width: size,
|
|
109
|
-
height: size,
|
|
110
|
-
position: 'relative',
|
|
111
|
-
justifyContent: 'center',
|
|
112
|
-
alignItems: 'center',
|
|
113
|
-
},
|
|
114
|
-
avatar: {
|
|
115
|
-
width: size,
|
|
116
|
-
height: size,
|
|
117
|
-
borderRadius: size / 2,
|
|
118
|
-
borderWidth: scale(1.5),
|
|
119
|
-
},
|
|
120
|
-
});
|