@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,494 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @author Naresh Dhamu
|
|
3
|
-
* @lastModified Mon 10 Nov 2025 at 03:35 PM
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import React, { memo, useMemo, useCallback } from 'react';
|
|
7
|
-
import {
|
|
8
|
-
StyleSheet,
|
|
9
|
-
View,
|
|
10
|
-
TouchableOpacity,
|
|
11
|
-
type StyleProp,
|
|
12
|
-
type ViewStyle,
|
|
13
|
-
type ListRenderItem,
|
|
14
|
-
} from 'react-native';
|
|
15
|
-
import { FlatGrid } from 'react-native-super-grid';
|
|
16
|
-
import { scale } from 'react-native-size-matters';
|
|
17
|
-
import LinearGradient from 'react-native-linear-gradient';
|
|
18
|
-
import { Search, Calendar, CheckCircle2, XCircle } from 'lucide-react-native';
|
|
19
|
-
import moment from 'moment';
|
|
20
|
-
import { useInternalTheme } from '../../../theme/hook/useInternalTheme';
|
|
21
|
-
|
|
22
|
-
import AppHeader from '../../Headers/AppHeader';
|
|
23
|
-
import { Text } from '../../Text';
|
|
24
|
-
import CardPoster from '../../Content/Card/components/CardPoster';
|
|
25
|
-
import type { ThemeOverride } from '../../../theme/themes';
|
|
26
|
-
import { RFValue } from 'react-native-responsive-fontsize';
|
|
27
|
-
import type { IContentData } from '@zezosoft/zezo-ott-api-client';
|
|
28
|
-
|
|
29
|
-
export interface IPurchaseHistoryItem {
|
|
30
|
-
_id: string;
|
|
31
|
-
content_id: IContentData;
|
|
32
|
-
user_id: string;
|
|
33
|
-
status: 'valid' | 'expired' | string;
|
|
34
|
-
valid_upto: string;
|
|
35
|
-
price: number;
|
|
36
|
-
tvod_type: 'BUY' | 'RENT';
|
|
37
|
-
content_owner: string;
|
|
38
|
-
createdAt: string;
|
|
39
|
-
updatedAt: string;
|
|
40
|
-
__v: number;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export interface PurchaseHistoryProps {
|
|
44
|
-
data: IPurchaseHistoryItem[];
|
|
45
|
-
isLoading?: boolean;
|
|
46
|
-
|
|
47
|
-
// Header Config
|
|
48
|
-
title?: string;
|
|
49
|
-
headerComponent?: React.ReactNode;
|
|
50
|
-
onBackPress?: () => void;
|
|
51
|
-
onSearchPress?: () => void;
|
|
52
|
-
showSearchIcon?: boolean;
|
|
53
|
-
|
|
54
|
-
// Grid & Layout Customization
|
|
55
|
-
itemDimension?: number;
|
|
56
|
-
spacing?: number;
|
|
57
|
-
listStyle?: StyleProp<ViewStyle>;
|
|
58
|
-
contentContainerStyle?: StyleProp<ViewStyle>;
|
|
59
|
-
|
|
60
|
-
// Theme
|
|
61
|
-
theme?: ThemeOverride;
|
|
62
|
-
|
|
63
|
-
// Rendering Overrides
|
|
64
|
-
renderItem?: (
|
|
65
|
-
item: IPurchaseHistoryItem,
|
|
66
|
-
index: number
|
|
67
|
-
) => React.ReactElement | null;
|
|
68
|
-
skeletonCount?: number;
|
|
69
|
-
skeletonComponent?: React.ReactElement;
|
|
70
|
-
|
|
71
|
-
// Empty State
|
|
72
|
-
noDataComponent?: React.ReactNode;
|
|
73
|
-
noDataText?: string;
|
|
74
|
-
|
|
75
|
-
// Interaction
|
|
76
|
-
onPressItem?: (item: IPurchaseHistoryItem) => void;
|
|
77
|
-
|
|
78
|
-
onEndReached?: () => void;
|
|
79
|
-
onEndReachedThreshold?: number;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
const PurchaseHistoryComponent: React.FC<PurchaseHistoryProps> = ({
|
|
83
|
-
data = [],
|
|
84
|
-
isLoading = false,
|
|
85
|
-
title = 'Purchase History',
|
|
86
|
-
headerComponent,
|
|
87
|
-
onBackPress = () => {},
|
|
88
|
-
onSearchPress = () => {},
|
|
89
|
-
showSearchIcon = true,
|
|
90
|
-
itemDimension = 90,
|
|
91
|
-
spacing = 10,
|
|
92
|
-
listStyle,
|
|
93
|
-
contentContainerStyle,
|
|
94
|
-
theme,
|
|
95
|
-
renderItem,
|
|
96
|
-
skeletonCount = 9,
|
|
97
|
-
skeletonComponent,
|
|
98
|
-
noDataComponent,
|
|
99
|
-
noDataText = 'No Purchase History Found',
|
|
100
|
-
onPressItem,
|
|
101
|
-
|
|
102
|
-
onEndReached,
|
|
103
|
-
onEndReachedThreshold,
|
|
104
|
-
}) => {
|
|
105
|
-
const { theme: appliedTheme } = useInternalTheme(theme);
|
|
106
|
-
|
|
107
|
-
const listData = useMemo(
|
|
108
|
-
() =>
|
|
109
|
-
isLoading
|
|
110
|
-
? Array.from({ length: skeletonCount }, (_, i) => ({
|
|
111
|
-
_id: `skeleton-${i}`,
|
|
112
|
-
}))
|
|
113
|
-
: data,
|
|
114
|
-
[isLoading, skeletonCount, data]
|
|
115
|
-
);
|
|
116
|
-
|
|
117
|
-
const formatDate = useCallback((dateString: string): string => {
|
|
118
|
-
const m = moment(dateString);
|
|
119
|
-
if (!m.isValid()) return 'Invalid Date';
|
|
120
|
-
|
|
121
|
-
const now = moment();
|
|
122
|
-
const daysDiff = m.diff(now, 'days');
|
|
123
|
-
|
|
124
|
-
// Show relative time for recent dates
|
|
125
|
-
if (daysDiff === 0) {
|
|
126
|
-
return 'Today';
|
|
127
|
-
} else if (daysDiff === -1) {
|
|
128
|
-
return 'Yesterday';
|
|
129
|
-
} else if (daysDiff > -7 && daysDiff < 0) {
|
|
130
|
-
return `${Math.abs(daysDiff)} days ago`;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
// Show full date for older dates
|
|
134
|
-
if (m.year() === now.year()) {
|
|
135
|
-
return m.format('D MMM');
|
|
136
|
-
}
|
|
137
|
-
return m.format('D MMM YYYY');
|
|
138
|
-
}, []);
|
|
139
|
-
|
|
140
|
-
const getTimeLeft = useCallback((dateString: string): string => {
|
|
141
|
-
const expiry = moment(dateString);
|
|
142
|
-
if (!expiry.isValid()) return '';
|
|
143
|
-
|
|
144
|
-
const now = moment();
|
|
145
|
-
if (expiry.isBefore(now)) return 'Expired';
|
|
146
|
-
|
|
147
|
-
const dur = moment.duration(expiry.diff(now));
|
|
148
|
-
const days = Math.floor(dur.asDays());
|
|
149
|
-
const hours = dur.hours();
|
|
150
|
-
const minutes = dur.minutes();
|
|
151
|
-
const seconds = dur.seconds();
|
|
152
|
-
|
|
153
|
-
if (days > 0) {
|
|
154
|
-
if (hours === 0) {
|
|
155
|
-
return `${days}d left`;
|
|
156
|
-
}
|
|
157
|
-
return `${days}d ${hours}h left`;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
if (hours > 0) {
|
|
161
|
-
if (minutes === 0) {
|
|
162
|
-
return `${hours}h left`;
|
|
163
|
-
}
|
|
164
|
-
return `${hours}h ${minutes}m left`;
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
if (minutes > 0) {
|
|
168
|
-
return `${minutes}m left`;
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
return `${seconds}s left`;
|
|
172
|
-
}, []);
|
|
173
|
-
|
|
174
|
-
const getChipColors = useCallback(
|
|
175
|
-
(expired: boolean, _tvodType?: IPurchaseHistoryItem['tvod_type']) => {
|
|
176
|
-
if (expired) {
|
|
177
|
-
return {
|
|
178
|
-
bg: appliedTheme.colors.background,
|
|
179
|
-
border: appliedTheme.colors.error,
|
|
180
|
-
text: appliedTheme.colors.error,
|
|
181
|
-
icon: appliedTheme.colors.error,
|
|
182
|
-
};
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
// Same colors for both RENT and BUY
|
|
186
|
-
return {
|
|
187
|
-
bg: appliedTheme.colors.background,
|
|
188
|
-
border: appliedTheme.colors.primary,
|
|
189
|
-
text: appliedTheme.colors.textPrimary,
|
|
190
|
-
icon: appliedTheme.colors.textPrimary,
|
|
191
|
-
};
|
|
192
|
-
},
|
|
193
|
-
[
|
|
194
|
-
appliedTheme.colors.background,
|
|
195
|
-
appliedTheme.colors.error,
|
|
196
|
-
appliedTheme.colors.primary,
|
|
197
|
-
appliedTheme.colors.textPrimary,
|
|
198
|
-
]
|
|
199
|
-
);
|
|
200
|
-
|
|
201
|
-
const isExpired = useCallback((item: IPurchaseHistoryItem): boolean => {
|
|
202
|
-
if (item.status === 'expired') return true;
|
|
203
|
-
const expiry = moment(item.valid_upto);
|
|
204
|
-
if (!expiry.isValid()) return false;
|
|
205
|
-
return expiry.isBefore(moment());
|
|
206
|
-
}, []);
|
|
207
|
-
|
|
208
|
-
const handleItemPress = useCallback(
|
|
209
|
-
(item: IPurchaseHistoryItem) => {
|
|
210
|
-
onPressItem?.(item);
|
|
211
|
-
},
|
|
212
|
-
[onPressItem]
|
|
213
|
-
);
|
|
214
|
-
|
|
215
|
-
// Memoize theme colors
|
|
216
|
-
const themeColors = useMemo(
|
|
217
|
-
() => ({
|
|
218
|
-
error: appliedTheme.colors.error,
|
|
219
|
-
primary: appliedTheme.colors.primary,
|
|
220
|
-
buttonText: appliedTheme.colors.buttonText,
|
|
221
|
-
}),
|
|
222
|
-
[
|
|
223
|
-
appliedTheme.colors.error,
|
|
224
|
-
appliedTheme.colors.primary,
|
|
225
|
-
appliedTheme.colors.buttonText,
|
|
226
|
-
]
|
|
227
|
-
);
|
|
228
|
-
|
|
229
|
-
const renderGridItem: ListRenderItem<any> = useCallback(
|
|
230
|
-
({ item, index }: { item: IPurchaseHistoryItem; index: number }) => {
|
|
231
|
-
if (isLoading && skeletonComponent) return skeletonComponent;
|
|
232
|
-
if (!isLoading && renderItem) return renderItem(item, index);
|
|
233
|
-
|
|
234
|
-
const expired = !isLoading && item ? isExpired(item) : false;
|
|
235
|
-
const statusColor = expired ? themeColors.error : themeColors.primary;
|
|
236
|
-
const statusTextColor = themeColors.buttonText;
|
|
237
|
-
|
|
238
|
-
return (
|
|
239
|
-
<TouchableOpacity
|
|
240
|
-
onPress={() => handleItemPress(item)}
|
|
241
|
-
activeOpacity={0.8}
|
|
242
|
-
style={styles.itemContainer}
|
|
243
|
-
>
|
|
244
|
-
<View style={styles.posterWrapper}>
|
|
245
|
-
<CardPoster
|
|
246
|
-
theme={appliedTheme}
|
|
247
|
-
isLoading={isLoading}
|
|
248
|
-
posterUri={item?.content_id?.poster}
|
|
249
|
-
contentType={item?.content_id?.type}
|
|
250
|
-
/>
|
|
251
|
-
|
|
252
|
-
{/* Gradient Overlay */}
|
|
253
|
-
{!isLoading && item && (
|
|
254
|
-
<LinearGradient
|
|
255
|
-
colors={[
|
|
256
|
-
'rgba(0, 0, 0, 0.95)',
|
|
257
|
-
'rgba(0, 0, 0, 0.5)',
|
|
258
|
-
'rgba(0, 0, 0, 0.1)',
|
|
259
|
-
'transparent',
|
|
260
|
-
]}
|
|
261
|
-
locations={[0, 0.3, 0.6, 1]}
|
|
262
|
-
style={styles.gradientOverlay}
|
|
263
|
-
start={{ x: 0, y: 1 }}
|
|
264
|
-
end={{ x: 0, y: 0 }}
|
|
265
|
-
/>
|
|
266
|
-
)}
|
|
267
|
-
|
|
268
|
-
{!isLoading && item && (
|
|
269
|
-
<>
|
|
270
|
-
{/* Status Badge */}
|
|
271
|
-
<View
|
|
272
|
-
style={[
|
|
273
|
-
styles.statusBadge,
|
|
274
|
-
{
|
|
275
|
-
backgroundColor: statusColor,
|
|
276
|
-
borderColor: statusColor,
|
|
277
|
-
},
|
|
278
|
-
]}
|
|
279
|
-
>
|
|
280
|
-
{expired ? (
|
|
281
|
-
<XCircle size={scale(10)} color={statusTextColor} />
|
|
282
|
-
) : (
|
|
283
|
-
<CheckCircle2 size={scale(10)} color={statusTextColor} />
|
|
284
|
-
)}
|
|
285
|
-
<Text style={[styles.statusText, { color: statusTextColor }]}>
|
|
286
|
-
{expired ? 'Expired' : 'Active'}
|
|
287
|
-
</Text>
|
|
288
|
-
</View>
|
|
289
|
-
|
|
290
|
-
{/* Expiry Date Overlay */}
|
|
291
|
-
<View style={styles.dateOverlay}>
|
|
292
|
-
{(() => {
|
|
293
|
-
const chip = getChipColors(expired, item.tvod_type);
|
|
294
|
-
return (
|
|
295
|
-
<View
|
|
296
|
-
style={[
|
|
297
|
-
styles.dateContainer,
|
|
298
|
-
{
|
|
299
|
-
backgroundColor: chip.bg,
|
|
300
|
-
borderColor: chip.border,
|
|
301
|
-
},
|
|
302
|
-
]}
|
|
303
|
-
>
|
|
304
|
-
<View
|
|
305
|
-
style={[
|
|
306
|
-
styles.statusDot,
|
|
307
|
-
{ backgroundColor: chip.border },
|
|
308
|
-
]}
|
|
309
|
-
/>
|
|
310
|
-
<Calendar size={scale(8)} color={chip.icon} />
|
|
311
|
-
<Text
|
|
312
|
-
style={[styles.dateText, { color: chip.text }]}
|
|
313
|
-
numberOfLines={1}
|
|
314
|
-
>
|
|
315
|
-
{expired
|
|
316
|
-
? `Exp: ${formatDate(item.valid_upto)}`
|
|
317
|
-
: item.tvod_type === 'RENT'
|
|
318
|
-
? getTimeLeft(item.valid_upto)
|
|
319
|
-
: 'Purchased'}
|
|
320
|
-
</Text>
|
|
321
|
-
</View>
|
|
322
|
-
);
|
|
323
|
-
})()}
|
|
324
|
-
</View>
|
|
325
|
-
</>
|
|
326
|
-
)}
|
|
327
|
-
</View>
|
|
328
|
-
</TouchableOpacity>
|
|
329
|
-
);
|
|
330
|
-
},
|
|
331
|
-
[
|
|
332
|
-
isLoading,
|
|
333
|
-
skeletonComponent,
|
|
334
|
-
renderItem,
|
|
335
|
-
isExpired,
|
|
336
|
-
themeColors.error,
|
|
337
|
-
themeColors.primary,
|
|
338
|
-
themeColors.buttonText,
|
|
339
|
-
appliedTheme,
|
|
340
|
-
handleItemPress,
|
|
341
|
-
getChipColors,
|
|
342
|
-
formatDate,
|
|
343
|
-
getTimeLeft,
|
|
344
|
-
]
|
|
345
|
-
);
|
|
346
|
-
|
|
347
|
-
const keyExtractor = useCallback(
|
|
348
|
-
(item: any, index: number) => item._id || `item-${index}`,
|
|
349
|
-
[]
|
|
350
|
-
);
|
|
351
|
-
|
|
352
|
-
const contentContainerStyleMemo = useMemo(
|
|
353
|
-
() => [contentContainerStyle, { paddingBottom: scale(50) }],
|
|
354
|
-
[contentContainerStyle]
|
|
355
|
-
);
|
|
356
|
-
|
|
357
|
-
const titleStyleMemo = useMemo(
|
|
358
|
-
() => ({
|
|
359
|
-
color: appliedTheme.colors.onBackground,
|
|
360
|
-
}),
|
|
361
|
-
[appliedTheme.colors.onBackground]
|
|
362
|
-
);
|
|
363
|
-
|
|
364
|
-
return (
|
|
365
|
-
<View style={styles.container}>
|
|
366
|
-
{headerComponent ? (
|
|
367
|
-
headerComponent
|
|
368
|
-
) : (
|
|
369
|
-
<AppHeader
|
|
370
|
-
onBackPress={onBackPress}
|
|
371
|
-
title={title}
|
|
372
|
-
titleAlign="left"
|
|
373
|
-
theme={theme}
|
|
374
|
-
titleStyle={titleStyleMemo}
|
|
375
|
-
onRightPress={onSearchPress}
|
|
376
|
-
rightIcon={
|
|
377
|
-
showSearchIcon ? (
|
|
378
|
-
<Search
|
|
379
|
-
size={scale(23)}
|
|
380
|
-
color={appliedTheme.colors.onBackground}
|
|
381
|
-
/>
|
|
382
|
-
) : undefined
|
|
383
|
-
}
|
|
384
|
-
/>
|
|
385
|
-
)}
|
|
386
|
-
|
|
387
|
-
{isLoading || data.length > 0 ? (
|
|
388
|
-
<FlatGrid
|
|
389
|
-
itemDimension={itemDimension}
|
|
390
|
-
spacing={spacing}
|
|
391
|
-
data={listData}
|
|
392
|
-
keyExtractor={keyExtractor}
|
|
393
|
-
style={listStyle}
|
|
394
|
-
contentContainerStyle={contentContainerStyleMemo}
|
|
395
|
-
renderItem={renderGridItem}
|
|
396
|
-
onEndReached={onEndReached}
|
|
397
|
-
onEndReachedThreshold={onEndReachedThreshold ?? 0.5}
|
|
398
|
-
/>
|
|
399
|
-
) : noDataComponent ? (
|
|
400
|
-
<>{noDataComponent}</>
|
|
401
|
-
) : (
|
|
402
|
-
<View style={styles.noData}>
|
|
403
|
-
<Text style={styles.noDataText}>{noDataText}</Text>
|
|
404
|
-
</View>
|
|
405
|
-
)}
|
|
406
|
-
</View>
|
|
407
|
-
);
|
|
408
|
-
};
|
|
409
|
-
|
|
410
|
-
export const PurchaseHistory = memo(PurchaseHistoryComponent);
|
|
411
|
-
|
|
412
|
-
const styles = StyleSheet.create({
|
|
413
|
-
container: {
|
|
414
|
-
flex: 1,
|
|
415
|
-
},
|
|
416
|
-
itemContainer: {
|
|
417
|
-
width: '100%',
|
|
418
|
-
},
|
|
419
|
-
posterWrapper: {
|
|
420
|
-
width: '100%',
|
|
421
|
-
position: 'relative',
|
|
422
|
-
},
|
|
423
|
-
gradientOverlay: {
|
|
424
|
-
position: 'absolute',
|
|
425
|
-
top: 0,
|
|
426
|
-
left: 0,
|
|
427
|
-
right: 0,
|
|
428
|
-
bottom: 0,
|
|
429
|
-
zIndex: 1,
|
|
430
|
-
borderRadius: scale(6),
|
|
431
|
-
},
|
|
432
|
-
statusBadge: {
|
|
433
|
-
position: 'absolute',
|
|
434
|
-
top: scale(4),
|
|
435
|
-
right: scale(4),
|
|
436
|
-
flexDirection: 'row',
|
|
437
|
-
alignItems: 'center',
|
|
438
|
-
paddingHorizontal: scale(3),
|
|
439
|
-
paddingVertical: scale(1),
|
|
440
|
-
borderRadius: scale(10),
|
|
441
|
-
borderWidth: scale(1),
|
|
442
|
-
gap: scale(3),
|
|
443
|
-
zIndex: 100,
|
|
444
|
-
elevation: 8,
|
|
445
|
-
shadowColor: '#000',
|
|
446
|
-
shadowOffset: { width: 0, height: 2 },
|
|
447
|
-
shadowOpacity: 0.4,
|
|
448
|
-
shadowRadius: 4,
|
|
449
|
-
},
|
|
450
|
-
statusText: {
|
|
451
|
-
fontSize: RFValue(8),
|
|
452
|
-
fontWeight: '700',
|
|
453
|
-
color: '#FFFFFF',
|
|
454
|
-
},
|
|
455
|
-
dateOverlay: {
|
|
456
|
-
position: 'absolute',
|
|
457
|
-
bottom: 0,
|
|
458
|
-
left: 0,
|
|
459
|
-
right: 0,
|
|
460
|
-
padding: scale(4),
|
|
461
|
-
zIndex: 100,
|
|
462
|
-
},
|
|
463
|
-
dateContainer: {
|
|
464
|
-
flexDirection: 'row',
|
|
465
|
-
alignItems: 'center',
|
|
466
|
-
paddingHorizontal: scale(5),
|
|
467
|
-
paddingVertical: scale(4),
|
|
468
|
-
borderRadius: scale(4),
|
|
469
|
-
gap: scale(3),
|
|
470
|
-
borderWidth: scale(0.8),
|
|
471
|
-
},
|
|
472
|
-
statusDot: { width: scale(6), height: scale(6), borderRadius: scale(3) },
|
|
473
|
-
dateText: {
|
|
474
|
-
fontSize: RFValue(7),
|
|
475
|
-
fontWeight: '600',
|
|
476
|
-
flex: 1,
|
|
477
|
-
lineHeight: RFValue(9),
|
|
478
|
-
},
|
|
479
|
-
noData: {
|
|
480
|
-
flex: 1,
|
|
481
|
-
alignItems: 'center',
|
|
482
|
-
justifyContent: 'center',
|
|
483
|
-
},
|
|
484
|
-
noDataText: {
|
|
485
|
-
fontSize: RFValue(12),
|
|
486
|
-
opacity: 0.5,
|
|
487
|
-
},
|
|
488
|
-
});
|
|
489
|
-
|
|
490
|
-
export namespace PurchaseHistory {
|
|
491
|
-
export type Props = PurchaseHistoryProps;
|
|
492
|
-
export type Data = Props['data'];
|
|
493
|
-
export type Item = Props['data'][number];
|
|
494
|
-
}
|
|
@@ -1,227 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @author Naresh Dhamu
|
|
3
|
-
* @lastModified Tue 24 Jun 2025 at 07:32 PM
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import React, { memo, useMemo, useCallback } from 'react';
|
|
7
|
-
import {
|
|
8
|
-
StyleSheet,
|
|
9
|
-
View,
|
|
10
|
-
TouchableOpacity,
|
|
11
|
-
type StyleProp,
|
|
12
|
-
type ViewStyle,
|
|
13
|
-
type ListRenderItem,
|
|
14
|
-
} from 'react-native';
|
|
15
|
-
import { FlatGrid } from 'react-native-super-grid';
|
|
16
|
-
import { scale } from 'react-native-size-matters';
|
|
17
|
-
import { Search } from 'lucide-react-native';
|
|
18
|
-
|
|
19
|
-
import { useInternalTheme } from '../../../theme/hook/useInternalTheme';
|
|
20
|
-
|
|
21
|
-
import AppHeader from '../../Headers/AppHeader';
|
|
22
|
-
import { Text } from '../../Text';
|
|
23
|
-
import CardPoster from '../../Content/Card/components/CardPoster';
|
|
24
|
-
import type { ThemeOverride } from '../../../theme/themes';
|
|
25
|
-
import { RFValue } from 'react-native-responsive-fontsize';
|
|
26
|
-
import type { IContentData } from '@zezosoft/zezo-ott-api-client';
|
|
27
|
-
|
|
28
|
-
export interface IHistoryItem {
|
|
29
|
-
_id: string;
|
|
30
|
-
content: IContentData;
|
|
31
|
-
content_type: 'movie' | 'series' | 'live_stream';
|
|
32
|
-
currentTime: number;
|
|
33
|
-
duration: number;
|
|
34
|
-
season_number?: number;
|
|
35
|
-
episode_number?: number;
|
|
36
|
-
completed: boolean;
|
|
37
|
-
current_season?: any;
|
|
38
|
-
current_episode?: any;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export interface WatchHistoryProps {
|
|
42
|
-
data: IHistoryItem[];
|
|
43
|
-
isLoading?: boolean;
|
|
44
|
-
|
|
45
|
-
// Header Config
|
|
46
|
-
title?: string;
|
|
47
|
-
headerComponent?: React.ReactNode;
|
|
48
|
-
onBackPress?: () => void;
|
|
49
|
-
onSearchPress?: () => void;
|
|
50
|
-
showSearchIcon?: boolean;
|
|
51
|
-
|
|
52
|
-
// Grid & Layout Customization
|
|
53
|
-
itemDimension?: number;
|
|
54
|
-
spacing?: number;
|
|
55
|
-
listStyle?: StyleProp<ViewStyle>;
|
|
56
|
-
contentContainerStyle?: StyleProp<ViewStyle>;
|
|
57
|
-
|
|
58
|
-
// Theme
|
|
59
|
-
theme?: ThemeOverride;
|
|
60
|
-
|
|
61
|
-
// Rendering Overrides
|
|
62
|
-
renderItem?: (item: IHistoryItem, index: number) => React.ReactElement | null;
|
|
63
|
-
skeletonCount?: number;
|
|
64
|
-
skeletonComponent?: React.ReactElement;
|
|
65
|
-
|
|
66
|
-
// Empty State
|
|
67
|
-
noDataComponent?: React.ReactNode;
|
|
68
|
-
noDataText?: string;
|
|
69
|
-
|
|
70
|
-
// Interaction
|
|
71
|
-
onPressItem?: (item: IHistoryItem) => void;
|
|
72
|
-
|
|
73
|
-
onEndReached?: () => void;
|
|
74
|
-
onEndReachedThreshold?: number;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
const WatchHistoryComponent: React.FC<WatchHistoryProps> = ({
|
|
78
|
-
data = [],
|
|
79
|
-
isLoading = false,
|
|
80
|
-
title = 'Watch History',
|
|
81
|
-
headerComponent,
|
|
82
|
-
onBackPress = () => {},
|
|
83
|
-
onSearchPress = () => {},
|
|
84
|
-
showSearchIcon = true,
|
|
85
|
-
itemDimension = 90,
|
|
86
|
-
spacing = 10,
|
|
87
|
-
listStyle,
|
|
88
|
-
contentContainerStyle,
|
|
89
|
-
theme,
|
|
90
|
-
renderItem,
|
|
91
|
-
skeletonCount = 9,
|
|
92
|
-
skeletonComponent,
|
|
93
|
-
noDataComponent,
|
|
94
|
-
noDataText = 'No Watch History Found',
|
|
95
|
-
onPressItem,
|
|
96
|
-
onEndReached,
|
|
97
|
-
onEndReachedThreshold,
|
|
98
|
-
}) => {
|
|
99
|
-
const { theme: appliedTheme } = useInternalTheme(theme);
|
|
100
|
-
|
|
101
|
-
const listData = useMemo(
|
|
102
|
-
() =>
|
|
103
|
-
isLoading
|
|
104
|
-
? Array.from({ length: skeletonCount }, (_, i) => ({
|
|
105
|
-
_id: `skeleton-${i}`,
|
|
106
|
-
}))
|
|
107
|
-
: data,
|
|
108
|
-
[isLoading, skeletonCount, data]
|
|
109
|
-
);
|
|
110
|
-
|
|
111
|
-
const handleItemPress = useCallback(
|
|
112
|
-
(item: any) => {
|
|
113
|
-
onPressItem?.(item);
|
|
114
|
-
},
|
|
115
|
-
[onPressItem]
|
|
116
|
-
);
|
|
117
|
-
|
|
118
|
-
const renderGridItem: ListRenderItem<any> = useCallback(
|
|
119
|
-
({ item, index }) => {
|
|
120
|
-
if (isLoading && skeletonComponent) return skeletonComponent;
|
|
121
|
-
if (!isLoading && renderItem) return renderItem(item, index);
|
|
122
|
-
|
|
123
|
-
return (
|
|
124
|
-
<TouchableOpacity
|
|
125
|
-
key={item._id || index}
|
|
126
|
-
onPress={() => handleItemPress(item)}
|
|
127
|
-
activeOpacity={0.8}
|
|
128
|
-
>
|
|
129
|
-
<CardPoster
|
|
130
|
-
content_offering_type={item?.content?.content_offering_type}
|
|
131
|
-
contentType={item?.content?.type}
|
|
132
|
-
theme={appliedTheme}
|
|
133
|
-
isLoading={isLoading}
|
|
134
|
-
posterUri={item?.content?.poster}
|
|
135
|
-
/>
|
|
136
|
-
</TouchableOpacity>
|
|
137
|
-
);
|
|
138
|
-
},
|
|
139
|
-
[isLoading, skeletonComponent, renderItem, handleItemPress, appliedTheme]
|
|
140
|
-
);
|
|
141
|
-
|
|
142
|
-
const keyExtractor = useCallback(
|
|
143
|
-
(item: any, index: number) => item._id || `item-${index}`,
|
|
144
|
-
[]
|
|
145
|
-
);
|
|
146
|
-
|
|
147
|
-
const contentContainerStyleMemo = useMemo(
|
|
148
|
-
() => [contentContainerStyle, { paddingBottom: scale(50) }],
|
|
149
|
-
[contentContainerStyle]
|
|
150
|
-
);
|
|
151
|
-
|
|
152
|
-
const titleStyleMemo = useMemo(
|
|
153
|
-
() => ({
|
|
154
|
-
color: appliedTheme.colors.onBackground,
|
|
155
|
-
}),
|
|
156
|
-
[appliedTheme.colors.onBackground]
|
|
157
|
-
);
|
|
158
|
-
|
|
159
|
-
return (
|
|
160
|
-
<View style={styles.container}>
|
|
161
|
-
{headerComponent ? (
|
|
162
|
-
headerComponent
|
|
163
|
-
) : (
|
|
164
|
-
<AppHeader
|
|
165
|
-
onBackPress={onBackPress}
|
|
166
|
-
title={title}
|
|
167
|
-
titleAlign="left"
|
|
168
|
-
theme={theme}
|
|
169
|
-
titleStyle={titleStyleMemo}
|
|
170
|
-
onRightPress={onSearchPress}
|
|
171
|
-
rightIcon={
|
|
172
|
-
showSearchIcon ? (
|
|
173
|
-
<Search
|
|
174
|
-
size={scale(23)}
|
|
175
|
-
color={appliedTheme.colors.onBackground}
|
|
176
|
-
/>
|
|
177
|
-
) : undefined
|
|
178
|
-
}
|
|
179
|
-
/>
|
|
180
|
-
)}
|
|
181
|
-
|
|
182
|
-
{isLoading || data.length > 0 ? (
|
|
183
|
-
<FlatGrid
|
|
184
|
-
itemDimension={itemDimension}
|
|
185
|
-
spacing={spacing}
|
|
186
|
-
data={listData}
|
|
187
|
-
keyExtractor={keyExtractor}
|
|
188
|
-
style={listStyle}
|
|
189
|
-
contentContainerStyle={contentContainerStyleMemo}
|
|
190
|
-
renderItem={renderGridItem}
|
|
191
|
-
onEndReached={onEndReached}
|
|
192
|
-
onEndReachedThreshold={onEndReachedThreshold ?? 0.5}
|
|
193
|
-
/>
|
|
194
|
-
) : noDataComponent ? (
|
|
195
|
-
<>{noDataComponent}</>
|
|
196
|
-
) : (
|
|
197
|
-
<View style={styles.noData}>
|
|
198
|
-
<Text style={styles.noDataText}>{noDataText}</Text>
|
|
199
|
-
</View>
|
|
200
|
-
)}
|
|
201
|
-
</View>
|
|
202
|
-
);
|
|
203
|
-
};
|
|
204
|
-
|
|
205
|
-
export const WatchHistory = memo(WatchHistoryComponent);
|
|
206
|
-
|
|
207
|
-
const styles = StyleSheet.create({
|
|
208
|
-
container: {
|
|
209
|
-
flex: 1,
|
|
210
|
-
},
|
|
211
|
-
|
|
212
|
-
noData: {
|
|
213
|
-
flex: 1,
|
|
214
|
-
alignItems: 'center',
|
|
215
|
-
justifyContent: 'center',
|
|
216
|
-
},
|
|
217
|
-
noDataText: {
|
|
218
|
-
fontSize: RFValue(12),
|
|
219
|
-
opacity: 0.5,
|
|
220
|
-
},
|
|
221
|
-
});
|
|
222
|
-
|
|
223
|
-
export namespace WatchHistory {
|
|
224
|
-
export type Props = WatchHistoryProps;
|
|
225
|
-
export type Data = Props['data'];
|
|
226
|
-
export type Item = Props['data'][number];
|
|
227
|
-
}
|