@zezosoft/zezo-ott-react-native-ui-kit 1.0.8 → 1.1.0

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 (211) 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/NowWatching/NowWatching.js.map +1 -1
  17. package/lib/module/components/Content/Card/Sliders/Styles/One.js.map +1 -1
  18. package/lib/module/components/Content/Card/Sliders/Styles/Two.js.map +1 -1
  19. package/lib/module/components/Content/Card/Styles/Five.js.map +1 -1
  20. package/lib/module/components/Content/Card/Styles/Four.js +2 -3
  21. package/lib/module/components/Content/Card/Styles/Four.js.map +1 -1
  22. package/lib/module/components/Content/Card/Styles/One.js +1 -2
  23. package/lib/module/components/Content/Card/Styles/One.js.map +1 -1
  24. package/lib/module/components/Content/Card/Styles/RotateInOut.js.map +1 -1
  25. package/lib/module/components/Content/Card/Styles/Six.js.map +1 -1
  26. package/lib/module/components/Content/Card/Styles/Three.js.map +1 -1
  27. package/lib/module/components/Content/Card/Styles/TopTen.js.map +1 -1
  28. package/lib/module/components/Content/Card/Styles/Two.js +1 -2
  29. package/lib/module/components/Content/Card/Styles/Two.js.map +1 -1
  30. package/lib/module/components/Content/Card/components/CardPoster.js.map +1 -1
  31. package/lib/module/components/Content/Content.js +4 -2
  32. package/lib/module/components/Content/Content.js.map +1 -1
  33. package/lib/module/components/Content/Sections.js.map +1 -1
  34. package/lib/module/components/ContentView/ContentView.js +4 -2
  35. package/lib/module/components/ContentView/ContentView.js.map +1 -1
  36. package/lib/module/components/ContentView/MoreContentList.js.map +1 -1
  37. package/lib/module/components/ContentView/components/CastCard.js +2 -1
  38. package/lib/module/components/ContentView/components/CastCard.js.map +1 -1
  39. package/lib/module/components/ContentView/components/EpisodeCard.js +3 -3
  40. package/lib/module/components/ContentView/components/EpisodeCard.js.map +1 -1
  41. package/lib/module/components/ContentView/components/GenreTags.js.map +1 -1
  42. package/lib/module/components/ContentView/components/MiniInfo.js +64 -19
  43. package/lib/module/components/ContentView/components/MiniInfo.js.map +1 -1
  44. package/lib/module/components/ContentView/components/Title.js.map +1 -1
  45. package/lib/module/components/Search/One.js.map +1 -1
  46. package/lib/module/components/Settings/AppSettings.js +1 -1
  47. package/lib/module/components/Settings/AppSettings.js.map +1 -1
  48. package/lib/module/components/Subscription/SubOne.js +340 -14
  49. package/lib/module/components/Subscription/SubOne.js.map +1 -1
  50. package/lib/module/components/TabBar/One.js +71 -108
  51. package/lib/module/components/TabBar/One.js.map +1 -1
  52. package/lib/module/components/TabBar/Three.js +63 -78
  53. package/lib/module/components/TabBar/Three.js.map +1 -1
  54. package/lib/module/components/TabBar/Two.js +110 -106
  55. package/lib/module/components/TabBar/Two.js.map +1 -1
  56. package/lib/module/components/User/PurchaseHistory/PurchaseHistory.js +324 -0
  57. package/lib/module/components/User/PurchaseHistory/PurchaseHistory.js.map +1 -0
  58. package/lib/module/components/User/WatchHistory/WatchHistory.js.map +1 -1
  59. package/lib/module/components/User/WatchLater/WatchLater.js.map +1 -1
  60. package/lib/module/components/User/index.js +2 -1
  61. package/lib/module/components/User/index.js.map +1 -1
  62. package/lib/module/components/index.js +1 -0
  63. package/lib/module/components/index.js.map +1 -1
  64. package/lib/module/hooks/useNavigationMode.js +34 -0
  65. package/lib/module/hooks/useNavigationMode.js.map +1 -0
  66. package/lib/module/utils/Spacing.js +26 -0
  67. package/lib/module/utils/Spacing.js.map +1 -0
  68. package/lib/typescript/src/components/Auth/AuthProvider/AuthProvider.d.ts +1 -0
  69. package/lib/typescript/src/components/Auth/AuthProvider/AuthProvider.d.ts.map +1 -1
  70. package/lib/typescript/src/components/Auth/Login/LoginWithEmail.d.ts.map +1 -1
  71. package/lib/typescript/src/components/Auth/OTP/OTP.d.ts +2 -0
  72. package/lib/typescript/src/components/Auth/OTP/OTP.d.ts.map +1 -1
  73. package/lib/typescript/src/components/Auth/SignUp/SignUp.d.ts.map +1 -1
  74. package/lib/typescript/src/components/Auth/index.d.ts +2 -0
  75. package/lib/typescript/src/components/Auth/index.d.ts.map +1 -1
  76. package/lib/typescript/src/components/BlurView/BlurView.d.ts +48 -0
  77. package/lib/typescript/src/components/BlurView/BlurView.d.ts.map +1 -0
  78. package/lib/typescript/src/components/BlurView/index.d.ts +7 -0
  79. package/lib/typescript/src/components/BlurView/index.d.ts.map +1 -0
  80. package/lib/typescript/src/components/Content/Card/NowWatching/NowWatching.d.ts +2 -1
  81. package/lib/typescript/src/components/Content/Card/NowWatching/NowWatching.d.ts.map +1 -1
  82. package/lib/typescript/src/components/Content/Card/Sliders/Styles/One.d.ts +2 -1
  83. package/lib/typescript/src/components/Content/Card/Sliders/Styles/One.d.ts.map +1 -1
  84. package/lib/typescript/src/components/Content/Card/Sliders/Styles/Two.d.ts +2 -1
  85. package/lib/typescript/src/components/Content/Card/Sliders/Styles/Two.d.ts.map +1 -1
  86. package/lib/typescript/src/components/Content/Card/Sliders/index.d.ts +2 -2
  87. package/lib/typescript/src/components/Content/Card/Styles/Five.d.ts +2 -1
  88. package/lib/typescript/src/components/Content/Card/Styles/Five.d.ts.map +1 -1
  89. package/lib/typescript/src/components/Content/Card/Styles/Four.d.ts +2 -1
  90. package/lib/typescript/src/components/Content/Card/Styles/Four.d.ts.map +1 -1
  91. package/lib/typescript/src/components/Content/Card/Styles/One.d.ts +2 -1
  92. package/lib/typescript/src/components/Content/Card/Styles/One.d.ts.map +1 -1
  93. package/lib/typescript/src/components/Content/Card/Styles/RotateInOut.d.ts +2 -1
  94. package/lib/typescript/src/components/Content/Card/Styles/RotateInOut.d.ts.map +1 -1
  95. package/lib/typescript/src/components/Content/Card/Styles/Six.d.ts +2 -1
  96. package/lib/typescript/src/components/Content/Card/Styles/Six.d.ts.map +1 -1
  97. package/lib/typescript/src/components/Content/Card/Styles/Three.d.ts +2 -1
  98. package/lib/typescript/src/components/Content/Card/Styles/Three.d.ts.map +1 -1
  99. package/lib/typescript/src/components/Content/Card/Styles/TopTen.d.ts +2 -1
  100. package/lib/typescript/src/components/Content/Card/Styles/TopTen.d.ts.map +1 -1
  101. package/lib/typescript/src/components/Content/Card/Styles/Two.d.ts +2 -1
  102. package/lib/typescript/src/components/Content/Card/Styles/Two.d.ts.map +1 -1
  103. package/lib/typescript/src/components/Content/Card/components/CardPoster.d.ts +1 -1
  104. package/lib/typescript/src/components/Content/Card/components/CardPoster.d.ts.map +1 -1
  105. package/lib/typescript/src/components/Content/Card/components/RentOrBuyIcon.d.ts +1 -1
  106. package/lib/typescript/src/components/Content/Card/components/RentOrBuyIcon.d.ts.map +1 -1
  107. package/lib/typescript/src/components/Content/Card/index.d.ts +24 -24
  108. package/lib/typescript/src/components/Content/Content.d.ts +2 -1
  109. package/lib/typescript/src/components/Content/Content.d.ts.map +1 -1
  110. package/lib/typescript/src/components/Content/Sections.d.ts +2 -1
  111. package/lib/typescript/src/components/Content/Sections.d.ts.map +1 -1
  112. package/lib/typescript/src/components/ContentView/ContentView.d.ts +1 -1
  113. package/lib/typescript/src/components/ContentView/ContentView.d.ts.map +1 -1
  114. package/lib/typescript/src/components/ContentView/MoreContentList.d.ts +1 -1
  115. package/lib/typescript/src/components/ContentView/MoreContentList.d.ts.map +1 -1
  116. package/lib/typescript/src/components/ContentView/components/AboutSection.d.ts +1 -1
  117. package/lib/typescript/src/components/ContentView/components/AboutSection.d.ts.map +1 -1
  118. package/lib/typescript/src/components/ContentView/components/CastCard.d.ts +1 -1
  119. package/lib/typescript/src/components/ContentView/components/CastCard.d.ts.map +1 -1
  120. package/lib/typescript/src/components/ContentView/components/EpisodeCard.d.ts +1 -1
  121. package/lib/typescript/src/components/ContentView/components/EpisodeCard.d.ts.map +1 -1
  122. package/lib/typescript/src/components/ContentView/components/GenreTags.d.ts +1 -1
  123. package/lib/typescript/src/components/ContentView/components/GenreTags.d.ts.map +1 -1
  124. package/lib/typescript/src/components/ContentView/components/MiniInfo.d.ts +18 -2
  125. package/lib/typescript/src/components/ContentView/components/MiniInfo.d.ts.map +1 -1
  126. package/lib/typescript/src/components/ContentView/components/Title.d.ts +1 -1
  127. package/lib/typescript/src/components/ContentView/components/Title.d.ts.map +1 -1
  128. package/lib/typescript/src/components/Search/One.d.ts +2 -1
  129. package/lib/typescript/src/components/Search/One.d.ts.map +1 -1
  130. package/lib/typescript/src/components/Subscription/SubOne.d.ts +6 -0
  131. package/lib/typescript/src/components/Subscription/SubOne.d.ts.map +1 -1
  132. package/lib/typescript/src/components/Subscription/index.d.ts.map +1 -1
  133. package/lib/typescript/src/components/TabBar/One.d.ts +2 -2
  134. package/lib/typescript/src/components/TabBar/One.d.ts.map +1 -1
  135. package/lib/typescript/src/components/TabBar/Three.d.ts +3 -2
  136. package/lib/typescript/src/components/TabBar/Three.d.ts.map +1 -1
  137. package/lib/typescript/src/components/TabBar/Two.d.ts +13 -4
  138. package/lib/typescript/src/components/TabBar/Two.d.ts.map +1 -1
  139. package/lib/typescript/src/components/TabBar/index.d.ts +1 -1
  140. package/lib/typescript/src/components/User/PurchaseHistory/PurchaseHistory.d.ts +50 -0
  141. package/lib/typescript/src/components/User/PurchaseHistory/PurchaseHistory.d.ts.map +1 -0
  142. package/lib/typescript/src/components/User/WatchHistory/WatchHistory.d.ts +1 -1
  143. package/lib/typescript/src/components/User/WatchHistory/WatchHistory.d.ts.map +1 -1
  144. package/lib/typescript/src/components/User/WatchLater/WatchLater.d.ts +1 -1
  145. package/lib/typescript/src/components/User/WatchLater/WatchLater.d.ts.map +1 -1
  146. package/lib/typescript/src/components/User/index.d.ts +2 -1
  147. package/lib/typescript/src/components/User/index.d.ts.map +1 -1
  148. package/lib/typescript/src/components/index.d.ts +1 -0
  149. package/lib/typescript/src/components/index.d.ts.map +1 -1
  150. package/lib/typescript/src/hooks/useNavigationMode.d.ts +14 -0
  151. package/lib/typescript/src/hooks/useNavigationMode.d.ts.map +1 -0
  152. package/lib/typescript/src/types/content/content-view.types.d.ts +3 -1
  153. package/lib/typescript/src/types/content/content-view.types.d.ts.map +1 -1
  154. package/lib/typescript/src/types/index.d.ts +1 -1
  155. package/lib/typescript/src/types/index.d.ts.map +1 -1
  156. package/lib/typescript/src/types/sections/index.d.ts +1 -1
  157. package/lib/typescript/src/types/sections/index.d.ts.map +1 -1
  158. package/lib/typescript/src/utils/Spacing.d.ts +16 -0
  159. package/lib/typescript/src/utils/Spacing.d.ts.map +1 -0
  160. package/package.json +10 -5
  161. package/src/components/Account/Account.tsx +1 -1
  162. package/src/components/Auth/AuthProvider/AuthProvider.tsx +82 -37
  163. package/src/components/Auth/Login/LoginWithEmail.tsx +9 -2
  164. package/src/components/Auth/OTP/OTP.tsx +37 -1
  165. package/src/components/Auth/SignUp/SignUp.tsx +9 -2
  166. package/src/components/BlurView/BlurView.tsx +199 -0
  167. package/src/components/BlurView/index.ts +7 -0
  168. package/src/components/Content/Card/NowWatching/NowWatching.tsx +2 -5
  169. package/src/components/Content/Card/Sliders/Styles/One.tsx +2 -1
  170. package/src/components/Content/Card/Sliders/Styles/Two.tsx +2 -1
  171. package/src/components/Content/Card/Styles/Five.tsx +1 -1
  172. package/src/components/Content/Card/Styles/Four.tsx +4 -2
  173. package/src/components/Content/Card/Styles/One.tsx +1 -1
  174. package/src/components/Content/Card/Styles/RotateInOut.tsx +1 -1
  175. package/src/components/Content/Card/Styles/Six.tsx +1 -1
  176. package/src/components/Content/Card/Styles/Three.tsx +1 -1
  177. package/src/components/Content/Card/Styles/TopTen.tsx +1 -1
  178. package/src/components/Content/Card/Styles/Two.tsx +1 -1
  179. package/src/components/Content/Card/components/CardPoster.tsx +1 -1
  180. package/src/components/Content/Card/components/RentOrBuyIcon.tsx +1 -1
  181. package/src/components/Content/Content.tsx +7 -5
  182. package/src/components/Content/Sections.tsx +2 -1
  183. package/src/components/ContentView/ContentView.tsx +8 -1
  184. package/src/components/ContentView/MoreContentList.tsx +1 -1
  185. package/src/components/ContentView/components/AboutSection.tsx +1 -1
  186. package/src/components/ContentView/components/CastCard.tsx +2 -1
  187. package/src/components/ContentView/components/EpisodeCard.tsx +5 -1
  188. package/src/components/ContentView/components/GenreTags.tsx +1 -1
  189. package/src/components/ContentView/components/MiniInfo.tsx +100 -23
  190. package/src/components/ContentView/components/Title.tsx +1 -1
  191. package/src/components/Search/One.tsx +2 -6
  192. package/src/components/Settings/AppSettings.tsx +1 -1
  193. package/src/components/Subscription/SubOne.tsx +422 -12
  194. package/src/components/TabBar/One.tsx +79 -141
  195. package/src/components/TabBar/Three.tsx +84 -99
  196. package/src/components/TabBar/Two.tsx +139 -110
  197. package/src/components/User/PurchaseHistory/PurchaseHistory.tsx +439 -0
  198. package/src/components/User/WatchHistory/WatchHistory.tsx +1 -1
  199. package/src/components/User/WatchLater/WatchLater.tsx +1 -1
  200. package/src/components/User/index.ts +8 -1
  201. package/src/components/index.ts +1 -0
  202. package/src/hooks/useNavigationMode.ts +35 -0
  203. package/src/types/content/content-view.types.ts +6 -1
  204. package/src/types/index.ts +1 -1
  205. package/src/types/sections/index.ts +1 -1
  206. package/src/utils/Spacing.ts +27 -0
  207. package/lib/module/types/content/index.js +0 -2
  208. package/lib/module/types/content/index.js.map +0 -1
  209. package/lib/typescript/src/types/content/index.d.ts +0 -174
  210. package/lib/typescript/src/types/content/index.d.ts.map +0 -1
  211. package/src/types/content/index.ts +0 -194
@@ -1,16 +1,18 @@
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 11:50 AM
4
4
  */
5
5
 
6
- import React, { useState } from 'react';
7
- import { View, Pressable, Platform, StyleSheet } from 'react-native';
6
+ import React from 'react';
7
+ import { View, StyleSheet, Pressable, Platform } from 'react-native';
8
8
  import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
9
+ import type { BottomTabBarButtonProps } from '@react-navigation/bottom-tabs';
9
10
  import { scale } from 'react-native-size-matters';
10
11
  import { useInternalTheme } from '../../theme/hook/useInternalTheme';
11
- import { Text } from '../Text';
12
- import type { ITheme, ThemeOverride } from '../../theme/themes';
12
+ import type { ThemeOverride } from '../../theme/themes';
13
13
  import { RFValue } from 'react-native-responsive-fontsize';
14
+ import { useSafeAreaInsets } from 'react-native-safe-area-context';
15
+ import { useNavigationMode } from '../../hooks/useNavigationMode';
14
16
 
15
17
  type ITab = {
16
18
  key: string;
@@ -39,103 +41,39 @@ export type TabBarOneProps = {
39
41
  };
40
42
 
41
43
  const Tab = createBottomTabNavigator();
42
- type TabBarButtonProps = {
43
- onPress?: (e: any) => void;
44
- tab: ITab;
45
- isActive: boolean;
46
- appliedTheme: ITheme;
47
- isDarkMode: boolean;
48
- setActiveTab: (key: string) => void;
49
- onTabPress?: (key: string) => void;
50
- renderIcon?: ({
51
- icon,
52
- color,
53
- size,
54
- }: {
55
- icon: React.ComponentType<{ width: number; height: number; color: string }>;
56
- color: string;
57
- size: number;
58
- }) => React.ReactNode;
59
- };
60
44
 
61
- const TabBarButton: React.FC<TabBarButtonProps> = ({
62
- onPress,
63
- tab,
64
- isActive,
65
- appliedTheme,
66
- isDarkMode,
67
- setActiveTab,
68
- onTabPress,
69
- renderIcon,
70
- }) => {
71
- const color = isActive
72
- ? appliedTheme.colors.primary
73
- : appliedTheme.colors.textPrimary;
45
+ const TabBarOne = ({ tabs, theme, onTabPress, renderIcon }: TabBarOneProps) => {
46
+ const { isGestureNav } = useNavigationMode();
47
+ const insets = useSafeAreaInsets();
48
+ const { theme: appliedTheme } = useInternalTheme(theme);
74
49
 
75
- const iconSize = scale(24);
50
+ const baseHeight =
51
+ Platform.OS === 'android'
52
+ ? isGestureNav
53
+ ? scale(53)
54
+ : scale(68)
55
+ : scale(35);
76
56
 
77
- const icon = renderIcon ? (
78
- renderIcon({ icon: tab.icon, color, size: iconSize })
79
- ) : (
80
- <tab.icon width={iconSize} height={iconSize} color={color} />
81
- );
82
-
83
- return (
84
- <View style={styles.buttonWrapper}>
85
- <Pressable
86
- onPress={(e) => {
87
- onPress?.(e);
88
- setActiveTab(tab.key);
89
- onTabPress?.(tab.key);
90
- }}
91
- android_ripple={{
92
- color: isDarkMode
93
- ? 'rgba(255, 255, 255, 0.12)'
94
- : 'rgba(0, 0, 0, 0.08)',
95
- borderless: true,
96
- radius: scale(35),
97
- }}
98
- style={styles.iconWithLabel}
99
- accessibilityRole="button"
100
- accessibilityLabel={`Tab: ${tab.name}`}
101
- >
102
- <View style={{ marginBottom: scale(3) }}>{icon}</View>
103
- <Text style={[styles.label]} color={color} numberOfLines={1}>
104
- {tab.name}
105
- </Text>
106
- </Pressable>
107
- </View>
108
- );
109
- };
110
-
111
- const TabBarOne = ({ tabs, theme, onTabPress, renderIcon }: TabBarOneProps) => {
112
- const { theme: appliedTheme, isDarkMode } = useInternalTheme(theme);
113
- const [activeTab, setActiveTab] = useState(tabs[0]?.key);
57
+ const tabBarHeight = baseHeight + insets.bottom;
114
58
 
115
59
  return (
116
60
  <Tab.Navigator
117
- screenListeners={{
118
- state: (e: any) => {
119
- const index = e.data.state.index;
120
- const currentKey = tabs[index]?.key;
121
- if (currentKey) setActiveTab(currentKey);
122
- },
123
- }}
124
61
  screenOptions={{
125
62
  headerShown: false,
126
- tabBarShowLabel: false,
127
63
  tabBarHideOnKeyboard: true,
128
-
129
64
  tabBarStyle: {
130
- position: 'absolute',
131
- bottom: 0,
132
- height: scale(80),
133
65
  backgroundColor: appliedTheme.colors.background,
134
- borderTopColor: appliedTheme.colors.border,
135
- borderTopWidth: 0.5,
136
- paddingBottom: Platform.OS === 'ios' ? scale(28) : scale(18),
137
- paddingTop: scale(15),
138
- zIndex: 100,
66
+ borderColor: appliedTheme.colors.border,
67
+ borderTopWidth: scale(0.5),
68
+ paddingHorizontal: scale(5),
69
+ height: tabBarHeight,
70
+ },
71
+
72
+ tabBarActiveTintColor: appliedTheme.colors.primary,
73
+ tabBarInactiveTintColor: appliedTheme.colors.textPrimary,
74
+
75
+ tabBarLabelStyle: {
76
+ fontSize: RFValue(10),
139
77
  },
140
78
  }}
141
79
  >
@@ -145,17 +83,54 @@ const TabBarOne = ({ tabs, theme, onTabPress, renderIcon }: TabBarOneProps) => {
145
83
  name={tab.key}
146
84
  component={tab.screenComponent}
147
85
  options={{
148
- tabBarButton: (props: any) =>
149
- TabBarButtonWrapperWithProps({
150
- ...props,
151
- tab,
152
- isActive: tab.key === activeTab,
153
- appliedTheme: appliedTheme,
154
- isDarkMode,
155
- setActiveTab: setActiveTab,
156
- onTabPress: onTabPress,
157
- renderIcon: renderIcon,
158
- }),
86
+ tabBarButton: (props: BottomTabBarButtonProps) => {
87
+ const {
88
+ onPress,
89
+ onLongPress,
90
+ accessibilityRole,
91
+ accessibilityState,
92
+ testID,
93
+ style,
94
+ children,
95
+ } = props;
96
+ return (
97
+ <Pressable
98
+ android_ripple={{
99
+ color: appliedTheme.colors.border,
100
+ borderless: true,
101
+ radius: scale(30),
102
+ }}
103
+ onPress={onPress}
104
+ onLongPress={onLongPress}
105
+ accessibilityRole={accessibilityRole}
106
+ accessibilityState={accessibilityState}
107
+ testID={testID}
108
+ style={style}
109
+ >
110
+ {children}
111
+ </Pressable>
112
+ );
113
+ },
114
+ onTabPress: () => onTabPress?.(tab.key),
115
+ tabBarLabel: tab.name,
116
+ tabBarIcon: ({
117
+ color,
118
+ }: {
119
+ color: string;
120
+ focused: boolean;
121
+ size: number;
122
+ }) => {
123
+ const iconSize = scale(24);
124
+ return renderIcon ? (
125
+ <View style={styles.iconContainer}>
126
+ {renderIcon({ icon: tab.icon, color, size: iconSize })}
127
+ </View>
128
+ ) : (
129
+ <View style={styles.iconContainer}>
130
+ <tab.icon width={iconSize} height={iconSize} color={color} />
131
+ </View>
132
+ );
133
+ },
159
134
  }}
160
135
  />
161
136
  ))}
@@ -163,48 +138,11 @@ const TabBarOne = ({ tabs, theme, onTabPress, renderIcon }: TabBarOneProps) => {
163
138
  );
164
139
  };
165
140
 
166
- type TabBarButtonWrapperProps = {
167
- onPress?: (e: any) => void;
168
- tab: ITab;
169
- isActive: boolean;
170
- isDarkMode: boolean;
171
- appliedTheme: ITheme;
172
- setActiveTab: (key: string) => void;
173
- onTabPress?: (key: string) => void;
174
- renderIcon?: ({
175
- icon,
176
- color,
177
- size,
178
- }: {
179
- icon: React.ComponentType<{ width: number; height: number; color: string }>;
180
- color: string;
181
- size: number;
182
- }) => React.ReactNode;
183
- };
184
-
185
- const TabBarButtonWrapper: React.FC<TabBarButtonWrapperProps> = (props) => {
186
- return <TabBarButton {...props} />;
187
- };
188
-
189
- function TabBarButtonWrapperWithProps(props: TabBarButtonWrapperProps) {
190
- return <TabBarButtonWrapper {...props} />;
191
- }
192
141
  export default TabBarOne;
193
142
 
194
143
  const styles = StyleSheet.create({
195
- buttonWrapper: {
196
- flex: 1,
144
+ iconContainer: {
197
145
  justifyContent: 'center',
198
146
  alignItems: 'center',
199
147
  },
200
- iconWithLabel: {
201
- justifyContent: 'center',
202
- alignItems: 'center',
203
- paddingHorizontal: scale(8),
204
- },
205
- label: {
206
- marginTop: scale(4),
207
- fontSize: RFValue(10),
208
- textAlign: 'center',
209
- },
210
148
  });
@@ -1,129 +1,127 @@
1
1
  /**
2
- * @author Naresh Desai
3
- * @lastModified Sat 26 Jul 2025 at 12:37 PM
2
+ * @author Naresh Dhamu
3
+ * @lastModified Sun 09 Nov 2025 at 01:33 PM
4
4
  */
5
+
5
6
  import React from 'react';
6
7
  import { View, Pressable, StyleSheet, Platform } from 'react-native';
7
- import { BlurView } from '@react-native-community/blur';
8
8
  import {
9
9
  createBottomTabNavigator,
10
10
  type BottomTabBarProps,
11
11
  } from '@react-navigation/bottom-tabs';
12
12
  import { scale } from 'react-native-size-matters';
13
+ import { useSafeAreaInsets } from 'react-native-safe-area-context';
14
+ import { BlurView } from '@react-native-community/blur';
13
15
 
14
- import type { ITheme, ThemeOverride } from '../../theme/themes';
16
+ import type { ThemeOverride } from '../../theme/themes';
15
17
  import { useInternalTheme } from '../../theme/hook/useInternalTheme';
16
18
 
17
19
  export interface ITab {
18
20
  key: string;
19
21
  name: string;
20
22
  screenComponent: React.ComponentType<any>;
21
- icon: React.ComponentType<{
22
- width: number;
23
- height: number;
24
- color: string;
25
- }>;
23
+ icon: React.ComponentType<{ width: number; height: number; color: string }>;
26
24
  }
27
25
 
28
26
  export interface TabBarThreeProps {
29
27
  tabs: ITab[];
30
28
  theme?: ThemeOverride;
31
29
  onTabPress?: (key: string) => void;
30
+ tabBarHeight?: number;
32
31
  }
33
32
 
34
33
  const Tab = createBottomTabNavigator();
35
- const ICON_BOX_SIZE = scale(52);
36
- const BOTTOM_BAR_HEIGHT = scale(70);
34
+ const TAB_BAR_HEIGHT = scale(65);
35
+ const TAB_BAR_OFFSET = Platform.OS === 'android' ? scale(5) : -scale(8);
37
36
 
38
- const CustomTabBar: React.FC<
39
- BottomTabBarProps & {
40
- tabs: ITab[];
41
- onTabPress?: (key: string) => void;
42
- theme: ITheme;
43
- }
44
- > = ({ state, navigation, tabs, onTabPress, theme }) => (
45
- <View style={styles.bottomWrapper}>
37
+ const TabBarThree: React.FC<TabBarThreeProps> = ({
38
+ tabs,
39
+ theme,
40
+ onTabPress,
41
+ tabBarHeight = TAB_BAR_HEIGHT,
42
+ }) => {
43
+ const insets = useSafeAreaInsets();
44
+ const { theme: appliedTheme } = useInternalTheme(theme);
45
+
46
+ const tabWidth = tabBarHeight - scale(10);
47
+ const tabPadding = scale(7);
48
+ const tabGap = scale(8);
49
+ const totalWidth =
50
+ tabs.length * tabWidth + tabPadding * 2 + tabGap * (tabs.length - 1);
51
+
52
+ const renderTabBar = (props: BottomTabBarProps) => (
46
53
  <View
47
- style={[
48
- styles.bottomBox,
49
- {
50
- borderColor: theme.colors.border,
51
- backgroundColor:
52
- Platform.OS === 'android' ? theme.colors.backdrop : 'transparent',
53
- },
54
- ]}
54
+ style={[styles.container, { bottom: insets.bottom + TAB_BAR_OFFSET }]}
55
55
  >
56
- {Platform.OS !== 'web' && (
57
- <BlurView
58
- style={StyleSheet.absoluteFill}
59
- blurAmount={25}
60
- reducedTransparencyFallbackColor={theme.colors.backdrop}
61
- blurType="light"
62
- />
63
- )}
64
- <View style={styles.row}>
56
+ <View
57
+ style={[
58
+ styles.tabBar,
59
+ {
60
+ height: tabBarHeight,
61
+ width: totalWidth,
62
+ paddingHorizontal: tabPadding,
63
+ gap: tabGap,
64
+ borderRadius: scale(tabBarHeight / 2),
65
+ borderColor: appliedTheme.colors.border,
66
+ backgroundColor:
67
+ Platform.OS === 'android'
68
+ ? appliedTheme.colors.backdrop
69
+ : 'transparent',
70
+ },
71
+ ]}
72
+ >
73
+ {Platform.OS !== 'web' && (
74
+ <BlurView
75
+ style={StyleSheet.absoluteFillObject}
76
+ blurType="light"
77
+ blurAmount={25}
78
+ reducedTransparencyFallbackColor="transparent"
79
+ />
80
+ )}
81
+
65
82
  {tabs.map((tab, index) => {
66
- const isFocused = state.index === index;
67
- const iconColor = isFocused
68
- ? theme.colors.buttonText
69
- : theme.colors.textPrimary;
70
- const bgColor = isFocused
71
- ? theme.colors.button
72
- : theme.colors.blueBackground;
73
- const isBorderColor = isFocused
74
- ? theme.colors.button
75
- : theme.colors.border;
83
+ const isFocused = props.state.index === index;
76
84
 
77
85
  return (
78
86
  <Pressable
79
87
  key={tab.key}
80
88
  onPress={() => {
81
89
  onTabPress?.(tab.key);
82
- navigation.navigate(tab.key);
90
+ props.navigation.navigate(tab.key);
83
91
  }}
84
92
  style={[
85
- styles.icon,
93
+ styles.tab,
86
94
  {
87
- backgroundColor: bgColor,
88
- borderColor: isBorderColor,
95
+ padding: scale(tabBarHeight / 5.1),
96
+ borderWidth: Platform.select({
97
+ ios: scale(1),
98
+ android: scale(1.5),
99
+ }),
100
+ backgroundColor: isFocused
101
+ ? appliedTheme.colors.button
102
+ : appliedTheme.colors.background,
103
+ borderColor: isFocused
104
+ ? appliedTheme.colors.button
105
+ : appliedTheme.colors.border,
89
106
  },
90
107
  ]}
91
108
  >
92
109
  <tab.icon
93
- width={scale(24)}
94
- height={scale(24)}
95
- color={iconColor}
110
+ width={scale(tabBarHeight / 3.1)}
111
+ height={scale(tabBarHeight / 3.1)}
112
+ color={
113
+ isFocused
114
+ ? appliedTheme.colors.buttonText
115
+ : appliedTheme.colors.textPrimary
116
+ }
96
117
  />
97
118
  </Pressable>
98
119
  );
99
120
  })}
100
121
  </View>
101
122
  </View>
102
- </View>
103
- );
104
-
105
- const renderTabBar =
106
- (
107
- tabs: ITab[],
108
- onTabPress: ((key: string) => void) | undefined,
109
- theme: ITheme
110
- ) =>
111
- (props: BottomTabBarProps) => (
112
- <CustomTabBar
113
- {...props}
114
- tabs={tabs}
115
- onTabPress={onTabPress}
116
- theme={theme}
117
- />
118
123
  );
119
124
 
120
- const TabBarThree: React.FC<TabBarThreeProps> = ({
121
- tabs,
122
- theme,
123
- onTabPress,
124
- }) => {
125
- const { theme: appliedTheme } = useInternalTheme(theme);
126
-
127
125
  return (
128
126
  <Tab.Navigator
129
127
  screenOptions={{
@@ -131,7 +129,7 @@ const TabBarThree: React.FC<TabBarThreeProps> = ({
131
129
  tabBarShowLabel: false,
132
130
  tabBarHideOnKeyboard: true,
133
131
  }}
134
- tabBar={renderTabBar(tabs, onTabPress, appliedTheme)}
132
+ tabBar={renderTabBar}
135
133
  >
136
134
  {tabs.map((tab) => (
137
135
  <Tab.Screen
@@ -145,39 +143,26 @@ const TabBarThree: React.FC<TabBarThreeProps> = ({
145
143
  };
146
144
 
147
145
  const styles = StyleSheet.create({
148
- bottomWrapper: {
146
+ container: {
149
147
  position: 'absolute',
150
- bottom: scale(20),
151
148
  left: 0,
152
149
  right: 0,
153
150
  alignItems: 'center',
154
151
  },
155
- bottomBox: {
156
- marginHorizontal: scale(16),
157
- alignSelf: 'center',
158
- height: BOTTOM_BAR_HEIGHT,
159
- borderRadius: scale(BOTTOM_BAR_HEIGHT / 2),
160
- overflow: 'hidden',
161
- borderWidth: Platform.select({ ios: scale(1), android: scale(1.5) }),
162
- alignItems: 'center',
163
- justifyContent: 'center',
164
- },
165
- row: {
152
+ tabBar: {
166
153
  flexDirection: 'row',
167
154
  justifyContent: 'space-between',
168
155
  alignItems: 'center',
169
- width: '100%',
170
- paddingHorizontal: scale(12),
171
- },
172
- icon: {
173
- width: ICON_BOX_SIZE,
174
- height: ICON_BOX_SIZE,
175
- borderRadius: ICON_BOX_SIZE / 2,
156
+
176
157
  borderWidth: Platform.select({ ios: scale(1), android: scale(1.5) }),
158
+ overflow: 'hidden',
159
+ marginHorizontal: 'auto',
160
+ },
161
+ tab: {
177
162
  justifyContent: 'center',
178
163
  alignItems: 'center',
179
- borderStyle: 'solid',
180
- zIndex: 1,
164
+ borderRadius: scale(100),
165
+ aspectRatio: 1,
181
166
  },
182
167
  });
183
168