@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,229 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @author Naresh Dhamu
|
|
3
|
-
* @lastModified Wed 02 Jul 2025 at 12:35 PM
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import React, { useState, useMemo, useCallback, useRef } from 'react';
|
|
7
|
-
import {
|
|
8
|
-
TouchableOpacity,
|
|
9
|
-
View,
|
|
10
|
-
StyleSheet,
|
|
11
|
-
Modal,
|
|
12
|
-
Pressable,
|
|
13
|
-
Text,
|
|
14
|
-
Platform,
|
|
15
|
-
findNodeHandle,
|
|
16
|
-
UIManager,
|
|
17
|
-
StatusBar,
|
|
18
|
-
type StyleProp,
|
|
19
|
-
type ViewStyle,
|
|
20
|
-
} from 'react-native';
|
|
21
|
-
import { Ellipsis } from 'lucide-react-native';
|
|
22
|
-
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
23
|
-
import { BlurView } from '@react-native-community/blur';
|
|
24
|
-
import { useInternalTheme } from '../../theme/hook/useInternalTheme';
|
|
25
|
-
import { scale, verticalScale } from 'react-native-size-matters';
|
|
26
|
-
import type { ThemeOverride } from '../../theme/themes';
|
|
27
|
-
import type { MenuAction } from '../../types/content/content-view.types';
|
|
28
|
-
import { RFValue } from 'react-native-responsive-fontsize';
|
|
29
|
-
|
|
30
|
-
type MenuBtnProps = {
|
|
31
|
-
actions: MenuAction[];
|
|
32
|
-
theme?: ThemeOverride;
|
|
33
|
-
style?: StyleProp<ViewStyle>;
|
|
34
|
-
enableBlur?: boolean;
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
const MenuBtn: React.FC<MenuBtnProps> = ({
|
|
38
|
-
actions,
|
|
39
|
-
theme,
|
|
40
|
-
style,
|
|
41
|
-
enableBlur = false,
|
|
42
|
-
}) => {
|
|
43
|
-
const insets = useSafeAreaInsets();
|
|
44
|
-
const { theme: appliedTheme } = useInternalTheme(theme);
|
|
45
|
-
const [visible, setVisible] = useState(false);
|
|
46
|
-
const [menuPosition, setMenuPosition] = useState<{
|
|
47
|
-
top: number;
|
|
48
|
-
right: number;
|
|
49
|
-
}>({ top: 0, right: scale(13) });
|
|
50
|
-
|
|
51
|
-
const btnRef = useRef(null);
|
|
52
|
-
|
|
53
|
-
const flattenedStyle = useMemo(
|
|
54
|
-
() => StyleSheet.flatten(style) || {},
|
|
55
|
-
[style]
|
|
56
|
-
);
|
|
57
|
-
const shouldRenderBlur = useMemo(
|
|
58
|
-
() => enableBlur && !!flattenedStyle.backgroundColor,
|
|
59
|
-
[enableBlur, flattenedStyle.backgroundColor]
|
|
60
|
-
);
|
|
61
|
-
|
|
62
|
-
const openMenu = useCallback(() => {
|
|
63
|
-
const handle = findNodeHandle(btnRef.current);
|
|
64
|
-
if (handle) {
|
|
65
|
-
UIManager.measureInWindow(handle, (_x, y, _w, _h) => {
|
|
66
|
-
const extraOffset =
|
|
67
|
-
Platform.OS === 'android'
|
|
68
|
-
? (StatusBar.currentHeight ?? 0) - verticalScale(2)
|
|
69
|
-
: 0;
|
|
70
|
-
setMenuPosition({
|
|
71
|
-
top: y + verticalScale(32) + extraOffset,
|
|
72
|
-
right: scale(13),
|
|
73
|
-
});
|
|
74
|
-
setVisible(true);
|
|
75
|
-
});
|
|
76
|
-
} else {
|
|
77
|
-
setVisible(true);
|
|
78
|
-
}
|
|
79
|
-
}, []);
|
|
80
|
-
|
|
81
|
-
const closeMenu = useCallback(() => setVisible(false), []);
|
|
82
|
-
const memoizedActions = useMemo(() => actions, [actions]);
|
|
83
|
-
|
|
84
|
-
return (
|
|
85
|
-
<>
|
|
86
|
-
<TouchableOpacity
|
|
87
|
-
ref={btnRef}
|
|
88
|
-
activeOpacity={0.7}
|
|
89
|
-
style={[
|
|
90
|
-
styles.container,
|
|
91
|
-
{ top: insets.top + verticalScale(5) },
|
|
92
|
-
style,
|
|
93
|
-
]}
|
|
94
|
-
onPress={openMenu}
|
|
95
|
-
>
|
|
96
|
-
{shouldRenderBlur && Platform.OS === 'ios' ? (
|
|
97
|
-
<BlurView
|
|
98
|
-
style={StyleSheet.absoluteFill}
|
|
99
|
-
blurType="light"
|
|
100
|
-
blurAmount={10}
|
|
101
|
-
reducedTransparencyFallbackColor={String(
|
|
102
|
-
flattenedStyle.backgroundColor || appliedTheme.colors.backdrop
|
|
103
|
-
)}
|
|
104
|
-
/>
|
|
105
|
-
) : (
|
|
106
|
-
<View
|
|
107
|
-
style={[
|
|
108
|
-
StyleSheet.absoluteFill,
|
|
109
|
-
{
|
|
110
|
-
backgroundColor:
|
|
111
|
-
flattenedStyle.backgroundColor ||
|
|
112
|
-
appliedTheme.colors.backdrop,
|
|
113
|
-
},
|
|
114
|
-
]}
|
|
115
|
-
/>
|
|
116
|
-
)}
|
|
117
|
-
<Ellipsis size={scale(20)} color={appliedTheme.colors.textPrimary} />
|
|
118
|
-
</TouchableOpacity>
|
|
119
|
-
|
|
120
|
-
<Modal
|
|
121
|
-
transparent
|
|
122
|
-
visible={visible}
|
|
123
|
-
animationType="fade"
|
|
124
|
-
onRequestClose={closeMenu}
|
|
125
|
-
hardwareAccelerated
|
|
126
|
-
presentationStyle="overFullScreen"
|
|
127
|
-
statusBarTranslucent
|
|
128
|
-
>
|
|
129
|
-
<Pressable style={styles.modalRoot} onPress={closeMenu}>
|
|
130
|
-
<Pressable
|
|
131
|
-
onPress={() => {}}
|
|
132
|
-
style={[
|
|
133
|
-
styles.menuBox,
|
|
134
|
-
{
|
|
135
|
-
position: 'absolute',
|
|
136
|
-
top: menuPosition.top,
|
|
137
|
-
right: menuPosition.right,
|
|
138
|
-
backgroundColor: appliedTheme.colors.surface,
|
|
139
|
-
},
|
|
140
|
-
]}
|
|
141
|
-
>
|
|
142
|
-
{memoizedActions.map((action, index) => (
|
|
143
|
-
<Pressable
|
|
144
|
-
key={`${action.label}-${index}`}
|
|
145
|
-
onPress={() => {
|
|
146
|
-
closeMenu();
|
|
147
|
-
try {
|
|
148
|
-
action.onPress();
|
|
149
|
-
} catch (error) {
|
|
150
|
-
console.error('Action failed:', error);
|
|
151
|
-
}
|
|
152
|
-
}}
|
|
153
|
-
disabled={action.isLoading || false}
|
|
154
|
-
style={({ pressed }) => [
|
|
155
|
-
styles.menuItem,
|
|
156
|
-
{
|
|
157
|
-
backgroundColor: pressed
|
|
158
|
-
? appliedTheme.colors.surfaceVariant
|
|
159
|
-
: 'transparent',
|
|
160
|
-
},
|
|
161
|
-
]}
|
|
162
|
-
>
|
|
163
|
-
{action?.icon && (
|
|
164
|
-
<View style={styles.iconBox}>
|
|
165
|
-
<action.icon
|
|
166
|
-
size={scale(18)}
|
|
167
|
-
color={appliedTheme.colors.textPrimary}
|
|
168
|
-
/>
|
|
169
|
-
</View>
|
|
170
|
-
)}
|
|
171
|
-
<Text
|
|
172
|
-
style={[
|
|
173
|
-
styles.label,
|
|
174
|
-
{ color: appliedTheme.colors.textPrimary },
|
|
175
|
-
]}
|
|
176
|
-
>
|
|
177
|
-
{action.label}
|
|
178
|
-
</Text>
|
|
179
|
-
</Pressable>
|
|
180
|
-
))}
|
|
181
|
-
</Pressable>
|
|
182
|
-
</Pressable>
|
|
183
|
-
</Modal>
|
|
184
|
-
</>
|
|
185
|
-
);
|
|
186
|
-
};
|
|
187
|
-
|
|
188
|
-
export default React.memo(MenuBtn);
|
|
189
|
-
|
|
190
|
-
const styles = StyleSheet.create({
|
|
191
|
-
container: {
|
|
192
|
-
position: 'absolute',
|
|
193
|
-
right: scale(13),
|
|
194
|
-
padding: scale(6),
|
|
195
|
-
borderRadius: scale(100),
|
|
196
|
-
justifyContent: 'center',
|
|
197
|
-
alignItems: 'center',
|
|
198
|
-
overflow: 'hidden',
|
|
199
|
-
zIndex: 4,
|
|
200
|
-
},
|
|
201
|
-
modalRoot: {
|
|
202
|
-
...StyleSheet.absoluteFillObject,
|
|
203
|
-
backgroundColor: 'rgba(0,0,0,0.2)',
|
|
204
|
-
},
|
|
205
|
-
menuBox: {
|
|
206
|
-
borderRadius: scale(6),
|
|
207
|
-
elevation: 5,
|
|
208
|
-
shadowColor: '#000',
|
|
209
|
-
shadowOffset: { width: 0, height: 2 },
|
|
210
|
-
shadowOpacity: 0.15,
|
|
211
|
-
shadowRadius: 4,
|
|
212
|
-
minWidth: scale(150),
|
|
213
|
-
paddingVertical: verticalScale(2),
|
|
214
|
-
},
|
|
215
|
-
menuItem: {
|
|
216
|
-
flexDirection: 'row',
|
|
217
|
-
alignItems: 'center',
|
|
218
|
-
paddingVertical: verticalScale(8),
|
|
219
|
-
paddingHorizontal: scale(10),
|
|
220
|
-
borderRadius: scale(5),
|
|
221
|
-
},
|
|
222
|
-
iconBox: {
|
|
223
|
-
marginRight: scale(8),
|
|
224
|
-
},
|
|
225
|
-
label: {
|
|
226
|
-
fontSize: RFValue(12),
|
|
227
|
-
includeFontPadding: false,
|
|
228
|
-
},
|
|
229
|
-
});
|
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @author Naresh Dhamu
|
|
3
|
-
* @lastModified Tue 17 Jun 2025 at 10:45 AM
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import React, { useMemo } from 'react';
|
|
7
|
-
import { useSafePressHandler } from '../../hooks/useSafeCallback';
|
|
8
|
-
import {
|
|
9
|
-
TouchableOpacity,
|
|
10
|
-
ActivityIndicator,
|
|
11
|
-
StyleSheet,
|
|
12
|
-
View,
|
|
13
|
-
type GestureResponderEvent,
|
|
14
|
-
type ViewStyle,
|
|
15
|
-
type TextStyle,
|
|
16
|
-
} from 'react-native';
|
|
17
|
-
import { scale, verticalScale } from 'react-native-size-matters';
|
|
18
|
-
import { useInternalTheme } from '../../theme/hook/useInternalTheme';
|
|
19
|
-
import { Text } from '../Text';
|
|
20
|
-
import type { ThemeOverride } from '../../theme/themes';
|
|
21
|
-
import { RFValue } from 'react-native-responsive-fontsize';
|
|
22
|
-
|
|
23
|
-
type PrimaryBtnProps = {
|
|
24
|
-
title: string;
|
|
25
|
-
onPress?: (event: GestureResponderEvent) => void;
|
|
26
|
-
loading?: boolean;
|
|
27
|
-
loadingText?: string;
|
|
28
|
-
disabled?: boolean;
|
|
29
|
-
containerStyle?: ViewStyle;
|
|
30
|
-
titleStyle?: TextStyle;
|
|
31
|
-
theme?: ThemeOverride;
|
|
32
|
-
leftIcon?: React.ReactNode;
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
export const PrimaryBtn: React.FC<PrimaryBtnProps> = ({
|
|
36
|
-
title,
|
|
37
|
-
onPress,
|
|
38
|
-
loading = false,
|
|
39
|
-
loadingText = 'Loading...',
|
|
40
|
-
disabled = false,
|
|
41
|
-
containerStyle,
|
|
42
|
-
titleStyle,
|
|
43
|
-
theme,
|
|
44
|
-
leftIcon,
|
|
45
|
-
}) => {
|
|
46
|
-
const { theme: appliedTheme } = useInternalTheme(theme);
|
|
47
|
-
|
|
48
|
-
const backgroundColor = useMemo(
|
|
49
|
-
() =>
|
|
50
|
-
disabled || loading
|
|
51
|
-
? appliedTheme.colors?.buttonDisabled
|
|
52
|
-
: appliedTheme.colors?.button,
|
|
53
|
-
[
|
|
54
|
-
disabled,
|
|
55
|
-
loading,
|
|
56
|
-
appliedTheme.colors?.buttonDisabled,
|
|
57
|
-
appliedTheme.colors?.button,
|
|
58
|
-
]
|
|
59
|
-
);
|
|
60
|
-
|
|
61
|
-
const buttonStyle = useMemo(
|
|
62
|
-
() => [styles.button, { backgroundColor }, containerStyle],
|
|
63
|
-
[backgroundColor, containerStyle]
|
|
64
|
-
);
|
|
65
|
-
|
|
66
|
-
const textStyle = useMemo(
|
|
67
|
-
() => [styles.text, { color: appliedTheme.colors.buttonText }, titleStyle],
|
|
68
|
-
[appliedTheme.colors.buttonText, titleStyle]
|
|
69
|
-
);
|
|
70
|
-
|
|
71
|
-
const loadingTextStyle = useMemo(
|
|
72
|
-
() => [
|
|
73
|
-
styles.text,
|
|
74
|
-
{ color: appliedTheme.colors.buttonText, opacity: 0.75 },
|
|
75
|
-
titleStyle,
|
|
76
|
-
],
|
|
77
|
-
[appliedTheme.colors.buttonText, titleStyle]
|
|
78
|
-
);
|
|
79
|
-
|
|
80
|
-
const handlePress = useSafePressHandler(onPress, disabled || loading);
|
|
81
|
-
|
|
82
|
-
return (
|
|
83
|
-
<TouchableOpacity
|
|
84
|
-
onPress={handlePress}
|
|
85
|
-
disabled={disabled || loading}
|
|
86
|
-
activeOpacity={0.8}
|
|
87
|
-
style={buttonStyle}
|
|
88
|
-
accessibilityRole="button"
|
|
89
|
-
accessibilityState={{ disabled: disabled || loading }}
|
|
90
|
-
>
|
|
91
|
-
{loading ? (
|
|
92
|
-
<View style={styles.row}>
|
|
93
|
-
<ActivityIndicator
|
|
94
|
-
color={appliedTheme.colors.buttonText}
|
|
95
|
-
style={{ marginRight: scale(8) }}
|
|
96
|
-
/>
|
|
97
|
-
<Text style={loadingTextStyle}>{loadingText}</Text>
|
|
98
|
-
</View>
|
|
99
|
-
) : (
|
|
100
|
-
<View style={styles.row}>
|
|
101
|
-
{leftIcon && (
|
|
102
|
-
<View style={{ marginRight: scale(8) }}>{leftIcon}</View>
|
|
103
|
-
)}
|
|
104
|
-
<Text style={textStyle}>{title}</Text>
|
|
105
|
-
</View>
|
|
106
|
-
)}
|
|
107
|
-
</TouchableOpacity>
|
|
108
|
-
);
|
|
109
|
-
};
|
|
110
|
-
|
|
111
|
-
export default React.memo(PrimaryBtn);
|
|
112
|
-
|
|
113
|
-
const styles = StyleSheet.create({
|
|
114
|
-
button: {
|
|
115
|
-
alignSelf: 'stretch',
|
|
116
|
-
paddingVertical: verticalScale(12),
|
|
117
|
-
paddingHorizontal: scale(16),
|
|
118
|
-
borderRadius: scale(6),
|
|
119
|
-
alignItems: 'center',
|
|
120
|
-
justifyContent: 'center',
|
|
121
|
-
minHeight: verticalScale(44),
|
|
122
|
-
flexShrink: 1,
|
|
123
|
-
},
|
|
124
|
-
text: {
|
|
125
|
-
textAlign: 'center',
|
|
126
|
-
fontSize: RFValue(13),
|
|
127
|
-
fontWeight: '600',
|
|
128
|
-
},
|
|
129
|
-
row: {
|
|
130
|
-
flexDirection: 'row',
|
|
131
|
-
alignItems: 'center',
|
|
132
|
-
justifyContent: 'center',
|
|
133
|
-
},
|
|
134
|
-
});
|
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @author Ashok Desai
|
|
3
|
-
* @lastModified Mon 06 Oct 2025 at 03:45 PM
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import React, { useMemo } from 'react';
|
|
7
|
-
import { useSafePressHandler } from '../../hooks/useSafeCallback';
|
|
8
|
-
import {
|
|
9
|
-
TouchableOpacity,
|
|
10
|
-
ActivityIndicator,
|
|
11
|
-
StyleSheet,
|
|
12
|
-
View,
|
|
13
|
-
type GestureResponderEvent,
|
|
14
|
-
type ViewStyle,
|
|
15
|
-
type TextStyle,
|
|
16
|
-
} from 'react-native';
|
|
17
|
-
import { scale, verticalScale } from 'react-native-size-matters';
|
|
18
|
-
import { useInternalTheme } from '../../theme/hook/useInternalTheme';
|
|
19
|
-
import { Text } from '../Text';
|
|
20
|
-
import type { ThemeOverride } from '../../theme/themes';
|
|
21
|
-
import { RFValue } from 'react-native-responsive-fontsize';
|
|
22
|
-
|
|
23
|
-
type SecondaryBtnProps = {
|
|
24
|
-
title: string;
|
|
25
|
-
onPress?: (event: GestureResponderEvent) => void;
|
|
26
|
-
loading?: boolean;
|
|
27
|
-
loadingText?: string;
|
|
28
|
-
disabled?: boolean;
|
|
29
|
-
containerStyle?: ViewStyle;
|
|
30
|
-
titleStyle?: TextStyle;
|
|
31
|
-
theme?: ThemeOverride;
|
|
32
|
-
leftIcon?: React.ReactNode;
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
export const SecondaryBtn: React.FC<SecondaryBtnProps> = ({
|
|
36
|
-
title,
|
|
37
|
-
onPress,
|
|
38
|
-
loading = false,
|
|
39
|
-
loadingText = 'Loading...',
|
|
40
|
-
disabled = false,
|
|
41
|
-
containerStyle,
|
|
42
|
-
titleStyle,
|
|
43
|
-
leftIcon,
|
|
44
|
-
theme,
|
|
45
|
-
}) => {
|
|
46
|
-
const { theme: appliedTheme } = useInternalTheme(theme);
|
|
47
|
-
|
|
48
|
-
const backgroundColor = useMemo(
|
|
49
|
-
() =>
|
|
50
|
-
disabled || loading
|
|
51
|
-
? appliedTheme.colors?.buttonDisabled
|
|
52
|
-
: appliedTheme.colors?.button,
|
|
53
|
-
[
|
|
54
|
-
disabled,
|
|
55
|
-
loading,
|
|
56
|
-
appliedTheme.colors?.buttonDisabled,
|
|
57
|
-
appliedTheme.colors?.button,
|
|
58
|
-
]
|
|
59
|
-
);
|
|
60
|
-
|
|
61
|
-
const buttonStyle = useMemo(
|
|
62
|
-
() => [styles.button, { backgroundColor }, containerStyle],
|
|
63
|
-
[backgroundColor, containerStyle]
|
|
64
|
-
);
|
|
65
|
-
|
|
66
|
-
const textStyle = useMemo(
|
|
67
|
-
() => [styles.text, { color: appliedTheme.colors.buttonText }, titleStyle],
|
|
68
|
-
[appliedTheme.colors.buttonText, titleStyle]
|
|
69
|
-
);
|
|
70
|
-
|
|
71
|
-
const loadingTextStyle = useMemo(
|
|
72
|
-
() => [
|
|
73
|
-
styles.text,
|
|
74
|
-
{ color: appliedTheme.colors.buttonText, opacity: 0.75 },
|
|
75
|
-
titleStyle,
|
|
76
|
-
],
|
|
77
|
-
[appliedTheme.colors.buttonText, titleStyle]
|
|
78
|
-
);
|
|
79
|
-
|
|
80
|
-
const handlePress = useSafePressHandler(onPress, disabled || loading);
|
|
81
|
-
|
|
82
|
-
return (
|
|
83
|
-
<TouchableOpacity
|
|
84
|
-
onPress={handlePress}
|
|
85
|
-
disabled={disabled || loading}
|
|
86
|
-
activeOpacity={0.8}
|
|
87
|
-
style={buttonStyle}
|
|
88
|
-
accessibilityRole="button"
|
|
89
|
-
accessibilityState={{ disabled: disabled || loading }}
|
|
90
|
-
>
|
|
91
|
-
<View style={styles.row}>
|
|
92
|
-
{leftIcon && <View style={{ marginRight: scale(8) }}>{leftIcon}</View>}
|
|
93
|
-
|
|
94
|
-
{loading ? (
|
|
95
|
-
<>
|
|
96
|
-
<ActivityIndicator
|
|
97
|
-
color={appliedTheme.colors.buttonText}
|
|
98
|
-
style={{ marginRight: scale(6) }}
|
|
99
|
-
/>
|
|
100
|
-
<Text style={loadingTextStyle}>{loadingText}</Text>
|
|
101
|
-
</>
|
|
102
|
-
) : (
|
|
103
|
-
<Text style={textStyle}>{title}</Text>
|
|
104
|
-
)}
|
|
105
|
-
</View>
|
|
106
|
-
</TouchableOpacity>
|
|
107
|
-
);
|
|
108
|
-
};
|
|
109
|
-
|
|
110
|
-
export default React.memo(SecondaryBtn);
|
|
111
|
-
|
|
112
|
-
const styles = StyleSheet.create({
|
|
113
|
-
button: {
|
|
114
|
-
width: '100%',
|
|
115
|
-
alignSelf: 'stretch',
|
|
116
|
-
paddingVertical: verticalScale(12),
|
|
117
|
-
paddingHorizontal: scale(16),
|
|
118
|
-
borderRadius: scale(6),
|
|
119
|
-
alignItems: 'center',
|
|
120
|
-
justifyContent: 'center',
|
|
121
|
-
},
|
|
122
|
-
row: {
|
|
123
|
-
flexDirection: 'row',
|
|
124
|
-
alignItems: 'center',
|
|
125
|
-
justifyContent: 'center',
|
|
126
|
-
},
|
|
127
|
-
text: {
|
|
128
|
-
textAlign: 'center',
|
|
129
|
-
fontSize: RFValue(13),
|
|
130
|
-
fontWeight: '600',
|
|
131
|
-
},
|
|
132
|
-
});
|
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
import React, { useMemo } from 'react';
|
|
2
|
-
import { useSafePressHandler } from '../../hooks/useSafeCallback';
|
|
3
|
-
import {
|
|
4
|
-
StyleSheet,
|
|
5
|
-
Pressable,
|
|
6
|
-
View,
|
|
7
|
-
type GestureResponderEvent,
|
|
8
|
-
type TextStyle,
|
|
9
|
-
type ViewStyle,
|
|
10
|
-
} from 'react-native';
|
|
11
|
-
import { useInternalTheme } from '../../theme/hook/useInternalTheme';
|
|
12
|
-
import { scale, verticalScale } from 'react-native-size-matters';
|
|
13
|
-
import { Text } from '../Text';
|
|
14
|
-
import { RFValue } from 'react-native-responsive-fontsize';
|
|
15
|
-
|
|
16
|
-
type TextButtonProps = {
|
|
17
|
-
title: string;
|
|
18
|
-
onPress: (event: GestureResponderEvent) => void;
|
|
19
|
-
color?: string;
|
|
20
|
-
style?: TextStyle;
|
|
21
|
-
containerStyle?: ViewStyle;
|
|
22
|
-
disabled?: boolean;
|
|
23
|
-
underline?: boolean;
|
|
24
|
-
bold?: boolean;
|
|
25
|
-
align?: 'left' | 'center' | 'right';
|
|
26
|
-
leftIcon?: React.ReactNode;
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
const TextButton: React.FC<TextButtonProps> = ({
|
|
30
|
-
title,
|
|
31
|
-
onPress,
|
|
32
|
-
color,
|
|
33
|
-
style,
|
|
34
|
-
containerStyle,
|
|
35
|
-
disabled = false,
|
|
36
|
-
underline = false,
|
|
37
|
-
bold = false,
|
|
38
|
-
align = 'center',
|
|
39
|
-
leftIcon,
|
|
40
|
-
}) => {
|
|
41
|
-
const { theme } = useInternalTheme();
|
|
42
|
-
|
|
43
|
-
const alignSelfMap = useMemo<
|
|
44
|
-
Record<'left' | 'center' | 'right', ViewStyle['alignSelf']>
|
|
45
|
-
>(
|
|
46
|
-
() => ({
|
|
47
|
-
left: 'flex-start',
|
|
48
|
-
center: 'center',
|
|
49
|
-
right: 'flex-end',
|
|
50
|
-
}),
|
|
51
|
-
[]
|
|
52
|
-
);
|
|
53
|
-
|
|
54
|
-
const alignSelf = useMemo(() => alignSelfMap[align], [alignSelfMap, align]);
|
|
55
|
-
|
|
56
|
-
const textStyle = useMemo<TextStyle>(
|
|
57
|
-
() => ({
|
|
58
|
-
textAlign: align,
|
|
59
|
-
textDecorationLine: underline ? 'underline' : 'none',
|
|
60
|
-
fontWeight: bold ? '700' : '400',
|
|
61
|
-
}),
|
|
62
|
-
[align, underline, bold]
|
|
63
|
-
);
|
|
64
|
-
|
|
65
|
-
const textColor = useMemo(
|
|
66
|
-
() => color || theme.colors.textPrimary,
|
|
67
|
-
[color, theme.colors.textPrimary]
|
|
68
|
-
);
|
|
69
|
-
|
|
70
|
-
const justifyContent = useMemo<ViewStyle['justifyContent']>(
|
|
71
|
-
() =>
|
|
72
|
-
align === 'left'
|
|
73
|
-
? 'flex-start'
|
|
74
|
-
: align === 'right'
|
|
75
|
-
? 'flex-end'
|
|
76
|
-
: 'center',
|
|
77
|
-
[align]
|
|
78
|
-
);
|
|
79
|
-
|
|
80
|
-
const rowStyle = useMemo<ViewStyle[]>(
|
|
81
|
-
() => [styles.row, { justifyContent }],
|
|
82
|
-
[justifyContent]
|
|
83
|
-
);
|
|
84
|
-
|
|
85
|
-
const finalTextStyle = useMemo(
|
|
86
|
-
() => [styles.text, textStyle, style],
|
|
87
|
-
[textStyle, style]
|
|
88
|
-
);
|
|
89
|
-
|
|
90
|
-
const handlePress = useSafePressHandler(onPress, disabled);
|
|
91
|
-
|
|
92
|
-
return (
|
|
93
|
-
<Pressable
|
|
94
|
-
onPress={handlePress}
|
|
95
|
-
disabled={disabled}
|
|
96
|
-
accessibilityRole="button"
|
|
97
|
-
accessibilityState={{ disabled }}
|
|
98
|
-
style={({ pressed }) => [
|
|
99
|
-
styles.defaultContainer,
|
|
100
|
-
{ alignSelf },
|
|
101
|
-
containerStyle,
|
|
102
|
-
pressed && styles.pressed,
|
|
103
|
-
disabled && styles.disabled,
|
|
104
|
-
]}
|
|
105
|
-
>
|
|
106
|
-
<View style={rowStyle}>
|
|
107
|
-
{leftIcon && <View style={styles.iconSpacing}>{leftIcon}</View>}
|
|
108
|
-
<Text
|
|
109
|
-
color={textColor}
|
|
110
|
-
style={finalTextStyle}
|
|
111
|
-
size={12}
|
|
112
|
-
numberOfLines={1}
|
|
113
|
-
allowFontScaling={false}
|
|
114
|
-
>
|
|
115
|
-
{title}
|
|
116
|
-
</Text>
|
|
117
|
-
</View>
|
|
118
|
-
</Pressable>
|
|
119
|
-
);
|
|
120
|
-
};
|
|
121
|
-
|
|
122
|
-
export default React.memo(TextButton);
|
|
123
|
-
|
|
124
|
-
const styles = StyleSheet.create({
|
|
125
|
-
defaultContainer: {
|
|
126
|
-
paddingVertical: verticalScale(4),
|
|
127
|
-
paddingHorizontal: scale(6),
|
|
128
|
-
},
|
|
129
|
-
text: {
|
|
130
|
-
fontSize: RFValue(10),
|
|
131
|
-
},
|
|
132
|
-
row: {
|
|
133
|
-
flexDirection: 'row',
|
|
134
|
-
alignItems: 'center',
|
|
135
|
-
},
|
|
136
|
-
iconSpacing: {
|
|
137
|
-
marginRight: scale(1),
|
|
138
|
-
},
|
|
139
|
-
pressed: {
|
|
140
|
-
opacity: 0.6,
|
|
141
|
-
},
|
|
142
|
-
disabled: {
|
|
143
|
-
opacity: 0.4,
|
|
144
|
-
},
|
|
145
|
-
});
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @author Naresh Dhamu
|
|
3
|
-
* @lastModified Fri 13 Jun 2025 at 12:26 PM
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import BackBtn from './BackBtn';
|
|
7
|
-
import { PrimaryBtn } from './PrimaryBtn';
|
|
8
|
-
import { SecondaryBtn } from './SecondaryBtn';
|
|
9
|
-
import TextButton from './TextButton';
|
|
10
|
-
|
|
11
|
-
const Button = {
|
|
12
|
-
Primary: PrimaryBtn,
|
|
13
|
-
Secondary: SecondaryBtn,
|
|
14
|
-
BackBtn,
|
|
15
|
-
TextButton,
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
export { Button };
|