@zezosoft/zezo-ott-react-native-ui-kit 1.0.3 → 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/lib/module/assets/animations/Failed.json +2103 -0
- package/lib/module/assets/animations/Pending.json +522 -0
- package/lib/module/assets/animations/Successful.json +2289 -0
- package/lib/module/assets/animations/heart.json +788 -0
- package/lib/module/components/Alert/AlertDialog.js +208 -0
- package/lib/module/components/Alert/AlertDialog.js.map +1 -0
- package/lib/module/components/Alert/index.js +1 -0
- package/lib/module/components/Alert/index.js.map +1 -1
- package/lib/module/components/Auth/AuthProvider/AuthProvider.js +270 -0
- package/lib/module/components/Auth/AuthProvider/AuthProvider.js.map +1 -0
- package/lib/module/components/Auth/QrLogin/QrLogin.js +267 -0
- package/lib/module/components/Auth/QrLogin/QrLogin.js.map +1 -0
- package/lib/module/components/Auth/QrLogin/components/QrViewArea.js +178 -0
- package/lib/module/components/Auth/QrLogin/components/QrViewArea.js.map +1 -0
- package/lib/module/components/Auth/SplashScreen/SplashScreen.js +63 -65
- package/lib/module/components/Auth/SplashScreen/SplashScreen.js.map +1 -1
- package/lib/module/components/Auth/SplashScreen/components/SplashVideo/SplashVideo.js +82 -41
- package/lib/module/components/Auth/SplashScreen/components/SplashVideo/SplashVideo.js.map +1 -1
- package/lib/module/components/Auth/index.js +5 -1
- package/lib/module/components/Auth/index.js.map +1 -1
- package/lib/module/components/BackgroundLayout/BackgroundLayout.js +3 -3
- package/lib/module/components/BackgroundLayout/BackgroundLayout.js.map +1 -1
- package/lib/module/components/Button/SecondaryBtn.js +91 -0
- package/lib/module/components/Button/SecondaryBtn.js.map +1 -0
- package/lib/module/components/Button/index.js +2 -0
- package/lib/module/components/Button/index.js.map +1 -1
- package/lib/module/components/Content/Card/NowWatching/NowWatching.js +6 -3
- package/lib/module/components/Content/Card/NowWatching/NowWatching.js.map +1 -1
- package/lib/module/components/Content/Card/Sliders/Styles/One.js +4 -1
- package/lib/module/components/Content/Card/Sliders/Styles/One.js.map +1 -1
- package/lib/module/components/Content/Card/Sliders/Styles/Two.js +4 -1
- package/lib/module/components/Content/Card/Sliders/Styles/Two.js.map +1 -1
- package/lib/module/components/Content/Card/Styles/Five.js +1 -0
- package/lib/module/components/Content/Card/Styles/Five.js.map +1 -1
- package/lib/module/components/Content/Card/Styles/Four.js +1 -0
- package/lib/module/components/Content/Card/Styles/Four.js.map +1 -1
- package/lib/module/components/Content/Card/Styles/One.js +7 -3
- package/lib/module/components/Content/Card/Styles/One.js.map +1 -1
- package/lib/module/components/Content/Card/Styles/RotateInOut.js +1 -0
- package/lib/module/components/Content/Card/Styles/RotateInOut.js.map +1 -1
- package/lib/module/components/Content/Card/Styles/Six.js +4 -1
- package/lib/module/components/Content/Card/Styles/Six.js.map +1 -1
- package/lib/module/components/Content/Card/Styles/Three.js +1 -0
- package/lib/module/components/Content/Card/Styles/Three.js.map +1 -1
- package/lib/module/components/Content/Card/Styles/TopTen.js +1 -0
- package/lib/module/components/Content/Card/Styles/TopTen.js.map +1 -1
- package/lib/module/components/Content/Card/Styles/Two.js +1 -0
- package/lib/module/components/Content/Card/Styles/Two.js.map +1 -1
- package/lib/module/components/Content/Card/components/CardPoster.js +12 -28
- package/lib/module/components/Content/Card/components/CardPoster.js.map +1 -1
- package/lib/module/components/Content/Card/components/RentOrBuyIcon.js +116 -0
- package/lib/module/components/Content/Card/components/RentOrBuyIcon.js.map +1 -0
- package/lib/module/components/Content/Card/components/ThumbnailCard.js +1 -2
- package/lib/module/components/Content/Card/components/ThumbnailCard.js.map +1 -1
- package/lib/module/components/ContentView/ContentView.js +1 -0
- package/lib/module/components/ContentView/ContentView.js.map +1 -1
- package/lib/module/components/ContentView/MoreContentList.js +1 -0
- package/lib/module/components/ContentView/MoreContentList.js.map +1 -1
- package/lib/module/components/ContentView/components/EpisodeCard.js +6 -10
- package/lib/module/components/ContentView/components/EpisodeCard.js.map +1 -1
- package/lib/module/components/ContentView/components/HeroBanner.js +17 -5
- package/lib/module/components/ContentView/components/HeroBanner.js.map +1 -1
- package/lib/module/components/Headers/AppHeader.js +1 -1
- package/lib/module/components/Headers/AppHeader.js.map +1 -1
- package/lib/module/components/Headers/One.js +1 -1
- package/lib/module/components/Headers/One.js.map +1 -1
- package/lib/module/components/Headers/Two.js +1 -1
- package/lib/module/components/Headers/Two.js.map +1 -1
- package/lib/module/components/Logo/Logo.js +5 -5
- package/lib/module/components/Logo/Logo.js.map +1 -1
- package/lib/module/components/Reels/ReelsSeries/Model/Episodes.js +110 -0
- package/lib/module/components/Reels/ReelsSeries/Model/Episodes.js.map +1 -0
- package/lib/module/components/Reels/ReelsSeries/Model/Synopsis.js +212 -0
- package/lib/module/components/Reels/ReelsSeries/Model/Synopsis.js.map +1 -0
- package/lib/module/components/Reels/ReelsSeries/ReelSeriesDetailsModal.js +182 -0
- package/lib/module/components/Reels/ReelsSeries/ReelSeriesDetailsModal.js.map +1 -0
- package/lib/module/components/Reels/ReelsSeries/ReelSeriesOverlay.js +203 -0
- package/lib/module/components/Reels/ReelsSeries/ReelSeriesOverlay.js.map +1 -0
- package/lib/module/components/Reels/ReelsSeries/ReelsSeries.js +121 -0
- package/lib/module/components/Reels/ReelsSeries/ReelsSeries.js.map +1 -0
- package/lib/module/components/Reels/ReelsSeries/ReelsSeriesItem.js +290 -0
- package/lib/module/components/Reels/ReelsSeries/ReelsSeriesItem.js.map +1 -0
- package/lib/module/components/Reels/ReelsSeries/types.js +2 -0
- package/lib/module/components/Reels/ReelsSeries/types.js.map +1 -0
- package/lib/module/components/Reels/index.js +11 -0
- package/lib/module/components/Reels/index.js.map +1 -0
- package/lib/module/components/Subscription/SubOne.js +2 -2
- package/lib/module/components/Subscription/SubOne.js.map +1 -1
- package/lib/module/components/User/DeviceSessions/DeviceSessions.js +8 -0
- package/lib/module/components/User/DeviceSessions/DeviceSessions.js.map +1 -1
- package/lib/module/components/User/ProfileUpdate/ProfileUpdate.js +255 -0
- package/lib/module/components/User/ProfileUpdate/ProfileUpdate.js.map +1 -0
- package/lib/module/components/User/WatchHistory/WatchHistory.js +1 -0
- package/lib/module/components/User/WatchHistory/WatchHistory.js.map +1 -1
- package/lib/module/components/User/WatchLater/WatchLater.js +1 -0
- package/lib/module/components/User/WatchLater/WatchLater.js.map +1 -1
- package/lib/module/components/User/components/UserAvatar.js +35 -8
- package/lib/module/components/User/components/UserAvatar.js.map +1 -1
- package/lib/module/components/User/components/UserSection.js +8 -13
- package/lib/module/components/User/components/UserSection.js.map +1 -1
- package/lib/module/components/User/index.js +2 -1
- package/lib/module/components/User/index.js.map +1 -1
- package/lib/module/components/index.js +1 -0
- package/lib/module/components/index.js.map +1 -1
- package/lib/module/hooks/useSplashCache.js +117 -0
- package/lib/module/hooks/useSplashCache.js.map +1 -0
- package/lib/module/store/RecentSearchesStore.js +0 -1
- package/lib/module/store/RecentSearchesStore.js.map +1 -1
- package/lib/module/theme/ThemeProvider.js +13 -10
- package/lib/module/theme/ThemeProvider.js.map +1 -1
- package/lib/module/theme/themes.js +2 -0
- package/lib/module/theme/themes.js.map +1 -1
- package/lib/module/utils/Formater.js +17 -0
- package/lib/module/utils/Formater.js.map +1 -0
- package/lib/typescript/src/components/Alert/AlertDialog.d.ts +18 -0
- package/lib/typescript/src/components/Alert/AlertDialog.d.ts.map +1 -0
- package/lib/typescript/src/components/Alert/index.d.ts +1 -0
- package/lib/typescript/src/components/Alert/index.d.ts.map +1 -1
- package/lib/typescript/src/components/Auth/AuthProvider/AuthProvider.d.ts +35 -0
- package/lib/typescript/src/components/Auth/AuthProvider/AuthProvider.d.ts.map +1 -0
- package/lib/typescript/src/components/Auth/QrLogin/QrLogin.d.ts +32 -0
- package/lib/typescript/src/components/Auth/QrLogin/QrLogin.d.ts.map +1 -0
- package/lib/typescript/src/components/Auth/QrLogin/components/QrViewArea.d.ts +15 -0
- package/lib/typescript/src/components/Auth/QrLogin/components/QrViewArea.d.ts.map +1 -0
- package/lib/typescript/src/components/Auth/SplashScreen/SplashScreen.d.ts +4 -3
- package/lib/typescript/src/components/Auth/SplashScreen/SplashScreen.d.ts.map +1 -1
- package/lib/typescript/src/components/Auth/SplashScreen/components/SplashVideo/SplashVideo.d.ts +1 -1
- package/lib/typescript/src/components/Auth/SplashScreen/components/SplashVideo/SplashVideo.d.ts.map +1 -1
- package/lib/typescript/src/components/Auth/index.d.ts +3 -0
- package/lib/typescript/src/components/Auth/index.d.ts.map +1 -1
- package/lib/typescript/src/components/BackgroundLayout/BackgroundLayout.d.ts.map +1 -1
- package/lib/typescript/src/components/Button/SecondaryBtn.d.ts +21 -0
- package/lib/typescript/src/components/Button/SecondaryBtn.d.ts.map +1 -0
- package/lib/typescript/src/components/Button/index.d.ts +11 -0
- package/lib/typescript/src/components/Button/index.d.ts.map +1 -1
- package/lib/typescript/src/components/Content/Card/NowWatching/NowWatching.d.ts.map +1 -1
- package/lib/typescript/src/components/Content/Card/Sliders/Styles/One.d.ts.map +1 -1
- package/lib/typescript/src/components/Content/Card/Sliders/Styles/Two.d.ts.map +1 -1
- package/lib/typescript/src/components/Content/Card/Styles/Five.d.ts.map +1 -1
- package/lib/typescript/src/components/Content/Card/Styles/Four.d.ts.map +1 -1
- package/lib/typescript/src/components/Content/Card/Styles/One.d.ts.map +1 -1
- package/lib/typescript/src/components/Content/Card/Styles/RotateInOut.d.ts.map +1 -1
- package/lib/typescript/src/components/Content/Card/Styles/Six.d.ts.map +1 -1
- package/lib/typescript/src/components/Content/Card/Styles/Three.d.ts.map +1 -1
- package/lib/typescript/src/components/Content/Card/Styles/TopTen.d.ts.map +1 -1
- package/lib/typescript/src/components/Content/Card/Styles/Two.d.ts.map +1 -1
- package/lib/typescript/src/components/Content/Card/components/CardPoster.d.ts +4 -2
- package/lib/typescript/src/components/Content/Card/components/CardPoster.d.ts.map +1 -1
- package/lib/typescript/src/components/Content/Card/components/RentOrBuyIcon.d.ts +14 -0
- package/lib/typescript/src/components/Content/Card/components/RentOrBuyIcon.d.ts.map +1 -0
- package/lib/typescript/src/components/ContentView/ContentView.d.ts.map +1 -1
- package/lib/typescript/src/components/ContentView/MoreContentList.d.ts.map +1 -1
- package/lib/typescript/src/components/ContentView/components/EpisodeCard.d.ts.map +1 -1
- package/lib/typescript/src/components/ContentView/components/HeroBanner.d.ts +1 -1
- package/lib/typescript/src/components/ContentView/components/HeroBanner.d.ts.map +1 -1
- package/lib/typescript/src/components/Logo/Logo.d.ts.map +1 -1
- package/lib/typescript/src/components/Reels/ReelsSeries/Model/Episodes.d.ts +12 -0
- package/lib/typescript/src/components/Reels/ReelsSeries/Model/Episodes.d.ts.map +1 -0
- package/lib/typescript/src/components/Reels/ReelsSeries/Model/Synopsis.d.ts +9 -0
- package/lib/typescript/src/components/Reels/ReelsSeries/Model/Synopsis.d.ts.map +1 -0
- package/lib/typescript/src/components/Reels/ReelsSeries/ReelSeriesDetailsModal.d.ts +13 -0
- package/lib/typescript/src/components/Reels/ReelsSeries/ReelSeriesDetailsModal.d.ts.map +1 -0
- package/lib/typescript/src/components/Reels/ReelsSeries/ReelSeriesOverlay.d.ts +18 -0
- package/lib/typescript/src/components/Reels/ReelsSeries/ReelSeriesOverlay.d.ts.map +1 -0
- package/lib/typescript/src/components/Reels/ReelsSeries/ReelsSeries.d.ts +15 -0
- package/lib/typescript/src/components/Reels/ReelsSeries/ReelsSeries.d.ts.map +1 -0
- package/lib/typescript/src/components/Reels/ReelsSeries/ReelsSeriesItem.d.ts +18 -0
- package/lib/typescript/src/components/Reels/ReelsSeries/ReelsSeriesItem.d.ts.map +1 -0
- package/lib/typescript/src/components/Reels/ReelsSeries/types.d.ts +24 -0
- package/lib/typescript/src/components/Reels/ReelsSeries/types.d.ts.map +1 -0
- package/lib/typescript/src/components/Reels/index.d.ts +8 -0
- package/lib/typescript/src/components/Reels/index.d.ts.map +1 -0
- package/lib/typescript/src/components/Subscription/SubOne.d.ts.map +1 -1
- package/lib/typescript/src/components/User/DeviceSessions/DeviceSessions.d.ts +1 -0
- package/lib/typescript/src/components/User/DeviceSessions/DeviceSessions.d.ts.map +1 -1
- package/lib/typescript/src/components/User/ProfileUpdate/ProfileUpdate.d.ts +27 -0
- package/lib/typescript/src/components/User/ProfileUpdate/ProfileUpdate.d.ts.map +1 -0
- package/lib/typescript/src/components/User/WatchHistory/WatchHistory.d.ts.map +1 -1
- package/lib/typescript/src/components/User/WatchLater/WatchLater.d.ts.map +1 -1
- package/lib/typescript/src/components/User/components/UserAvatar.d.ts +4 -0
- package/lib/typescript/src/components/User/components/UserAvatar.d.ts.map +1 -1
- package/lib/typescript/src/components/User/components/UserSection.d.ts.map +1 -1
- package/lib/typescript/src/components/User/index.d.ts +2 -1
- package/lib/typescript/src/components/User/index.d.ts.map +1 -1
- package/lib/typescript/src/components/index.d.ts +1 -0
- package/lib/typescript/src/components/index.d.ts.map +1 -1
- package/lib/typescript/src/hooks/useSplashCache.d.ts +22 -0
- package/lib/typescript/src/hooks/useSplashCache.d.ts.map +1 -0
- package/lib/typescript/src/store/RecentSearchesStore.d.ts.map +1 -1
- package/lib/typescript/src/theme/ThemeProvider.d.ts.map +1 -1
- package/lib/typescript/src/theme/themes.d.ts +1 -0
- package/lib/typescript/src/theme/themes.d.ts.map +1 -1
- package/lib/typescript/src/types/content/content-view.types.d.ts +1 -0
- package/lib/typescript/src/types/content/content-view.types.d.ts.map +1 -1
- package/lib/typescript/src/utils/Formater.d.ts +2 -0
- package/lib/typescript/src/utils/Formater.d.ts.map +1 -0
- package/package.json +13 -5
- package/src/assets/animations/Failed.json +2103 -0
- package/src/assets/animations/Pending.json +522 -0
- package/src/assets/animations/Successful.json +2289 -0
- package/src/assets/animations/heart.json +788 -0
- package/src/components/Alert/AlertDialog.tsx +247 -0
- package/src/components/Alert/index.ts +1 -0
- package/src/components/Auth/AuthProvider/AuthProvider.tsx +344 -0
- package/src/components/Auth/QrLogin/QrLogin.tsx +306 -0
- package/src/components/Auth/QrLogin/components/QrViewArea.tsx +213 -0
- package/src/components/Auth/SplashScreen/SplashScreen.tsx +89 -80
- package/src/components/Auth/SplashScreen/components/SplashVideo/SplashVideo.tsx +90 -40
- package/src/components/Auth/index.ts +4 -0
- package/src/components/BackgroundLayout/BackgroundLayout.tsx +3 -3
- package/src/components/Button/SecondaryBtn.tsx +116 -0
- package/src/components/Button/index.ts +2 -0
- package/src/components/Content/Card/NowWatching/NowWatching.tsx +4 -0
- package/src/components/Content/Card/Sliders/Styles/One.tsx +2 -0
- package/src/components/Content/Card/Sliders/Styles/Two.tsx +2 -0
- package/src/components/Content/Card/Styles/Five.tsx +1 -0
- package/src/components/Content/Card/Styles/Four.tsx +1 -0
- package/src/components/Content/Card/Styles/One.tsx +7 -1
- package/src/components/Content/Card/Styles/RotateInOut.tsx +1 -0
- package/src/components/Content/Card/Styles/Six.tsx +2 -0
- package/src/components/Content/Card/Styles/Three.tsx +1 -0
- package/src/components/Content/Card/Styles/TopTen.tsx +1 -0
- package/src/components/Content/Card/Styles/Two.tsx +1 -0
- package/src/components/Content/Card/components/CardPoster.tsx +23 -51
- package/src/components/Content/Card/components/RentOrBuyIcon.tsx +109 -0
- package/src/components/Content/Card/components/ThumbnailCard.tsx +1 -2
- package/src/components/ContentView/ContentView.tsx +1 -0
- package/src/components/ContentView/MoreContentList.tsx +1 -0
- package/src/components/ContentView/components/EpisodeCard.tsx +4 -9
- package/src/components/ContentView/components/HeroBanner.tsx +16 -0
- package/src/components/Headers/AppHeader.tsx +1 -1
- package/src/components/Headers/One.tsx +1 -1
- package/src/components/Headers/Two.tsx +1 -1
- package/src/components/Logo/Logo.tsx +5 -7
- package/src/components/Reels/ReelsSeries/Model/Episodes.tsx +133 -0
- package/src/components/Reels/ReelsSeries/Model/Synopsis.tsx +242 -0
- package/src/components/Reels/ReelsSeries/ReelSeriesDetailsModal.tsx +209 -0
- package/src/components/Reels/ReelsSeries/ReelSeriesOverlay.tsx +185 -0
- package/src/components/Reels/ReelsSeries/ReelsSeries.tsx +163 -0
- package/src/components/Reels/ReelsSeries/ReelsSeriesItem.tsx +333 -0
- package/src/components/Reels/ReelsSeries/types.ts +27 -0
- package/src/components/Reels/index.ts +8 -0
- package/src/components/Subscription/SubOne.tsx +4 -2
- package/src/components/User/DeviceSessions/DeviceSessions.tsx +11 -0
- package/src/components/User/ProfileUpdate/ProfileUpdate.tsx +263 -0
- package/src/components/User/WatchHistory/WatchHistory.tsx +1 -0
- package/src/components/User/WatchLater/WatchLater.tsx +1 -0
- package/src/components/User/components/UserAvatar.tsx +36 -3
- package/src/components/User/components/UserSection.tsx +10 -13
- package/src/components/User/index.ts +3 -1
- package/src/components/index.ts +1 -0
- package/src/hooks/useSplashCache.ts +166 -0
- package/src/store/RecentSearchesStore.ts +0 -1
- package/src/theme/ThemeProvider.tsx +12 -9
- package/src/theme/themes.ts +3 -0
- package/src/types/content/content-view.types.ts +1 -0
- package/src/utils/Formater.ts +14 -0
- package/lib/module/hooks/useInitSplashCacheSync.js +0 -116
- package/lib/module/hooks/useInitSplashCacheSync.js.map +0 -1
- package/lib/typescript/src/hooks/useInitSplashCacheSync.d.ts +0 -22
- package/lib/typescript/src/hooks/useInitSplashCacheSync.d.ts.map +0 -1
- package/src/hooks/useInitSplashCacheSync.ts +0 -174
- /package/lib/module/assets/{img → svg}/h.svg +0 -0
- /package/src/assets/{img → svg}/h.svg +0 -0
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author Naresh Dhamu
|
|
3
|
+
* @lastModified Fri 03 Oct 2025 at 01:09 PM
|
|
4
|
+
*/
|
|
5
|
+
import { useCallback } from 'react';
|
|
6
|
+
import {
|
|
7
|
+
View,
|
|
8
|
+
StyleSheet,
|
|
9
|
+
KeyboardAvoidingView,
|
|
10
|
+
Platform,
|
|
11
|
+
TouchableWithoutFeedback,
|
|
12
|
+
Keyboard,
|
|
13
|
+
TouchableOpacity,
|
|
14
|
+
} from 'react-native';
|
|
15
|
+
import { moderateScale, scale, verticalScale } from 'react-native-size-matters';
|
|
16
|
+
import { RFValue } from 'react-native-responsive-fontsize';
|
|
17
|
+
import { Camera } from 'lucide-react-native';
|
|
18
|
+
import { useForm, Controller } from 'react-hook-form';
|
|
19
|
+
import { Text } from '../../Text';
|
|
20
|
+
import AppHeader from '../../Headers/AppHeader';
|
|
21
|
+
import { useTheme } from '../../../theme/hook/useTheme';
|
|
22
|
+
import type { AppTheme } from '../../../theme/themes';
|
|
23
|
+
import UserAvatar from '../components/UserAvatar';
|
|
24
|
+
import { Input } from '../../Input/Input';
|
|
25
|
+
import { Button } from '../../Button';
|
|
26
|
+
import ImageCropPicker, { type Image } from 'react-native-image-crop-picker';
|
|
27
|
+
|
|
28
|
+
export type ProfileUpdateFormValues = {
|
|
29
|
+
fullName: string;
|
|
30
|
+
avatarFile?: Image;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export type ProfileUpdateProps = {
|
|
34
|
+
title?: string;
|
|
35
|
+
name?: string;
|
|
36
|
+
avatarUri?: string;
|
|
37
|
+
onBackPress?: () => void;
|
|
38
|
+
onSubmit?: (val: { fullName: string; avatarFile?: Image }) => void;
|
|
39
|
+
theme?: AppTheme;
|
|
40
|
+
loading?: boolean;
|
|
41
|
+
onError?: (error: { message: string }) => void;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export const ProfileUpdate = ({
|
|
45
|
+
title = 'My Profile',
|
|
46
|
+
name = '',
|
|
47
|
+
avatarUri = '',
|
|
48
|
+
onBackPress,
|
|
49
|
+
onSubmit,
|
|
50
|
+
theme,
|
|
51
|
+
loading = false,
|
|
52
|
+
onError,
|
|
53
|
+
}: ProfileUpdateProps) => {
|
|
54
|
+
const { theme: appliedTheme } = useTheme(theme);
|
|
55
|
+
const { colors } = appliedTheme;
|
|
56
|
+
|
|
57
|
+
const {
|
|
58
|
+
control,
|
|
59
|
+
handleSubmit,
|
|
60
|
+
formState: { errors },
|
|
61
|
+
trigger,
|
|
62
|
+
setValue,
|
|
63
|
+
watch,
|
|
64
|
+
} = useForm<ProfileUpdateFormValues>({
|
|
65
|
+
defaultValues: {
|
|
66
|
+
fullName: name,
|
|
67
|
+
avatarFile: avatarUri ? ({ path: avatarUri } as Image) : undefined,
|
|
68
|
+
},
|
|
69
|
+
mode: 'onChange',
|
|
70
|
+
reValidateMode: 'onBlur',
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
const avatar = watch('avatarFile');
|
|
74
|
+
|
|
75
|
+
const handlePickImage = async () => {
|
|
76
|
+
try {
|
|
77
|
+
const image = await ImageCropPicker.openPicker({
|
|
78
|
+
width: 400,
|
|
79
|
+
height: 400,
|
|
80
|
+
cropping: true,
|
|
81
|
+
showCropGuidelines: false,
|
|
82
|
+
cropperCircleOverlay: true,
|
|
83
|
+
showCropFrame: false,
|
|
84
|
+
compressImageQuality: 0.7,
|
|
85
|
+
mediaType: 'photo',
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
if (image?.path && image?.path !== '' && image.path !== avatarUri) {
|
|
89
|
+
setValue('avatarFile', image, {
|
|
90
|
+
shouldValidate: true,
|
|
91
|
+
shouldDirty: true,
|
|
92
|
+
});
|
|
93
|
+
} else {
|
|
94
|
+
onError?.({ message: 'No image selected' });
|
|
95
|
+
}
|
|
96
|
+
} catch (error) {
|
|
97
|
+
const message = (error as Error).message;
|
|
98
|
+
onError?.({ message });
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
const handleFormSubmit = useCallback(
|
|
103
|
+
(data: ProfileUpdateFormValues) => {
|
|
104
|
+
Keyboard.dismiss();
|
|
105
|
+
|
|
106
|
+
const hasNewAvatar =
|
|
107
|
+
data.avatarFile?.path && data.avatarFile.path !== avatarUri;
|
|
108
|
+
|
|
109
|
+
onSubmit?.({
|
|
110
|
+
fullName: data.fullName,
|
|
111
|
+
...(hasNewAvatar ? { avatarFile: data.avatarFile } : {}),
|
|
112
|
+
});
|
|
113
|
+
},
|
|
114
|
+
[avatarUri, onSubmit]
|
|
115
|
+
);
|
|
116
|
+
|
|
117
|
+
return (
|
|
118
|
+
<KeyboardAvoidingView
|
|
119
|
+
style={[styles.container, { backgroundColor: colors.background }]}
|
|
120
|
+
behavior={Platform.OS === 'ios' ? 'padding' : undefined}
|
|
121
|
+
>
|
|
122
|
+
<TouchableWithoutFeedback onPress={Keyboard.dismiss} accessible={false}>
|
|
123
|
+
<View style={{ flex: 1 }}>
|
|
124
|
+
<AppHeader
|
|
125
|
+
title={title}
|
|
126
|
+
onBackPress={onBackPress}
|
|
127
|
+
theme={appliedTheme}
|
|
128
|
+
titleAlign="left"
|
|
129
|
+
/>
|
|
130
|
+
|
|
131
|
+
<View style={styles.content}>
|
|
132
|
+
<View style={styles.avatarBox}>
|
|
133
|
+
<UserAvatar
|
|
134
|
+
avatarUri={avatar?.path}
|
|
135
|
+
theme={appliedTheme}
|
|
136
|
+
size={100}
|
|
137
|
+
/>
|
|
138
|
+
<TouchableOpacity
|
|
139
|
+
style={[
|
|
140
|
+
styles.cameraBtn,
|
|
141
|
+
{
|
|
142
|
+
borderColor: colors.button,
|
|
143
|
+
backgroundColor: colors.surfaceVariant,
|
|
144
|
+
shadowColor: colors.shadow || colors.surface,
|
|
145
|
+
},
|
|
146
|
+
]}
|
|
147
|
+
activeOpacity={0.8}
|
|
148
|
+
onPress={handlePickImage}
|
|
149
|
+
>
|
|
150
|
+
<Camera
|
|
151
|
+
size={moderateScale(13)}
|
|
152
|
+
color={colors.button}
|
|
153
|
+
strokeWidth={2}
|
|
154
|
+
/>
|
|
155
|
+
</TouchableOpacity>
|
|
156
|
+
</View>
|
|
157
|
+
|
|
158
|
+
<Text style={[styles.label, { color: colors.textPrimary }]}>
|
|
159
|
+
Basic Detail
|
|
160
|
+
</Text>
|
|
161
|
+
|
|
162
|
+
<View style={styles.formContainer}>
|
|
163
|
+
<Controller
|
|
164
|
+
control={control}
|
|
165
|
+
name="fullName"
|
|
166
|
+
rules={{
|
|
167
|
+
required: 'Name is required',
|
|
168
|
+
minLength: { value: 3, message: 'At least 3 characters' },
|
|
169
|
+
}}
|
|
170
|
+
render={({ field: { onChange, value, onBlur } }) => (
|
|
171
|
+
<View style={{ width: '100%' }}>
|
|
172
|
+
<Input.One
|
|
173
|
+
label="Full Name"
|
|
174
|
+
value={value}
|
|
175
|
+
onChangeText={(text) => {
|
|
176
|
+
onChange(text);
|
|
177
|
+
trigger('fullName');
|
|
178
|
+
}}
|
|
179
|
+
onBlur={onBlur}
|
|
180
|
+
placeholder={'Enter your full name'}
|
|
181
|
+
placeholderTextColor={colors.textDisabled}
|
|
182
|
+
containerStyle={{ marginTop: verticalScale(20) }}
|
|
183
|
+
theme={appliedTheme}
|
|
184
|
+
returnKeyType="done"
|
|
185
|
+
onSubmitEditing={handleSubmit(handleFormSubmit)}
|
|
186
|
+
/>
|
|
187
|
+
{errors.fullName && (
|
|
188
|
+
<Text style={[styles.errorText, { color: colors.error }]}>
|
|
189
|
+
{errors.fullName.message}
|
|
190
|
+
</Text>
|
|
191
|
+
)}
|
|
192
|
+
</View>
|
|
193
|
+
)}
|
|
194
|
+
/>
|
|
195
|
+
|
|
196
|
+
<Button.Primary
|
|
197
|
+
title={'Update Profile'}
|
|
198
|
+
onPress={handleSubmit(handleFormSubmit)}
|
|
199
|
+
theme={appliedTheme}
|
|
200
|
+
titleStyle={{ fontSize: RFValue(14) }}
|
|
201
|
+
loading={loading}
|
|
202
|
+
containerStyle={{ marginTop: verticalScale(5) }}
|
|
203
|
+
/>
|
|
204
|
+
</View>
|
|
205
|
+
</View>
|
|
206
|
+
</View>
|
|
207
|
+
</TouchableWithoutFeedback>
|
|
208
|
+
</KeyboardAvoidingView>
|
|
209
|
+
);
|
|
210
|
+
};
|
|
211
|
+
|
|
212
|
+
export default ProfileUpdate;
|
|
213
|
+
|
|
214
|
+
namespace ProfileUpdate {
|
|
215
|
+
export type Props = ProfileUpdateProps;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
const styles = StyleSheet.create({
|
|
219
|
+
container: { flex: 1 },
|
|
220
|
+
content: {
|
|
221
|
+
flex: 1,
|
|
222
|
+
alignItems: 'center',
|
|
223
|
+
padding: moderateScale(16),
|
|
224
|
+
},
|
|
225
|
+
avatarBox: {
|
|
226
|
+
marginVertical: verticalScale(20),
|
|
227
|
+
alignItems: 'center',
|
|
228
|
+
justifyContent: 'center',
|
|
229
|
+
},
|
|
230
|
+
cameraBtn: {
|
|
231
|
+
position: 'absolute',
|
|
232
|
+
bottom: scale(3),
|
|
233
|
+
right: scale(3),
|
|
234
|
+
padding: scale(2),
|
|
235
|
+
width: scale(23),
|
|
236
|
+
height: scale(23),
|
|
237
|
+
borderRadius: scale(13.5),
|
|
238
|
+
alignItems: 'center',
|
|
239
|
+
justifyContent: 'center',
|
|
240
|
+
borderWidth: 1,
|
|
241
|
+
elevation: 3,
|
|
242
|
+
shadowOffset: { width: 0, height: 1 },
|
|
243
|
+
shadowOpacity: 0.2,
|
|
244
|
+
shadowRadius: 1.5,
|
|
245
|
+
},
|
|
246
|
+
label: {
|
|
247
|
+
fontSize: RFValue(12),
|
|
248
|
+
fontWeight: '500',
|
|
249
|
+
alignSelf: 'flex-start',
|
|
250
|
+
margin: scale(5),
|
|
251
|
+
marginTop: verticalScale(10),
|
|
252
|
+
},
|
|
253
|
+
formContainer: {
|
|
254
|
+
width: '100%',
|
|
255
|
+
alignItems: 'center',
|
|
256
|
+
},
|
|
257
|
+
errorText: {
|
|
258
|
+
fontSize: RFValue(11),
|
|
259
|
+
marginTop: verticalScale(5),
|
|
260
|
+
marginLeft: scale(5),
|
|
261
|
+
alignSelf: 'flex-start',
|
|
262
|
+
},
|
|
263
|
+
});
|
|
@@ -116,6 +116,7 @@ export const WatchHistory: React.FC<WatchHistoryProps> = ({
|
|
|
116
116
|
activeOpacity={0.8}
|
|
117
117
|
>
|
|
118
118
|
<CardPoster
|
|
119
|
+
content_offering_type={item?.content?.content_offering_type}
|
|
119
120
|
theme={appliedTheme}
|
|
120
121
|
isLoading={isLoading}
|
|
121
122
|
posterUri={item?.content?.poster}
|
|
@@ -216,6 +216,7 @@ export const WatchLater: React.FC<WatchLaterProps> = ({
|
|
|
216
216
|
activeOpacity={0.8}
|
|
217
217
|
>
|
|
218
218
|
<CardPoster
|
|
219
|
+
content_offering_type={item?.content?.content_offering_type}
|
|
219
220
|
theme={appliedTheme}
|
|
220
221
|
isLoading={isLoading}
|
|
221
222
|
posterUri={item?.content?.poster}
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author Naresh Dhamu
|
|
3
|
+
* @lastModified Fri 17 Oct 2025 at 10:16 PM
|
|
4
|
+
*/
|
|
1
5
|
import React, { useState } from 'react';
|
|
2
6
|
import { Image, StyleSheet, View } from 'react-native';
|
|
7
|
+
import SkeletonPlaceholder from 'react-native-skeleton-placeholder';
|
|
3
8
|
import { scale } from 'react-native-size-matters';
|
|
4
9
|
import { useTheme } from '../../../theme/hook/useTheme';
|
|
5
10
|
import type { AppTheme } from '../../../theme/themes';
|
|
@@ -18,25 +23,53 @@ const UserAvatar: React.FC<UserAvatarProps> = ({
|
|
|
18
23
|
theme,
|
|
19
24
|
}) => {
|
|
20
25
|
const [imageError, setImageError] = useState(false);
|
|
26
|
+
const [loading, setLoading] = useState(!!avatarUri);
|
|
21
27
|
const { theme: appliedTheme } = useTheme(theme);
|
|
22
|
-
const borderColor = appliedTheme.colors.primary;
|
|
28
|
+
const borderColor = appliedTheme.colors.primary || '#ccc';
|
|
29
|
+
const skeletonBaseColor = appliedTheme.colors.skeletonBaseColor || '#E0E0E0';
|
|
30
|
+
const skeletonHighlightColor =
|
|
31
|
+
appliedTheme.colors.skeletonHighlightColor || '#F5F5F5';
|
|
23
32
|
|
|
24
33
|
return (
|
|
25
34
|
<View style={styles(size).wrapper}>
|
|
35
|
+
{loading && (
|
|
36
|
+
<SkeletonPlaceholder
|
|
37
|
+
backgroundColor={skeletonBaseColor}
|
|
38
|
+
highlightColor={skeletonHighlightColor}
|
|
39
|
+
borderRadius={size / 2}
|
|
40
|
+
>
|
|
41
|
+
<SkeletonPlaceholder.Item
|
|
42
|
+
width={size}
|
|
43
|
+
height={size}
|
|
44
|
+
borderRadius={size / 2}
|
|
45
|
+
/>
|
|
46
|
+
</SkeletonPlaceholder>
|
|
47
|
+
)}
|
|
48
|
+
|
|
26
49
|
<Image
|
|
27
50
|
source={imageError || !avatarUri ? fallbackAvatar : { uri: avatarUri }}
|
|
28
|
-
style={[styles(size).avatar, { borderColor }]}
|
|
29
|
-
onError={() =>
|
|
51
|
+
style={[styles(size).avatar, { borderColor, position: 'absolute' }]}
|
|
52
|
+
onError={() => {
|
|
53
|
+
setImageError(true);
|
|
54
|
+
setLoading(false);
|
|
55
|
+
}}
|
|
56
|
+
onLoadStart={() => setLoading(true)}
|
|
57
|
+
onLoadEnd={() => setLoading(false)}
|
|
30
58
|
/>
|
|
31
59
|
</View>
|
|
32
60
|
);
|
|
33
61
|
};
|
|
34
62
|
|
|
35
63
|
export default UserAvatar;
|
|
64
|
+
|
|
36
65
|
const styles = (size: number) =>
|
|
37
66
|
StyleSheet.create({
|
|
38
67
|
wrapper: {
|
|
68
|
+
width: size,
|
|
69
|
+
height: size,
|
|
39
70
|
position: 'relative',
|
|
71
|
+
justifyContent: 'center',
|
|
72
|
+
alignItems: 'center',
|
|
40
73
|
},
|
|
41
74
|
avatar: {
|
|
42
75
|
width: size,
|
|
@@ -80,7 +80,7 @@ const UserSection: React.FC<UserSectionProps> = ({
|
|
|
80
80
|
styles.editButton,
|
|
81
81
|
{
|
|
82
82
|
borderColor: appliedTheme.colors.primary,
|
|
83
|
-
backgroundColor: appliedTheme.colors.
|
|
83
|
+
backgroundColor: appliedTheme.colors.surfaceVariant,
|
|
84
84
|
shadowColor: appliedTheme.colors.surface,
|
|
85
85
|
},
|
|
86
86
|
]}
|
|
@@ -88,12 +88,10 @@ const UserSection: React.FC<UserSectionProps> = ({
|
|
|
88
88
|
color: appliedTheme.colors.surfaceDisabled,
|
|
89
89
|
}}
|
|
90
90
|
>
|
|
91
|
-
<
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
/>
|
|
96
|
-
</View>
|
|
91
|
+
<Edit3
|
|
92
|
+
size={moderateScale(13)}
|
|
93
|
+
color={appliedTheme.colors.primary}
|
|
94
|
+
/>
|
|
97
95
|
</Pressable>
|
|
98
96
|
)}
|
|
99
97
|
</>
|
|
@@ -143,8 +141,10 @@ const styles = {
|
|
|
143
141
|
position: 'absolute',
|
|
144
142
|
bottom: scale(2),
|
|
145
143
|
right: scale(2),
|
|
146
|
-
|
|
147
|
-
|
|
144
|
+
padding: scale(2),
|
|
145
|
+
width: scale(23),
|
|
146
|
+
height: scale(23),
|
|
147
|
+
overflow: 'hidden',
|
|
148
148
|
borderRadius: scale(11),
|
|
149
149
|
alignItems: 'center',
|
|
150
150
|
justifyContent: 'center',
|
|
@@ -154,10 +154,7 @@ const styles = {
|
|
|
154
154
|
shadowOpacity: 0.1,
|
|
155
155
|
shadowRadius: 0.5,
|
|
156
156
|
} as ViewStyle,
|
|
157
|
-
|
|
158
|
-
alignItems: 'center',
|
|
159
|
-
justifyContent: 'center',
|
|
160
|
-
} as ViewStyle,
|
|
157
|
+
|
|
161
158
|
editLabel: {
|
|
162
159
|
fontSize: RFValue(8),
|
|
163
160
|
marginTop: verticalScale(1),
|
|
@@ -6,4 +6,6 @@
|
|
|
6
6
|
import { WatchHistory } from './WatchHistory/WatchHistory';
|
|
7
7
|
import { WatchLater } from './WatchLater/WatchLater';
|
|
8
8
|
import { DeviceSessions } from './DeviceSessions/DeviceSessions';
|
|
9
|
-
|
|
9
|
+
import { ProfileUpdate } from './ProfileUpdate/ProfileUpdate';
|
|
10
|
+
|
|
11
|
+
export { WatchHistory, WatchLater, DeviceSessions, ProfileUpdate };
|
package/src/components/index.ts
CHANGED
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author Naresh
|
|
3
|
+
* @lastModified Fri 17 Oct 2025 at 09:55 PM
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { useEffect, useState } from 'react';
|
|
7
|
+
import RNFS from 'react-native-fs';
|
|
8
|
+
import CryptoJS from 'crypto-js';
|
|
9
|
+
import { MMKV } from 'react-native-mmkv';
|
|
10
|
+
import { useSplashStore } from '../store/splashStore';
|
|
11
|
+
|
|
12
|
+
const storage = new MMKV();
|
|
13
|
+
const activeDownloads = new Map<string, Promise<string | null>>();
|
|
14
|
+
|
|
15
|
+
const SUPPORTED_EXTENSIONS = [
|
|
16
|
+
'json',
|
|
17
|
+
'mp4',
|
|
18
|
+
'jpg',
|
|
19
|
+
'jpeg',
|
|
20
|
+
'png',
|
|
21
|
+
'webp',
|
|
22
|
+
] as const;
|
|
23
|
+
|
|
24
|
+
const getFileExtension = (url: string): string => {
|
|
25
|
+
try {
|
|
26
|
+
const cleanUrl = url.split('?')[0];
|
|
27
|
+
const ext = cleanUrl
|
|
28
|
+
?.substring(cleanUrl?.lastIndexOf('.') + 1)
|
|
29
|
+
.toLowerCase();
|
|
30
|
+
return SUPPORTED_EXTENSIONS.includes(ext as any) ? (ext as string) : 'png';
|
|
31
|
+
} catch {
|
|
32
|
+
return 'png';
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
const downloadAndCacheAsset = async (
|
|
37
|
+
url: string,
|
|
38
|
+
extension: string,
|
|
39
|
+
cacheKey: string,
|
|
40
|
+
force: boolean
|
|
41
|
+
): Promise<string | null> => {
|
|
42
|
+
if (!url?.trim()) return null;
|
|
43
|
+
|
|
44
|
+
const ext = extension.replace(/^\./, '') || 'png';
|
|
45
|
+
const hash = CryptoJS.MD5(`${url}|${cacheKey}|${ext}`).toString();
|
|
46
|
+
const localFile = `${RNFS.CachesDirectoryPath}/splash_${hash}.${ext}`;
|
|
47
|
+
|
|
48
|
+
if (activeDownloads.has(hash)) {
|
|
49
|
+
return activeDownloads.get(hash)!;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
const task = (async () => {
|
|
53
|
+
try {
|
|
54
|
+
const savedHash = storage.getString(cacheKey);
|
|
55
|
+
|
|
56
|
+
if (savedHash && savedHash !== hash) {
|
|
57
|
+
const oldFile = `${RNFS.CachesDirectoryPath}/splash_${savedHash}.${ext}`;
|
|
58
|
+
if (await RNFS.exists(oldFile)) {
|
|
59
|
+
await RNFS.unlink(oldFile).catch(() => {});
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
if (!force) {
|
|
64
|
+
const exists = await RNFS.exists(localFile);
|
|
65
|
+
if (exists && savedHash === hash) {
|
|
66
|
+
return localFile;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
const { statusCode } = await RNFS.downloadFile({
|
|
71
|
+
fromUrl: url,
|
|
72
|
+
toFile: localFile,
|
|
73
|
+
cacheable: true,
|
|
74
|
+
readTimeout: 15000,
|
|
75
|
+
connectionTimeout: 10000,
|
|
76
|
+
}).promise;
|
|
77
|
+
|
|
78
|
+
if (statusCode === 200) {
|
|
79
|
+
storage.set(cacheKey, hash);
|
|
80
|
+
return localFile;
|
|
81
|
+
}
|
|
82
|
+
} catch {
|
|
83
|
+
return null;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
return null;
|
|
87
|
+
})();
|
|
88
|
+
|
|
89
|
+
activeDownloads.set(hash, task);
|
|
90
|
+
return task;
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
type SplashCacheOptions = {
|
|
94
|
+
logoUrl?: string;
|
|
95
|
+
backgroundUrl?: string;
|
|
96
|
+
forceDownload?: boolean;
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
export const useSplashCache = ({
|
|
100
|
+
logoUrl,
|
|
101
|
+
backgroundUrl,
|
|
102
|
+
forceDownload = false,
|
|
103
|
+
}: SplashCacheOptions) => {
|
|
104
|
+
const [state, setState] = useState({
|
|
105
|
+
isReady: false,
|
|
106
|
+
error: null as Error | null,
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
const setLogo = useSplashStore((s) => s.setLogoPath);
|
|
110
|
+
const setBackground = useSplashStore((s) => s.setBackdropPath);
|
|
111
|
+
|
|
112
|
+
useEffect(() => {
|
|
113
|
+
let mounted = true;
|
|
114
|
+
|
|
115
|
+
const syncAssets = async () => {
|
|
116
|
+
try {
|
|
117
|
+
const [logoPath, bgPath] = await Promise.all([
|
|
118
|
+
logoUrl
|
|
119
|
+
? downloadAndCacheAsset(
|
|
120
|
+
logoUrl,
|
|
121
|
+
getFileExtension(logoUrl),
|
|
122
|
+
'splash_logo',
|
|
123
|
+
forceDownload
|
|
124
|
+
)
|
|
125
|
+
: Promise.resolve(null),
|
|
126
|
+
backgroundUrl
|
|
127
|
+
? downloadAndCacheAsset(
|
|
128
|
+
backgroundUrl,
|
|
129
|
+
getFileExtension(backgroundUrl),
|
|
130
|
+
'splash_background',
|
|
131
|
+
forceDownload
|
|
132
|
+
)
|
|
133
|
+
: Promise.resolve(null),
|
|
134
|
+
]);
|
|
135
|
+
|
|
136
|
+
if (!mounted) return;
|
|
137
|
+
|
|
138
|
+
if (logoPath) setLogo?.(logoPath);
|
|
139
|
+
if (bgPath) setBackground?.(bgPath);
|
|
140
|
+
|
|
141
|
+
setState({ isReady: true, error: null });
|
|
142
|
+
} catch (err) {
|
|
143
|
+
if (mounted) {
|
|
144
|
+
setState({ isReady: true, error: err as Error });
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
syncAssets();
|
|
150
|
+
return () => {
|
|
151
|
+
mounted = false;
|
|
152
|
+
};
|
|
153
|
+
}, [logoUrl, backgroundUrl, forceDownload, setLogo, setBackground]);
|
|
154
|
+
|
|
155
|
+
const logoPath = useSplashStore((s) => s.logo.localPath);
|
|
156
|
+
const bgPath = useSplashStore((s) => s.backdrop.localPath);
|
|
157
|
+
|
|
158
|
+
return {
|
|
159
|
+
state,
|
|
160
|
+
isLoading: !state.isReady && !state.error,
|
|
161
|
+
data: {
|
|
162
|
+
logoPath,
|
|
163
|
+
backgroundPath: bgPath,
|
|
164
|
+
},
|
|
165
|
+
};
|
|
166
|
+
};
|
|
@@ -68,7 +68,6 @@ export const useRecentSearchesStore = create<RecentSearchesState>()(
|
|
|
68
68
|
if (hasData) {
|
|
69
69
|
setTimeout(() => {
|
|
70
70
|
useRecentSearchesStore.setState({ isLoading: false });
|
|
71
|
-
console.log('🔄 Zustand store rehydrated');
|
|
72
71
|
}, 50);
|
|
73
72
|
} else {
|
|
74
73
|
useRecentSearchesStore.setState({ isLoading: false });
|
|
@@ -17,6 +17,7 @@ import {
|
|
|
17
17
|
initialWindowMetrics,
|
|
18
18
|
} from 'react-native-safe-area-context';
|
|
19
19
|
import { LightTheme, DarkTheme, type ITheme, type AppTheme } from './themes';
|
|
20
|
+
import { GestureHandlerRootView } from 'react-native-gesture-handler';
|
|
20
21
|
|
|
21
22
|
type ThemeContextType = {
|
|
22
23
|
theme: ITheme;
|
|
@@ -124,14 +125,16 @@ export const ZezoUIProvider: React.FC<ZezoUIProviderProps> = ({
|
|
|
124
125
|
);
|
|
125
126
|
|
|
126
127
|
return (
|
|
127
|
-
<
|
|
128
|
-
<
|
|
129
|
-
<
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
128
|
+
<GestureHandlerRootView>
|
|
129
|
+
<SafeAreaProvider initialMetrics={initialWindowMetrics}>
|
|
130
|
+
<ThemeContext.Provider value={contextValue}>
|
|
131
|
+
<View
|
|
132
|
+
style={{ flex: 1, backgroundColor: mergedTheme.colors.background }}
|
|
133
|
+
>
|
|
134
|
+
{children}
|
|
135
|
+
</View>
|
|
136
|
+
</ThemeContext.Provider>
|
|
137
|
+
</SafeAreaProvider>
|
|
138
|
+
</GestureHandlerRootView>
|
|
136
139
|
);
|
|
137
140
|
};
|
package/src/theme/themes.ts
CHANGED
|
@@ -51,6 +51,7 @@ export type BaseColors = {
|
|
|
51
51
|
shadow: string;
|
|
52
52
|
scrim: string;
|
|
53
53
|
backdrop: string;
|
|
54
|
+
overlay: string;
|
|
54
55
|
|
|
55
56
|
inverseSurface: string;
|
|
56
57
|
inverseOnSurface: string;
|
|
@@ -140,6 +141,7 @@ export const LightTheme: ITheme = {
|
|
|
140
141
|
shadow: 'rgba(0, 0, 0, 0.1)',
|
|
141
142
|
scrim: 'rgba(0, 0, 0, 0.2)',
|
|
142
143
|
backdrop: 'rgba(243, 244, 246, 0.7)',
|
|
144
|
+
overlay: 'rgba(0,0,0,0.55)',
|
|
143
145
|
|
|
144
146
|
inverseSurface: 'rgba(31, 41, 55, 1)',
|
|
145
147
|
inverseOnSurface: 'rgba(249, 250, 251, 1)',
|
|
@@ -241,6 +243,7 @@ export const DarkTheme: ITheme = {
|
|
|
241
243
|
shadow: 'rgba(0, 0, 0, 0.5)',
|
|
242
244
|
scrim: 'rgba(0, 0, 0, 0.4)',
|
|
243
245
|
backdrop: 'rgba(30, 41, 59, 0.7)',
|
|
246
|
+
overlay: 'rgba(0,0,0,0.55)',
|
|
244
247
|
|
|
245
248
|
inverseSurface: 'rgba(229, 231, 235, 1)',
|
|
246
249
|
inverseOnSurface: 'rgba(31, 41, 55, 1)',
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export function formatCount(count: number): string {
|
|
2
|
+
if (count < 1000) {
|
|
3
|
+
return count.toString();
|
|
4
|
+
} else if (count < 1000000) {
|
|
5
|
+
const thousands = count / 1000;
|
|
6
|
+
return thousands % 1 === 0 ? `${thousands}K` : `${thousands.toFixed(1)}K`;
|
|
7
|
+
} else if (count < 1000000000) {
|
|
8
|
+
const millions = count / 1000000;
|
|
9
|
+
return millions % 1 === 0 ? `${millions}M` : `${millions.toFixed(1)}M`;
|
|
10
|
+
} else {
|
|
11
|
+
const billions = count / 1000000000;
|
|
12
|
+
return billions % 1 === 0 ? `${billions}B` : `${billions.toFixed(1)}B`;
|
|
13
|
+
}
|
|
14
|
+
}
|