@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.
Files changed (106) hide show
  1. package/README.md +1 -1
  2. package/lib/module/components/Account/Account.js +1 -1
  3. package/lib/module/components/Account/Account.js.map +1 -1
  4. package/lib/module/components/Auth/AuthProvider/AuthProvider.js +48 -19
  5. package/lib/module/components/Auth/AuthProvider/AuthProvider.js.map +1 -1
  6. package/lib/module/components/Auth/Login/LoginWithEmail.js +4 -2
  7. package/lib/module/components/Auth/Login/LoginWithEmail.js.map +1 -1
  8. package/lib/module/components/Auth/OTP/OTP.js +15 -1
  9. package/lib/module/components/Auth/OTP/OTP.js.map +1 -1
  10. package/lib/module/components/Auth/SignUp/SignUp.js +4 -2
  11. package/lib/module/components/Auth/SignUp/SignUp.js.map +1 -1
  12. package/lib/module/components/BlurView/BlurView.js +171 -0
  13. package/lib/module/components/BlurView/BlurView.js.map +1 -0
  14. package/lib/module/components/BlurView/index.js +9 -0
  15. package/lib/module/components/BlurView/index.js.map +1 -0
  16. package/lib/module/components/Content/Card/Styles/Four.js +1 -1
  17. package/lib/module/components/Content/Card/Styles/Four.js.map +1 -1
  18. package/lib/module/components/Content/Content.js +4 -2
  19. package/lib/module/components/Content/Content.js.map +1 -1
  20. package/lib/module/components/ContentView/ContentView.js +4 -2
  21. package/lib/module/components/ContentView/ContentView.js.map +1 -1
  22. package/lib/module/components/ContentView/components/MiniInfo.js +64 -19
  23. package/lib/module/components/ContentView/components/MiniInfo.js.map +1 -1
  24. package/lib/module/components/Settings/AppSettings.js +1 -1
  25. package/lib/module/components/Settings/AppSettings.js.map +1 -1
  26. package/lib/module/components/Subscription/SubOne.js +340 -13
  27. package/lib/module/components/Subscription/SubOne.js.map +1 -1
  28. package/lib/module/components/TabBar/One.js +71 -108
  29. package/lib/module/components/TabBar/One.js.map +1 -1
  30. package/lib/module/components/TabBar/Three.js +63 -78
  31. package/lib/module/components/TabBar/Three.js.map +1 -1
  32. package/lib/module/components/TabBar/Two.js +110 -106
  33. package/lib/module/components/TabBar/Two.js.map +1 -1
  34. package/lib/module/components/User/PurchaseHistory/PurchaseHistory.js +324 -0
  35. package/lib/module/components/User/PurchaseHistory/PurchaseHistory.js.map +1 -0
  36. package/lib/module/components/User/index.js +2 -1
  37. package/lib/module/components/User/index.js.map +1 -1
  38. package/lib/module/components/index.js +1 -0
  39. package/lib/module/components/index.js.map +1 -1
  40. package/lib/module/hooks/useNavigationMode.js +34 -0
  41. package/lib/module/hooks/useNavigationMode.js.map +1 -0
  42. package/lib/module/utils/Spacing.js +26 -0
  43. package/lib/module/utils/Spacing.js.map +1 -0
  44. package/lib/typescript/src/components/Auth/AuthProvider/AuthProvider.d.ts +1 -0
  45. package/lib/typescript/src/components/Auth/AuthProvider/AuthProvider.d.ts.map +1 -1
  46. package/lib/typescript/src/components/Auth/Login/LoginWithEmail.d.ts.map +1 -1
  47. package/lib/typescript/src/components/Auth/OTP/OTP.d.ts +2 -0
  48. package/lib/typescript/src/components/Auth/OTP/OTP.d.ts.map +1 -1
  49. package/lib/typescript/src/components/Auth/SignUp/SignUp.d.ts.map +1 -1
  50. package/lib/typescript/src/components/Auth/index.d.ts +2 -0
  51. package/lib/typescript/src/components/Auth/index.d.ts.map +1 -1
  52. package/lib/typescript/src/components/BlurView/BlurView.d.ts +48 -0
  53. package/lib/typescript/src/components/BlurView/BlurView.d.ts.map +1 -0
  54. package/lib/typescript/src/components/BlurView/index.d.ts +7 -0
  55. package/lib/typescript/src/components/BlurView/index.d.ts.map +1 -0
  56. package/lib/typescript/src/components/Content/Card/Styles/Four.d.ts.map +1 -1
  57. package/lib/typescript/src/components/Content/Content.d.ts.map +1 -1
  58. package/lib/typescript/src/components/ContentView/ContentView.d.ts +1 -1
  59. package/lib/typescript/src/components/ContentView/ContentView.d.ts.map +1 -1
  60. package/lib/typescript/src/components/ContentView/components/MiniInfo.d.ts +17 -1
  61. package/lib/typescript/src/components/ContentView/components/MiniInfo.d.ts.map +1 -1
  62. package/lib/typescript/src/components/Subscription/SubOne.d.ts +6 -0
  63. package/lib/typescript/src/components/Subscription/SubOne.d.ts.map +1 -1
  64. package/lib/typescript/src/components/Subscription/index.d.ts.map +1 -1
  65. package/lib/typescript/src/components/TabBar/One.d.ts +2 -2
  66. package/lib/typescript/src/components/TabBar/One.d.ts.map +1 -1
  67. package/lib/typescript/src/components/TabBar/Three.d.ts +3 -2
  68. package/lib/typescript/src/components/TabBar/Three.d.ts.map +1 -1
  69. package/lib/typescript/src/components/TabBar/Two.d.ts +13 -4
  70. package/lib/typescript/src/components/TabBar/Two.d.ts.map +1 -1
  71. package/lib/typescript/src/components/TabBar/index.d.ts +1 -1
  72. package/lib/typescript/src/components/User/PurchaseHistory/PurchaseHistory.d.ts +50 -0
  73. package/lib/typescript/src/components/User/PurchaseHistory/PurchaseHistory.d.ts.map +1 -0
  74. package/lib/typescript/src/components/User/index.d.ts +2 -1
  75. package/lib/typescript/src/components/User/index.d.ts.map +1 -1
  76. package/lib/typescript/src/components/index.d.ts +1 -0
  77. package/lib/typescript/src/components/index.d.ts.map +1 -1
  78. package/lib/typescript/src/hooks/useNavigationMode.d.ts +14 -0
  79. package/lib/typescript/src/hooks/useNavigationMode.d.ts.map +1 -0
  80. package/lib/typescript/src/types/content/content-view.types.d.ts +2 -0
  81. package/lib/typescript/src/types/content/content-view.types.d.ts.map +1 -1
  82. package/lib/typescript/src/utils/Spacing.d.ts +16 -0
  83. package/lib/typescript/src/utils/Spacing.d.ts.map +1 -0
  84. package/package.json +9 -5
  85. package/src/components/Account/Account.tsx +1 -1
  86. package/src/components/Auth/AuthProvider/AuthProvider.tsx +82 -37
  87. package/src/components/Auth/Login/LoginWithEmail.tsx +9 -2
  88. package/src/components/Auth/OTP/OTP.tsx +37 -1
  89. package/src/components/Auth/SignUp/SignUp.tsx +9 -2
  90. package/src/components/BlurView/BlurView.tsx +199 -0
  91. package/src/components/BlurView/index.ts +7 -0
  92. package/src/components/Content/Card/Styles/Four.tsx +3 -1
  93. package/src/components/Content/Content.tsx +5 -4
  94. package/src/components/ContentView/ContentView.tsx +8 -1
  95. package/src/components/ContentView/components/MiniInfo.tsx +99 -22
  96. package/src/components/Settings/AppSettings.tsx +1 -1
  97. package/src/components/Subscription/SubOne.tsx +422 -11
  98. package/src/components/TabBar/One.tsx +79 -141
  99. package/src/components/TabBar/Three.tsx +84 -99
  100. package/src/components/TabBar/Two.tsx +139 -110
  101. package/src/components/User/PurchaseHistory/PurchaseHistory.tsx +439 -0
  102. package/src/components/User/index.ts +8 -1
  103. package/src/components/index.ts +1 -0
  104. package/src/hooks/useNavigationMode.ts +35 -0
  105. package/src/types/content/content-view.types.ts +5 -0
  106. package/src/utils/Spacing.ts +27 -0
@@ -1,15 +1,17 @@
1
1
  /**
2
- * @author Ashok Desai
3
- * @lastModified jun 23 Jun 2025 at 11:40 AM
2
+ * @author Naresh Dhamu
3
+ * @lastModified Thu 06 Nov 2025 at 12:30 PM
4
4
  */
5
- import React, { useState } from 'react';
6
- import { View, Pressable, StyleSheet, Platform } from 'react-native';
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
- // Extracted TabBarButton component
34
- const TabBarButton = ({
35
- tab,
36
- isActive,
37
- appliedTheme,
38
- isDarkMode,
39
- onPress,
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
- return (
57
- <View style={styles.tabItem}>
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: isDarkMode
66
- ? 'rgba(255, 255, 255, 0.12)'
67
- : 'rgba(0, 0, 0, 0.08)',
73
+ color: rippleColor,
68
74
  borderless: true,
69
- radius: scale(42),
75
+ radius: RIPPLE_RADIUS,
70
76
  }}
71
- style={styles.pressable}
72
- accessibilityRole="button"
73
- accessibilityLabel={`Tab: ${tab.name}`}
77
+ onPress={onPress}
78
+ onLongPress={onLongPress}
79
+ accessibilityRole={accessibilityRole}
80
+ accessibilityState={accessibilityState}
81
+ testID={testID}
82
+ style={[style, styles.tabButton]}
74
83
  >
75
- <Icon width={scale(24)} height={scale(24)} color={color} />
76
- <Text style={[styles.label]} color={color} numberOfLines={1}>
77
- {tab.name}
78
- </Text>
84
+ {children}
79
85
  </Pressable>
80
- </View>
81
- );
82
- };
86
+ );
87
+ }
88
+ );
89
+
90
+ CustomTabButton.displayName = 'CustomTabButton';
83
91
 
84
- const TabBarTwo = ({ tabs, theme, onTabPress }: TabBarTwoProps) => {
85
- const { theme: appliedTheme, isDarkMode } = useInternalTheme(theme);
86
- const [activeTab, setActiveTab] = useState(tabs[0]?.key);
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
- screenOptions={{
91
- headerShown: false,
92
- tabBarShowLabel: false,
93
- tabBarHideOnKeyboard: true,
94
- tabBarStyle: {
95
- position: 'absolute',
96
- bottom: scale(20),
97
- marginHorizontal: scale(16),
98
- height: scale(70),
99
- borderRadius: scale(40),
100
- backgroundColor: appliedTheme.colors.background,
101
- borderWidth: 2,
102
- borderTopWidth: 2,
103
- borderTopColor: appliedTheme.colors.border,
104
- borderColor: appliedTheme.colors.border,
105
- paddingBottom: Platform.OS === 'ios' ? scale(12) : scale(10),
106
- paddingTop: Platform.OS === 'ios' ? scale(12) : scale(10),
107
- shadowColor: appliedTheme.colors.shadow,
108
- shadowOffset: { width: 0, height: 2 },
109
- shadowOpacity: 0.2,
110
- shadowRadius: 6,
111
- elevation: 10,
112
- overflow: 'hidden',
113
- },
114
- }}
115
- >
116
- {tabs.map((tab) => (
117
- <Tab.Screen
118
- key={tab.key}
119
- name={tab.key}
120
- component={tab.screenComponent}
121
- options={{
122
- tabBarButton: ({ onPress }: any) => (
123
- <TabBarButton
124
- tab={tab}
125
- isActive={tab.key === activeTab}
126
- appliedTheme={appliedTheme}
127
- isDarkMode={isDarkMode}
128
- onPress={onPress}
129
- onTabPress={onTabPress}
130
- setActiveTab={setActiveTab}
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
- tabItem: {
180
+ tabButton: {
144
181
  flex: 1,
145
182
  justifyContent: 'center',
146
183
  alignItems: 'center',
147
184
  },
148
- pressable: {
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
  });