@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,418 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @author Naresh Dhamu
|
|
3
|
-
* @lastModified Mon 16 Jun 2025 at 12:35 PM
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import React, {
|
|
7
|
-
useRef,
|
|
8
|
-
useState,
|
|
9
|
-
useCallback,
|
|
10
|
-
useMemo,
|
|
11
|
-
useEffect,
|
|
12
|
-
} from 'react';
|
|
13
|
-
import {
|
|
14
|
-
StyleSheet,
|
|
15
|
-
View,
|
|
16
|
-
Text,
|
|
17
|
-
Animated,
|
|
18
|
-
type AccessibilityProps,
|
|
19
|
-
type TextStyle,
|
|
20
|
-
type ViewStyle,
|
|
21
|
-
} from 'react-native';
|
|
22
|
-
import PhoneInput from 'react-native-phone-number-input';
|
|
23
|
-
import { scale, verticalScale, moderateScale } from 'react-native-size-matters';
|
|
24
|
-
import { ChevronDown } from 'lucide-react-native';
|
|
25
|
-
import { getExampleNumber } from 'libphonenumber-js';
|
|
26
|
-
import examples from 'libphonenumber-js/mobile/examples';
|
|
27
|
-
import { parsePhoneNumberFromString } from 'libphonenumber-js';
|
|
28
|
-
import debounce from 'lodash.debounce';
|
|
29
|
-
import { useInternalTheme } from '../../theme/hook/useInternalTheme';
|
|
30
|
-
import type { ThemeOverride } from '../../theme/themes';
|
|
31
|
-
import { RFValue } from 'react-native-responsive-fontsize';
|
|
32
|
-
|
|
33
|
-
export interface PhoneNumberInputProps extends Pick<
|
|
34
|
-
AccessibilityProps,
|
|
35
|
-
'accessibilityLabel' | 'accessibilityHint'
|
|
36
|
-
> {
|
|
37
|
-
value: string;
|
|
38
|
-
onChangeText: (params: {
|
|
39
|
-
fullNumber: string;
|
|
40
|
-
countryCode: string;
|
|
41
|
-
formattedNumber: string;
|
|
42
|
-
}) => void;
|
|
43
|
-
label?: string;
|
|
44
|
-
placeholder?: string;
|
|
45
|
-
error?: boolean;
|
|
46
|
-
errorMessage?: string;
|
|
47
|
-
inputStyle?: TextStyle;
|
|
48
|
-
containerStyle?: ViewStyle;
|
|
49
|
-
theme?: ThemeOverride;
|
|
50
|
-
disabled?: boolean;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
const getMaxLengthForCountry = (
|
|
54
|
-
countryCode: string,
|
|
55
|
-
defaultMaxLength: number
|
|
56
|
-
): number => {
|
|
57
|
-
try {
|
|
58
|
-
const example = getExampleNumber(
|
|
59
|
-
countryCode as keyof typeof examples,
|
|
60
|
-
examples
|
|
61
|
-
);
|
|
62
|
-
return example?.nationalNumber?.length ?? defaultMaxLength;
|
|
63
|
-
} catch (error) {
|
|
64
|
-
console.warn(`Failed to get max length for country ${countryCode}:`, error);
|
|
65
|
-
return defaultMaxLength;
|
|
66
|
-
}
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
const PhoneNumberInputTwo: React.FC<PhoneNumberInputProps> = ({
|
|
70
|
-
value = '',
|
|
71
|
-
onChangeText,
|
|
72
|
-
label,
|
|
73
|
-
placeholder = 'Phone Number',
|
|
74
|
-
error = false,
|
|
75
|
-
errorMessage,
|
|
76
|
-
inputStyle,
|
|
77
|
-
containerStyle,
|
|
78
|
-
theme: propTheme,
|
|
79
|
-
accessibilityLabel = label || 'Phone number input',
|
|
80
|
-
accessibilityHint,
|
|
81
|
-
disabled = false,
|
|
82
|
-
}) => {
|
|
83
|
-
const phoneInputRef = useRef<PhoneInput>(null);
|
|
84
|
-
const { theme: appliedTheme, isDarkMode } = useInternalTheme(propTheme);
|
|
85
|
-
const { textPrimary, textDisabled, error: errorColor } = appliedTheme.colors;
|
|
86
|
-
|
|
87
|
-
const [inputError, setInputError] = useState<string | null>(null);
|
|
88
|
-
const [, setIsFocused] = useState<boolean>(false);
|
|
89
|
-
const errorAnimation = useRef(new Animated.Value(0)).current;
|
|
90
|
-
|
|
91
|
-
// ✅ Hard set country to India
|
|
92
|
-
useEffect(() => {
|
|
93
|
-
phoneInputRef.current?.getCountryCode();
|
|
94
|
-
}, []);
|
|
95
|
-
|
|
96
|
-
useEffect(() => {
|
|
97
|
-
if (inputError || error) {
|
|
98
|
-
Animated.timing(errorAnimation, {
|
|
99
|
-
toValue: 1,
|
|
100
|
-
duration: 300,
|
|
101
|
-
useNativeDriver: true,
|
|
102
|
-
}).start();
|
|
103
|
-
} else {
|
|
104
|
-
Animated.timing(errorAnimation, {
|
|
105
|
-
toValue: 0,
|
|
106
|
-
duration: 300,
|
|
107
|
-
useNativeDriver: true,
|
|
108
|
-
}).start();
|
|
109
|
-
}
|
|
110
|
-
}, [inputError, error, errorAnimation]);
|
|
111
|
-
|
|
112
|
-
const validatePhoneNumber = useCallback(
|
|
113
|
-
(formattedText: string, inputCallingCode: string) => {
|
|
114
|
-
const rawInput = formattedText.replace(/[^\d]/g, '');
|
|
115
|
-
const fullRawNumber = `+${inputCallingCode}${rawInput}`;
|
|
116
|
-
const parsedNumber = parsePhoneNumberFromString(fullRawNumber);
|
|
117
|
-
const maxLength = getMaxLengthForCountry('IN', 10);
|
|
118
|
-
|
|
119
|
-
if (!rawInput) {
|
|
120
|
-
setInputError(null);
|
|
121
|
-
onChangeText({
|
|
122
|
-
fullNumber: '',
|
|
123
|
-
formattedNumber: formattedText,
|
|
124
|
-
countryCode: inputCallingCode,
|
|
125
|
-
});
|
|
126
|
-
return;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
if (!parsedNumber || !inputCallingCode) {
|
|
130
|
-
setInputError('Invalid phone number format');
|
|
131
|
-
onChangeText({
|
|
132
|
-
fullNumber: '',
|
|
133
|
-
formattedNumber: formattedText,
|
|
134
|
-
countryCode: inputCallingCode,
|
|
135
|
-
});
|
|
136
|
-
return;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
if (rawInput.length > maxLength) {
|
|
140
|
-
setInputError(`Phone number must not exceed ${maxLength} digits`);
|
|
141
|
-
onChangeText({
|
|
142
|
-
fullNumber: '',
|
|
143
|
-
formattedNumber: formattedText,
|
|
144
|
-
countryCode: inputCallingCode,
|
|
145
|
-
});
|
|
146
|
-
return;
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
if (rawInput.length < maxLength) {
|
|
150
|
-
setInputError(`Phone number must be at least ${maxLength} digits`);
|
|
151
|
-
onChangeText({
|
|
152
|
-
fullNumber: '',
|
|
153
|
-
formattedNumber: formattedText,
|
|
154
|
-
countryCode: inputCallingCode,
|
|
155
|
-
});
|
|
156
|
-
return;
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
const isValid = parsedNumber.isValid();
|
|
160
|
-
const e164 = parsedNumber.number;
|
|
161
|
-
|
|
162
|
-
if (isValid && e164) {
|
|
163
|
-
setInputError(null);
|
|
164
|
-
onChangeText({
|
|
165
|
-
fullNumber: e164,
|
|
166
|
-
formattedNumber: formattedText,
|
|
167
|
-
countryCode: inputCallingCode,
|
|
168
|
-
});
|
|
169
|
-
} else {
|
|
170
|
-
setInputError('Please enter a valid phone number');
|
|
171
|
-
onChangeText({
|
|
172
|
-
fullNumber: '',
|
|
173
|
-
formattedNumber: formattedText,
|
|
174
|
-
countryCode: inputCallingCode,
|
|
175
|
-
});
|
|
176
|
-
}
|
|
177
|
-
},
|
|
178
|
-
[onChangeText]
|
|
179
|
-
);
|
|
180
|
-
|
|
181
|
-
const phoneTextColor = useMemo(
|
|
182
|
-
() =>
|
|
183
|
-
disabled ? textDisabled : inputError || error ? errorColor : textPrimary,
|
|
184
|
-
[disabled, inputError, error, textDisabled, errorColor, textPrimary]
|
|
185
|
-
);
|
|
186
|
-
|
|
187
|
-
const debouncedHandlePhoneChange = useMemo(
|
|
188
|
-
() =>
|
|
189
|
-
debounce((formattedText: string) => {
|
|
190
|
-
const currentCallingCode = phoneInputRef.current?.getCallingCode();
|
|
191
|
-
validatePhoneNumber(formattedText, currentCallingCode || '');
|
|
192
|
-
}, 300),
|
|
193
|
-
[validatePhoneNumber]
|
|
194
|
-
);
|
|
195
|
-
|
|
196
|
-
useEffect(() => {
|
|
197
|
-
return () => {
|
|
198
|
-
debouncedHandlePhoneChange.cancel();
|
|
199
|
-
};
|
|
200
|
-
}, [debouncedHandlePhoneChange]);
|
|
201
|
-
|
|
202
|
-
const maxLength = useMemo(() => getMaxLengthForCountry('IN', 10), []);
|
|
203
|
-
|
|
204
|
-
const wrapperBackgroundColor = useMemo(() => {
|
|
205
|
-
if (disabled) return appliedTheme.colors.backgroundDisabled;
|
|
206
|
-
if (inputError || error) return appliedTheme.colors.errorContainer;
|
|
207
|
-
|
|
208
|
-
return isDarkMode
|
|
209
|
-
? 'rgba(255, 255, 255, 0.2)'
|
|
210
|
-
: 'rgba(255, 255, 255, 0.24)';
|
|
211
|
-
}, [disabled, inputError, error, isDarkMode, appliedTheme.colors]);
|
|
212
|
-
|
|
213
|
-
const borderColor = useMemo(() => {
|
|
214
|
-
if (disabled) return appliedTheme.colors.outlineDisabled;
|
|
215
|
-
if (inputError || error) return errorColor;
|
|
216
|
-
|
|
217
|
-
return isDarkMode ? 'rgba(255,255,255,0.50)' : 'rgba(255,255,255,0.9)';
|
|
218
|
-
}, [
|
|
219
|
-
disabled,
|
|
220
|
-
appliedTheme.colors.outlineDisabled,
|
|
221
|
-
inputError,
|
|
222
|
-
error,
|
|
223
|
-
errorColor,
|
|
224
|
-
isDarkMode,
|
|
225
|
-
]);
|
|
226
|
-
|
|
227
|
-
const inputWrapperStyle = useMemo(
|
|
228
|
-
() => [
|
|
229
|
-
styles.inputWrapper,
|
|
230
|
-
{
|
|
231
|
-
backgroundColor: wrapperBackgroundColor,
|
|
232
|
-
borderColor,
|
|
233
|
-
borderWidth: scale(1.2),
|
|
234
|
-
|
|
235
|
-
shadowColor: isDarkMode ? 'transparent' : '#000',
|
|
236
|
-
shadowOpacity: isDarkMode ? 0 : 0.12,
|
|
237
|
-
shadowRadius: 10,
|
|
238
|
-
shadowOffset: { width: 0, height: 6 },
|
|
239
|
-
elevation: isDarkMode ? 0 : 4,
|
|
240
|
-
},
|
|
241
|
-
],
|
|
242
|
-
[wrapperBackgroundColor, borderColor, isDarkMode]
|
|
243
|
-
);
|
|
244
|
-
|
|
245
|
-
const computedAccessibilityLabel = useMemo(
|
|
246
|
-
() =>
|
|
247
|
-
`${accessibilityLabel}, country code: +91${inputError || error ? `, error: ${inputError || errorMessage || 'Invalid phone number'}` : ''}`,
|
|
248
|
-
[accessibilityLabel, inputError, error, errorMessage]
|
|
249
|
-
);
|
|
250
|
-
|
|
251
|
-
return (
|
|
252
|
-
<Animated.View
|
|
253
|
-
style={[
|
|
254
|
-
styles.container,
|
|
255
|
-
containerStyle,
|
|
256
|
-
{
|
|
257
|
-
opacity: errorAnimation.interpolate({
|
|
258
|
-
inputRange: [0, 1],
|
|
259
|
-
outputRange: [1, 0.95],
|
|
260
|
-
}),
|
|
261
|
-
},
|
|
262
|
-
]}
|
|
263
|
-
>
|
|
264
|
-
{label && (
|
|
265
|
-
<View
|
|
266
|
-
style={[
|
|
267
|
-
styles.labelContainer,
|
|
268
|
-
{ backgroundColor: appliedTheme.colors.background },
|
|
269
|
-
]}
|
|
270
|
-
/>
|
|
271
|
-
)}
|
|
272
|
-
<View style={inputWrapperStyle}>
|
|
273
|
-
<PhoneInput
|
|
274
|
-
ref={phoneInputRef}
|
|
275
|
-
defaultCode="IN"
|
|
276
|
-
layout="second"
|
|
277
|
-
value={value}
|
|
278
|
-
onChangeText={debouncedHandlePhoneChange}
|
|
279
|
-
flagButtonStyle={styles.flagButtonStyle}
|
|
280
|
-
withShadow={false}
|
|
281
|
-
autoFocus={false}
|
|
282
|
-
disabled={disabled}
|
|
283
|
-
placeholder={placeholder}
|
|
284
|
-
containerStyle={[
|
|
285
|
-
styles.phoneInputContainer,
|
|
286
|
-
{ backgroundColor: 'transparent' },
|
|
287
|
-
]}
|
|
288
|
-
textContainerStyle={[
|
|
289
|
-
styles.phoneInputTextContainer,
|
|
290
|
-
{ backgroundColor: 'transparent' },
|
|
291
|
-
]}
|
|
292
|
-
textInputStyle={[
|
|
293
|
-
styles.textInput,
|
|
294
|
-
{ color: phoneTextColor, backgroundColor: 'transparent' },
|
|
295
|
-
inputStyle,
|
|
296
|
-
]}
|
|
297
|
-
codeTextStyle={[styles.codeTextStyle, { color: 'white' }]}
|
|
298
|
-
countryPickerButtonStyle={[
|
|
299
|
-
styles.countryPickerButtonStyle,
|
|
300
|
-
{ backgroundColor: 'transparent' },
|
|
301
|
-
]}
|
|
302
|
-
renderDropdownImage={<ChevronDown color={'white'} size={scale(18)} />}
|
|
303
|
-
textInputProps={{
|
|
304
|
-
keyboardType: 'numeric',
|
|
305
|
-
maxLength,
|
|
306
|
-
placeholderTextColor: disabled
|
|
307
|
-
? appliedTheme.colors.textDisabled
|
|
308
|
-
: appliedTheme.colors.textSecondary,
|
|
309
|
-
accessibilityLabel: computedAccessibilityLabel,
|
|
310
|
-
accessibilityHint,
|
|
311
|
-
cursorColor:
|
|
312
|
-
inputError || error
|
|
313
|
-
? appliedTheme.colors.onErrorContainer
|
|
314
|
-
: appliedTheme.colors.primary,
|
|
315
|
-
selectionColor:
|
|
316
|
-
inputError || error
|
|
317
|
-
? appliedTheme.colors.onErrorContainer
|
|
318
|
-
: appliedTheme.colors.primary,
|
|
319
|
-
onFocus: () => setIsFocused(true),
|
|
320
|
-
onBlur: () => setIsFocused(false),
|
|
321
|
-
}}
|
|
322
|
-
withDarkTheme={isDarkMode}
|
|
323
|
-
/>
|
|
324
|
-
</View>
|
|
325
|
-
{(error || inputError) && (
|
|
326
|
-
<Text
|
|
327
|
-
style={[
|
|
328
|
-
styles.errorText,
|
|
329
|
-
{ color: appliedTheme.colors.onErrorContainer },
|
|
330
|
-
]}
|
|
331
|
-
>
|
|
332
|
-
{inputError || errorMessage || 'Invalid phone number'}
|
|
333
|
-
</Text>
|
|
334
|
-
)}
|
|
335
|
-
</Animated.View>
|
|
336
|
-
);
|
|
337
|
-
};
|
|
338
|
-
|
|
339
|
-
export default React.memo(PhoneNumberInputTwo);
|
|
340
|
-
|
|
341
|
-
const styles = StyleSheet.create({
|
|
342
|
-
container: {
|
|
343
|
-
width: '100%',
|
|
344
|
-
marginBottom: verticalScale(16),
|
|
345
|
-
},
|
|
346
|
-
labelContainer: {
|
|
347
|
-
position: 'absolute',
|
|
348
|
-
top: -verticalScale(7),
|
|
349
|
-
left: scale(12),
|
|
350
|
-
zIndex: 1,
|
|
351
|
-
paddingHorizontal: scale(6),
|
|
352
|
-
borderRadius: scale(4),
|
|
353
|
-
},
|
|
354
|
-
label: {
|
|
355
|
-
fontSize: RFValue(10),
|
|
356
|
-
fontWeight: '500',
|
|
357
|
-
letterSpacing: 0.3,
|
|
358
|
-
},
|
|
359
|
-
inputWrapper: {
|
|
360
|
-
width: '100%',
|
|
361
|
-
height: verticalScale(50),
|
|
362
|
-
borderRadius: moderateScale(8),
|
|
363
|
-
paddingHorizontal: scale(8),
|
|
364
|
-
flexDirection: 'row',
|
|
365
|
-
alignItems: 'center',
|
|
366
|
-
shadowColor: 'transparent',
|
|
367
|
-
shadowOffset: { width: 0, height: 0 },
|
|
368
|
-
shadowOpacity: 0,
|
|
369
|
-
shadowRadius: 0,
|
|
370
|
-
elevation: 0,
|
|
371
|
-
},
|
|
372
|
-
flagButtonStyle: {
|
|
373
|
-
justifyContent: 'center',
|
|
374
|
-
alignItems: 'center',
|
|
375
|
-
marginRight: scale(4),
|
|
376
|
-
},
|
|
377
|
-
phoneInputContainer: {
|
|
378
|
-
flex: 1,
|
|
379
|
-
borderWidth: 0,
|
|
380
|
-
elevation: 0,
|
|
381
|
-
},
|
|
382
|
-
phoneInputTextContainer: {
|
|
383
|
-
flex: 1,
|
|
384
|
-
flexDirection: 'row',
|
|
385
|
-
alignItems: 'center',
|
|
386
|
-
justifyContent: 'flex-start',
|
|
387
|
-
paddingVertical: 0,
|
|
388
|
-
paddingHorizontal: scale(4),
|
|
389
|
-
},
|
|
390
|
-
textInput: {
|
|
391
|
-
flex: 1,
|
|
392
|
-
fontSize: RFValue(16),
|
|
393
|
-
padding: 0,
|
|
394
|
-
fontWeight: '400',
|
|
395
|
-
},
|
|
396
|
-
codeTextStyle: {
|
|
397
|
-
fontSize: RFValue(16),
|
|
398
|
-
marginLeft: scale(4),
|
|
399
|
-
fontWeight: '500',
|
|
400
|
-
},
|
|
401
|
-
countryPickerButtonStyle: {
|
|
402
|
-
flexDirection: 'row',
|
|
403
|
-
alignItems: 'center',
|
|
404
|
-
justifyContent: 'center',
|
|
405
|
-
height: verticalScale(42),
|
|
406
|
-
paddingHorizontal: scale(8),
|
|
407
|
-
borderRightWidth: 0.8,
|
|
408
|
-
borderRightColor: '#D0D0D0',
|
|
409
|
-
},
|
|
410
|
-
|
|
411
|
-
errorText: {
|
|
412
|
-
fontSize: RFValue(10),
|
|
413
|
-
marginTop: verticalScale(8),
|
|
414
|
-
marginLeft: scale(12),
|
|
415
|
-
fontWeight: '400',
|
|
416
|
-
opacity: 0.9,
|
|
417
|
-
},
|
|
418
|
-
});
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @author Naresh Dhamu
|
|
3
|
-
* @lastModified Fri 08 Aug 2025 at 08:14 AM
|
|
4
|
-
*/
|
|
5
|
-
import React, { useEffect, useRef } from 'react';
|
|
6
|
-
import {
|
|
7
|
-
TouchableWithoutFeedback,
|
|
8
|
-
Keyboard,
|
|
9
|
-
KeyboardAvoidingView,
|
|
10
|
-
StyleSheet,
|
|
11
|
-
Animated,
|
|
12
|
-
Platform,
|
|
13
|
-
StatusBar,
|
|
14
|
-
type ViewStyle,
|
|
15
|
-
} from 'react-native';
|
|
16
|
-
import { scale } from 'react-native-size-matters';
|
|
17
|
-
|
|
18
|
-
interface HideKeyboardProps {
|
|
19
|
-
children: React.ReactNode;
|
|
20
|
-
containerStyle?: ViewStyle;
|
|
21
|
-
behavior?: 'padding' | 'height' | 'position';
|
|
22
|
-
keyboardVerticalOffset?: number;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
const HideKeyboard: React.FC<HideKeyboardProps> = ({
|
|
26
|
-
children,
|
|
27
|
-
containerStyle,
|
|
28
|
-
behavior = 'padding',
|
|
29
|
-
keyboardVerticalOffset = scale(-160),
|
|
30
|
-
}) => {
|
|
31
|
-
const fadeAnim = useRef(new Animated.Value(1)).current;
|
|
32
|
-
|
|
33
|
-
// Platform-based offset
|
|
34
|
-
const offset =
|
|
35
|
-
keyboardVerticalOffset ??
|
|
36
|
-
(Platform.OS === 'ios' ? 0 : (StatusBar.currentHeight ?? 0));
|
|
37
|
-
|
|
38
|
-
useEffect(() => {
|
|
39
|
-
const showEvent =
|
|
40
|
-
Platform.OS === 'ios' ? 'keyboardWillShow' : 'keyboardDidShow';
|
|
41
|
-
const hideEvent =
|
|
42
|
-
Platform.OS === 'ios' ? 'keyboardWillHide' : 'keyboardDidHide';
|
|
43
|
-
|
|
44
|
-
const showSub = Keyboard.addListener(showEvent, () => {
|
|
45
|
-
Animated.timing(fadeAnim, {
|
|
46
|
-
toValue: 0.98,
|
|
47
|
-
duration: 250,
|
|
48
|
-
useNativeDriver: true,
|
|
49
|
-
}).start();
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
const hideSub = Keyboard.addListener(hideEvent, () => {
|
|
53
|
-
Animated.timing(fadeAnim, {
|
|
54
|
-
toValue: 1,
|
|
55
|
-
duration: 250,
|
|
56
|
-
useNativeDriver: true,
|
|
57
|
-
}).start();
|
|
58
|
-
});
|
|
59
|
-
|
|
60
|
-
return () => {
|
|
61
|
-
showSub.remove();
|
|
62
|
-
hideSub.remove();
|
|
63
|
-
};
|
|
64
|
-
}, [fadeAnim]);
|
|
65
|
-
|
|
66
|
-
return (
|
|
67
|
-
<KeyboardAvoidingView
|
|
68
|
-
style={[styles.keyboardAvoidingView, containerStyle]}
|
|
69
|
-
behavior={behavior}
|
|
70
|
-
keyboardVerticalOffset={offset}
|
|
71
|
-
>
|
|
72
|
-
<TouchableWithoutFeedback onPress={Keyboard.dismiss} accessible={false}>
|
|
73
|
-
<Animated.View style={{ flex: 1, transform: [{ scale: fadeAnim }] }}>
|
|
74
|
-
{children}
|
|
75
|
-
</Animated.View>
|
|
76
|
-
</TouchableWithoutFeedback>
|
|
77
|
-
</KeyboardAvoidingView>
|
|
78
|
-
);
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
const styles = StyleSheet.create({
|
|
82
|
-
keyboardAvoidingView: {
|
|
83
|
-
flex: 1,
|
|
84
|
-
width: '100%',
|
|
85
|
-
},
|
|
86
|
-
});
|
|
87
|
-
|
|
88
|
-
export default HideKeyboard;
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import React, { useMemo } from 'react';
|
|
2
|
-
import { StyleSheet, View, ActivityIndicator } from 'react-native';
|
|
3
|
-
import { useInternalTheme } from '../../theme/hook/useInternalTheme';
|
|
4
|
-
import type { ThemeOverride } from '../../theme/themes';
|
|
5
|
-
|
|
6
|
-
interface LoaderProps {
|
|
7
|
-
color?: string;
|
|
8
|
-
theme?: ThemeOverride;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export const Loader: React.FC<LoaderProps> = React.memo(
|
|
12
|
-
({ color, theme: themeOverride }) => {
|
|
13
|
-
const { theme } = useInternalTheme(themeOverride);
|
|
14
|
-
|
|
15
|
-
const rootStyle = useMemo(
|
|
16
|
-
() => [styles.root, { backgroundColor: theme.colors.scrim }],
|
|
17
|
-
[theme.colors.scrim]
|
|
18
|
-
);
|
|
19
|
-
|
|
20
|
-
const indicatorColor = useMemo(
|
|
21
|
-
() => color ?? theme.colors.primary,
|
|
22
|
-
[color, theme.colors.primary]
|
|
23
|
-
);
|
|
24
|
-
|
|
25
|
-
return (
|
|
26
|
-
<View style={rootStyle}>
|
|
27
|
-
<ActivityIndicator size="large" color={indicatorColor} />
|
|
28
|
-
</View>
|
|
29
|
-
);
|
|
30
|
-
}
|
|
31
|
-
);
|
|
32
|
-
|
|
33
|
-
const styles = StyleSheet.create({
|
|
34
|
-
root: {
|
|
35
|
-
position: 'absolute',
|
|
36
|
-
top: 0,
|
|
37
|
-
left: 0,
|
|
38
|
-
right: 0,
|
|
39
|
-
bottom: 0,
|
|
40
|
-
justifyContent: 'center',
|
|
41
|
-
alignItems: 'center',
|
|
42
|
-
zIndex: 999,
|
|
43
|
-
},
|
|
44
|
-
});
|
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @author Naresh Dhamu
|
|
3
|
-
* @lastModified Tue 17 Feb 2026 at 04:10 PM
|
|
4
|
-
*/
|
|
5
|
-
import React, { useMemo, useState } from 'react';
|
|
6
|
-
import {
|
|
7
|
-
Image,
|
|
8
|
-
View,
|
|
9
|
-
type StyleProp,
|
|
10
|
-
type ImageStyle,
|
|
11
|
-
type ViewStyle,
|
|
12
|
-
} from 'react-native';
|
|
13
|
-
import { moderateScale } from 'react-native-size-matters';
|
|
14
|
-
import SkeletonPlaceholder from 'react-native-skeleton-placeholder';
|
|
15
|
-
import { useSplashCache } from '../../hooks/useSplashCache';
|
|
16
|
-
import { useInternalTheme } from '../../theme/hook/useInternalTheme';
|
|
17
|
-
import type { ThemeOverride } from '../../theme/themes';
|
|
18
|
-
|
|
19
|
-
interface ILogoProps {
|
|
20
|
-
width?: number;
|
|
21
|
-
height?: number;
|
|
22
|
-
resizeMode?: 'contain' | 'cover' | 'stretch';
|
|
23
|
-
logoUri: string;
|
|
24
|
-
imageStyle?: StyleProp<ImageStyle>;
|
|
25
|
-
containerStyle?: StyleProp<ViewStyle>;
|
|
26
|
-
aspectRatio?: number;
|
|
27
|
-
fallbackUri?: string;
|
|
28
|
-
theme?: ThemeOverride;
|
|
29
|
-
isLoading?: boolean;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export const Logo: React.FC<ILogoProps> = ({
|
|
33
|
-
width = 200,
|
|
34
|
-
height = 50,
|
|
35
|
-
resizeMode = 'contain',
|
|
36
|
-
logoUri,
|
|
37
|
-
imageStyle,
|
|
38
|
-
containerStyle,
|
|
39
|
-
aspectRatio,
|
|
40
|
-
fallbackUri,
|
|
41
|
-
theme,
|
|
42
|
-
isLoading = false,
|
|
43
|
-
}) => {
|
|
44
|
-
const { theme: appliedTheme } = useInternalTheme(theme);
|
|
45
|
-
|
|
46
|
-
const [hasError, setHasError] = useState(false);
|
|
47
|
-
|
|
48
|
-
const {
|
|
49
|
-
data: { logoPath },
|
|
50
|
-
isLoading: isSplashLoading,
|
|
51
|
-
} = useSplashCache({
|
|
52
|
-
logoUrl: logoUri,
|
|
53
|
-
});
|
|
54
|
-
const finalSource = useMemo(() => {
|
|
55
|
-
if (hasError) {
|
|
56
|
-
return fallbackUri ? { uri: fallbackUri } : undefined;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
if (logoPath) {
|
|
60
|
-
return {
|
|
61
|
-
uri: logoPath.startsWith('file://') ? logoPath : `file://${logoPath}`,
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
if (logoUri) {
|
|
66
|
-
return { uri: logoUri };
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
if (fallbackUri) {
|
|
70
|
-
return { uri: fallbackUri };
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
return undefined;
|
|
74
|
-
}, [logoPath, logoUri, fallbackUri, hasError]);
|
|
75
|
-
|
|
76
|
-
const containerStyleMemo = useMemo(
|
|
77
|
-
() => [
|
|
78
|
-
{
|
|
79
|
-
alignItems: 'center' as const,
|
|
80
|
-
justifyContent: 'center' as const,
|
|
81
|
-
},
|
|
82
|
-
containerStyle,
|
|
83
|
-
],
|
|
84
|
-
[containerStyle]
|
|
85
|
-
);
|
|
86
|
-
|
|
87
|
-
const imageStyleMemo = useMemo(
|
|
88
|
-
() => [
|
|
89
|
-
{
|
|
90
|
-
width: moderateScale(width),
|
|
91
|
-
height: moderateScale(height),
|
|
92
|
-
...(aspectRatio ? { aspectRatio } : {}),
|
|
93
|
-
},
|
|
94
|
-
imageStyle,
|
|
95
|
-
],
|
|
96
|
-
[width, height, aspectRatio, imageStyle]
|
|
97
|
-
);
|
|
98
|
-
|
|
99
|
-
const showSkeleton = isLoading || isSplashLoading;
|
|
100
|
-
const showPlaceholder = !finalSource;
|
|
101
|
-
|
|
102
|
-
return (
|
|
103
|
-
<View style={containerStyleMemo}>
|
|
104
|
-
{showSkeleton ? (
|
|
105
|
-
<SkeletonPlaceholder
|
|
106
|
-
backgroundColor={appliedTheme.colors.skeletonBaseColor}
|
|
107
|
-
highlightColor={appliedTheme.colors.skeletonHighlightColor}
|
|
108
|
-
speed={1000}
|
|
109
|
-
borderRadius={4}
|
|
110
|
-
>
|
|
111
|
-
<SkeletonPlaceholder.Item
|
|
112
|
-
alignSelf="center"
|
|
113
|
-
width={moderateScale(width)}
|
|
114
|
-
height={moderateScale(height)}
|
|
115
|
-
borderRadius={4}
|
|
116
|
-
/>
|
|
117
|
-
</SkeletonPlaceholder>
|
|
118
|
-
) : finalSource ? (
|
|
119
|
-
<Image
|
|
120
|
-
source={finalSource}
|
|
121
|
-
resizeMode={resizeMode}
|
|
122
|
-
style={imageStyleMemo}
|
|
123
|
-
onError={() => {
|
|
124
|
-
if (!hasError) {
|
|
125
|
-
setHasError(true);
|
|
126
|
-
}
|
|
127
|
-
}}
|
|
128
|
-
/>
|
|
129
|
-
) : showPlaceholder ? (
|
|
130
|
-
<View
|
|
131
|
-
style={[
|
|
132
|
-
{
|
|
133
|
-
width: moderateScale(width),
|
|
134
|
-
height: moderateScale(height),
|
|
135
|
-
borderRadius: 4,
|
|
136
|
-
backgroundColor: appliedTheme.colors.skeletonBaseColor,
|
|
137
|
-
},
|
|
138
|
-
]}
|
|
139
|
-
/>
|
|
140
|
-
) : null}
|
|
141
|
-
</View>
|
|
142
|
-
);
|
|
143
|
-
};
|
|
144
|
-
|
|
145
|
-
export default React.memo(Logo);
|