@zezosoft/zezo-ott-react-native-ui-kit 1.0.8 → 1.0.9
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/components/Account/Account.js +1 -1
- package/lib/module/components/Account/Account.js.map +1 -1
- package/lib/module/components/Auth/AuthProvider/AuthProvider.js +48 -19
- package/lib/module/components/Auth/AuthProvider/AuthProvider.js.map +1 -1
- package/lib/module/components/Auth/Login/LoginWithEmail.js +4 -2
- package/lib/module/components/Auth/Login/LoginWithEmail.js.map +1 -1
- package/lib/module/components/Auth/OTP/OTP.js +15 -1
- package/lib/module/components/Auth/OTP/OTP.js.map +1 -1
- package/lib/module/components/Auth/SignUp/SignUp.js +4 -2
- package/lib/module/components/Auth/SignUp/SignUp.js.map +1 -1
- package/lib/module/components/BlurView/BlurView.js +171 -0
- package/lib/module/components/BlurView/BlurView.js.map +1 -0
- package/lib/module/components/BlurView/index.js +9 -0
- package/lib/module/components/BlurView/index.js.map +1 -0
- package/lib/module/components/Content/Card/Styles/Four.js +1 -1
- package/lib/module/components/Content/Card/Styles/Four.js.map +1 -1
- package/lib/module/components/Content/Content.js +4 -2
- package/lib/module/components/Content/Content.js.map +1 -1
- package/lib/module/components/ContentView/ContentView.js +4 -2
- package/lib/module/components/ContentView/ContentView.js.map +1 -1
- package/lib/module/components/ContentView/components/MiniInfo.js +64 -19
- package/lib/module/components/ContentView/components/MiniInfo.js.map +1 -1
- package/lib/module/components/Settings/AppSettings.js +1 -1
- package/lib/module/components/Settings/AppSettings.js.map +1 -1
- package/lib/module/components/Subscription/SubOne.js +340 -13
- package/lib/module/components/Subscription/SubOne.js.map +1 -1
- package/lib/module/components/TabBar/One.js +71 -108
- package/lib/module/components/TabBar/One.js.map +1 -1
- package/lib/module/components/TabBar/Three.js +63 -78
- package/lib/module/components/TabBar/Three.js.map +1 -1
- package/lib/module/components/TabBar/Two.js +110 -106
- package/lib/module/components/TabBar/Two.js.map +1 -1
- package/lib/module/components/User/PurchaseHistory/PurchaseHistory.js +324 -0
- package/lib/module/components/User/PurchaseHistory/PurchaseHistory.js.map +1 -0
- 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/useNavigationMode.js +34 -0
- package/lib/module/hooks/useNavigationMode.js.map +1 -0
- package/lib/module/utils/Spacing.js +26 -0
- package/lib/module/utils/Spacing.js.map +1 -0
- package/lib/typescript/src/components/Auth/AuthProvider/AuthProvider.d.ts +1 -0
- package/lib/typescript/src/components/Auth/AuthProvider/AuthProvider.d.ts.map +1 -1
- package/lib/typescript/src/components/Auth/Login/LoginWithEmail.d.ts.map +1 -1
- package/lib/typescript/src/components/Auth/OTP/OTP.d.ts +2 -0
- package/lib/typescript/src/components/Auth/OTP/OTP.d.ts.map +1 -1
- package/lib/typescript/src/components/Auth/SignUp/SignUp.d.ts.map +1 -1
- package/lib/typescript/src/components/Auth/index.d.ts +2 -0
- package/lib/typescript/src/components/Auth/index.d.ts.map +1 -1
- package/lib/typescript/src/components/BlurView/BlurView.d.ts +48 -0
- package/lib/typescript/src/components/BlurView/BlurView.d.ts.map +1 -0
- package/lib/typescript/src/components/BlurView/index.d.ts +7 -0
- package/lib/typescript/src/components/BlurView/index.d.ts.map +1 -0
- package/lib/typescript/src/components/Content/Card/Styles/Four.d.ts.map +1 -1
- package/lib/typescript/src/components/Content/Content.d.ts.map +1 -1
- package/lib/typescript/src/components/ContentView/ContentView.d.ts +1 -1
- package/lib/typescript/src/components/ContentView/ContentView.d.ts.map +1 -1
- package/lib/typescript/src/components/ContentView/components/MiniInfo.d.ts +17 -1
- package/lib/typescript/src/components/ContentView/components/MiniInfo.d.ts.map +1 -1
- package/lib/typescript/src/components/Subscription/SubOne.d.ts +6 -0
- package/lib/typescript/src/components/Subscription/SubOne.d.ts.map +1 -1
- package/lib/typescript/src/components/Subscription/index.d.ts.map +1 -1
- package/lib/typescript/src/components/TabBar/One.d.ts +2 -2
- package/lib/typescript/src/components/TabBar/One.d.ts.map +1 -1
- package/lib/typescript/src/components/TabBar/Three.d.ts +3 -2
- package/lib/typescript/src/components/TabBar/Three.d.ts.map +1 -1
- package/lib/typescript/src/components/TabBar/Two.d.ts +13 -4
- package/lib/typescript/src/components/TabBar/Two.d.ts.map +1 -1
- package/lib/typescript/src/components/TabBar/index.d.ts +1 -1
- package/lib/typescript/src/components/User/PurchaseHistory/PurchaseHistory.d.ts +50 -0
- package/lib/typescript/src/components/User/PurchaseHistory/PurchaseHistory.d.ts.map +1 -0
- 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/useNavigationMode.d.ts +14 -0
- package/lib/typescript/src/hooks/useNavigationMode.d.ts.map +1 -0
- package/lib/typescript/src/types/content/content-view.types.d.ts +2 -0
- package/lib/typescript/src/types/content/content-view.types.d.ts.map +1 -1
- package/lib/typescript/src/utils/Spacing.d.ts +16 -0
- package/lib/typescript/src/utils/Spacing.d.ts.map +1 -0
- package/package.json +9 -5
- package/src/components/Account/Account.tsx +1 -1
- package/src/components/Auth/AuthProvider/AuthProvider.tsx +82 -37
- package/src/components/Auth/Login/LoginWithEmail.tsx +9 -2
- package/src/components/Auth/OTP/OTP.tsx +37 -1
- package/src/components/Auth/SignUp/SignUp.tsx +9 -2
- package/src/components/BlurView/BlurView.tsx +199 -0
- package/src/components/BlurView/index.ts +7 -0
- package/src/components/Content/Card/Styles/Four.tsx +3 -1
- package/src/components/Content/Content.tsx +5 -4
- package/src/components/ContentView/ContentView.tsx +8 -1
- package/src/components/ContentView/components/MiniInfo.tsx +99 -22
- package/src/components/Settings/AppSettings.tsx +1 -1
- package/src/components/Subscription/SubOne.tsx +422 -11
- package/src/components/TabBar/One.tsx +79 -141
- package/src/components/TabBar/Three.tsx +84 -99
- package/src/components/TabBar/Two.tsx +139 -110
- package/src/components/User/PurchaseHistory/PurchaseHistory.tsx +439 -0
- package/src/components/User/index.ts +8 -1
- package/src/components/index.ts +1 -0
- package/src/hooks/useNavigationMode.ts +35 -0
- package/src/types/content/content-view.types.ts +5 -0
- package/src/utils/Spacing.ts +27 -0
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @author
|
|
3
|
-
* @lastModified
|
|
2
|
+
* @author Naresh Dhamu
|
|
3
|
+
* @lastModified Thu 06 Nov 2025 at 12:30 PM
|
|
4
4
|
*/
|
|
5
|
-
|
|
6
|
-
import
|
|
5
|
+
|
|
6
|
+
import React, { useMemo } from 'react';
|
|
7
|
+
import { View, StyleSheet, Pressable, Platform } from 'react-native';
|
|
7
8
|
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
|
|
9
|
+
import type { BottomTabBarButtonProps } from '@react-navigation/bottom-tabs';
|
|
8
10
|
import { scale } from 'react-native-size-matters';
|
|
9
|
-
import { Text } from '../Text';
|
|
10
|
-
import type { ITheme, ThemeOverride } from '../../theme/themes';
|
|
11
11
|
import { useInternalTheme } from '../../theme/hook/useInternalTheme';
|
|
12
|
+
import type { ThemeOverride } from '../../theme/themes';
|
|
12
13
|
import { RFValue } from 'react-native-responsive-fontsize';
|
|
14
|
+
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
13
15
|
|
|
14
16
|
export type ITab = {
|
|
15
17
|
key: string;
|
|
@@ -24,115 +26,150 @@ export type ITab = {
|
|
|
24
26
|
|
|
25
27
|
export type TabBarTwoProps = {
|
|
26
28
|
tabs: ITab[];
|
|
27
|
-
theme?: ThemeOverride;
|
|
28
29
|
onTabPress?: (key: string) => void;
|
|
30
|
+
theme?: ThemeOverride;
|
|
31
|
+
renderIcon?: ({
|
|
32
|
+
icon,
|
|
33
|
+
color,
|
|
34
|
+
size,
|
|
35
|
+
}: {
|
|
36
|
+
icon: React.ComponentType<{ width: number; height: number; color: string }>;
|
|
37
|
+
color: string;
|
|
38
|
+
size: number;
|
|
39
|
+
}) => React.ReactNode;
|
|
29
40
|
};
|
|
30
41
|
|
|
31
42
|
const Tab = createBottomTabNavigator();
|
|
32
43
|
|
|
33
|
-
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
onTabPress,
|
|
41
|
-
setActiveTab,
|
|
42
|
-
}: {
|
|
43
|
-
tab: ITab;
|
|
44
|
-
isActive: boolean;
|
|
45
|
-
isDarkMode: boolean;
|
|
46
|
-
appliedTheme: ITheme;
|
|
47
|
-
onPress?: (e: any) => void;
|
|
48
|
-
onTabPress?: (key: string) => void;
|
|
49
|
-
setActiveTab: (key: string) => void;
|
|
50
|
-
}) => {
|
|
51
|
-
const Icon = tab.icon;
|
|
52
|
-
const color = isActive
|
|
53
|
-
? appliedTheme.colors.button
|
|
54
|
-
: appliedTheme.colors.textPrimary;
|
|
44
|
+
const ICON_SIZE = scale(24);
|
|
45
|
+
const RIPPLE_RADIUS = scale(35);
|
|
46
|
+
const TAB_BAR_HEIGHT = scale(60);
|
|
47
|
+
const TAB_BAR_BORDER_RADIUS = scale(40);
|
|
48
|
+
const TAB_BAR_MARGIN = scale(16);
|
|
49
|
+
const TAB_BAR_BORDER_WIDTH = scale(2);
|
|
50
|
+
const TAB_BAR_BOTTOM_OFFSET = Platform.OS === 'android' ? scale(5) : -scale(8);
|
|
55
51
|
|
|
56
|
-
|
|
57
|
-
|
|
52
|
+
const CustomTabButton = React.memo(
|
|
53
|
+
({
|
|
54
|
+
props,
|
|
55
|
+
rippleColor,
|
|
56
|
+
}: {
|
|
57
|
+
props: BottomTabBarButtonProps;
|
|
58
|
+
rippleColor?: string;
|
|
59
|
+
}) => {
|
|
60
|
+
const {
|
|
61
|
+
onPress,
|
|
62
|
+
onLongPress,
|
|
63
|
+
accessibilityRole,
|
|
64
|
+
accessibilityState,
|
|
65
|
+
testID,
|
|
66
|
+
style,
|
|
67
|
+
children,
|
|
68
|
+
} = props;
|
|
69
|
+
|
|
70
|
+
return (
|
|
58
71
|
<Pressable
|
|
59
|
-
onPress={(e) => {
|
|
60
|
-
onPress?.(e);
|
|
61
|
-
setActiveTab(tab.key);
|
|
62
|
-
onTabPress?.(tab.key);
|
|
63
|
-
}}
|
|
64
72
|
android_ripple={{
|
|
65
|
-
color:
|
|
66
|
-
? 'rgba(255, 255, 255, 0.12)'
|
|
67
|
-
: 'rgba(0, 0, 0, 0.08)',
|
|
73
|
+
color: rippleColor,
|
|
68
74
|
borderless: true,
|
|
69
|
-
radius:
|
|
75
|
+
radius: RIPPLE_RADIUS,
|
|
70
76
|
}}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
77
|
+
onPress={onPress}
|
|
78
|
+
onLongPress={onLongPress}
|
|
79
|
+
accessibilityRole={accessibilityRole}
|
|
80
|
+
accessibilityState={accessibilityState}
|
|
81
|
+
testID={testID}
|
|
82
|
+
style={[style, styles.tabButton]}
|
|
74
83
|
>
|
|
75
|
-
|
|
76
|
-
<Text style={[styles.label]} color={color} numberOfLines={1}>
|
|
77
|
-
{tab.name}
|
|
78
|
-
</Text>
|
|
84
|
+
{children}
|
|
79
85
|
</Pressable>
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
86
|
+
);
|
|
87
|
+
}
|
|
88
|
+
);
|
|
89
|
+
|
|
90
|
+
CustomTabButton.displayName = 'CustomTabButton';
|
|
83
91
|
|
|
84
|
-
const TabBarTwo = ({ tabs, theme, onTabPress }: TabBarTwoProps) => {
|
|
85
|
-
const
|
|
86
|
-
const
|
|
92
|
+
const TabBarTwo = ({ tabs, theme, onTabPress, renderIcon }: TabBarTwoProps) => {
|
|
93
|
+
const insets = useSafeAreaInsets();
|
|
94
|
+
const { theme: appliedTheme } = useInternalTheme(theme);
|
|
95
|
+
|
|
96
|
+
const screenOptions = useMemo(
|
|
97
|
+
() => ({
|
|
98
|
+
headerShown: false,
|
|
99
|
+
tabBarHideOnKeyboard: true,
|
|
100
|
+
|
|
101
|
+
tabBarStyle: {
|
|
102
|
+
backgroundColor: appliedTheme.colors.background,
|
|
103
|
+
position: 'absolute' as const,
|
|
104
|
+
borderRadius: TAB_BAR_BORDER_RADIUS,
|
|
105
|
+
marginHorizontal: TAB_BAR_MARGIN,
|
|
106
|
+
paddingHorizontal: scale(5),
|
|
107
|
+
paddingBottom: 0,
|
|
108
|
+
borderColor: appliedTheme.colors.border,
|
|
109
|
+
borderWidth: TAB_BAR_BORDER_WIDTH,
|
|
110
|
+
height: TAB_BAR_HEIGHT,
|
|
111
|
+
borderTopWidth: TAB_BAR_BORDER_WIDTH,
|
|
112
|
+
bottom: insets.bottom + TAB_BAR_BOTTOM_OFFSET,
|
|
113
|
+
},
|
|
114
|
+
|
|
115
|
+
tabBarActiveTintColor: appliedTheme.colors.primary,
|
|
116
|
+
tabBarInactiveTintColor: appliedTheme.colors.textPrimary,
|
|
117
|
+
|
|
118
|
+
tabBarLabelStyle: {
|
|
119
|
+
fontSize: RFValue(10),
|
|
120
|
+
},
|
|
121
|
+
}),
|
|
122
|
+
[appliedTheme.colors, insets.bottom]
|
|
123
|
+
);
|
|
87
124
|
|
|
88
125
|
return (
|
|
89
|
-
<Tab.Navigator
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
)
|
|
126
|
+
<Tab.Navigator screenOptions={screenOptions}>
|
|
127
|
+
{tabs.map((tab) => {
|
|
128
|
+
const handleTabPress = () => onTabPress?.(tab.key);
|
|
129
|
+
|
|
130
|
+
const renderTabIcon = ({
|
|
131
|
+
color,
|
|
132
|
+
}: {
|
|
133
|
+
color: string;
|
|
134
|
+
focused: boolean;
|
|
135
|
+
size: number;
|
|
136
|
+
}) => {
|
|
137
|
+
if (renderIcon) {
|
|
138
|
+
return (
|
|
139
|
+
<View style={styles.iconContainer}>
|
|
140
|
+
{renderIcon({ icon: tab.icon, color, size: ICON_SIZE })}
|
|
141
|
+
</View>
|
|
142
|
+
);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
return (
|
|
146
|
+
<View style={styles.iconContainer}>
|
|
147
|
+
<tab.icon width={ICON_SIZE} height={ICON_SIZE} color={color} />
|
|
148
|
+
</View>
|
|
149
|
+
);
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
const renderTabButton = (props: BottomTabBarButtonProps) => (
|
|
153
|
+
<CustomTabButton
|
|
154
|
+
props={props}
|
|
155
|
+
rippleColor={appliedTheme.colors.border}
|
|
156
|
+
/>
|
|
157
|
+
);
|
|
158
|
+
|
|
159
|
+
return (
|
|
160
|
+
<Tab.Screen
|
|
161
|
+
key={tab.key}
|
|
162
|
+
name={tab.key}
|
|
163
|
+
component={tab.screenComponent}
|
|
164
|
+
options={{
|
|
165
|
+
tabBarButton: renderTabButton,
|
|
166
|
+
tabBarLabel: tab.name,
|
|
167
|
+
tabBarIcon: renderTabIcon,
|
|
168
|
+
onTabPress: handleTabPress,
|
|
169
|
+
}}
|
|
170
|
+
/>
|
|
171
|
+
);
|
|
172
|
+
})}
|
|
136
173
|
</Tab.Navigator>
|
|
137
174
|
);
|
|
138
175
|
};
|
|
@@ -140,21 +177,13 @@ const TabBarTwo = ({ tabs, theme, onTabPress }: TabBarTwoProps) => {
|
|
|
140
177
|
export default TabBarTwo;
|
|
141
178
|
|
|
142
179
|
const styles = StyleSheet.create({
|
|
143
|
-
|
|
180
|
+
tabButton: {
|
|
144
181
|
flex: 1,
|
|
145
182
|
justifyContent: 'center',
|
|
146
183
|
alignItems: 'center',
|
|
147
184
|
},
|
|
148
|
-
|
|
185
|
+
iconContainer: {
|
|
149
186
|
justifyContent: 'center',
|
|
150
187
|
alignItems: 'center',
|
|
151
|
-
paddingHorizontal: scale(10),
|
|
152
|
-
paddingVertical: scale(4),
|
|
153
|
-
borderRadius: scale(30),
|
|
154
|
-
},
|
|
155
|
-
label: {
|
|
156
|
-
marginTop: scale(4),
|
|
157
|
-
fontSize: RFValue(10),
|
|
158
|
-
textAlign: 'center',
|
|
159
188
|
},
|
|
160
189
|
});
|