@zezosoft/zezo-ott-react-native-ui-kit 1.0.7 → 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/Auth/SplashScreen/components/SplashVideo/SplashVideo.js +6 -32
- package/lib/module/components/Auth/SplashScreen/components/SplashVideo/SplashVideo.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 +353 -19
- 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/SplashScreen/components/SplashVideo/SplashVideo.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/types/content/index.d.ts +1 -1
- package/lib/typescript/src/types/content/index.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/Auth/SplashScreen/components/SplashVideo/SplashVideo.tsx +2 -33
- 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 +431 -16
- 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/types/content/index.ts +1 -5
- package/src/utils/Spacing.ts +27 -0
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author Naresh Dhamu
|
|
3
|
+
* @lastModified Thu 06 Nov 2025 at 05:00 PM
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import React from 'react';
|
|
7
|
+
import { View, StyleSheet, type ViewStyle, type StyleProp } from 'react-native';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* BlurView Props - Same as @react-native-community/blur
|
|
11
|
+
*/
|
|
12
|
+
export interface BlurViewProps {
|
|
13
|
+
/** Style of the BlurView container */
|
|
14
|
+
style?: StyleProp<ViewStyle>;
|
|
15
|
+
|
|
16
|
+
/** The blur type (tint) - exactly matches community lib */
|
|
17
|
+
blurType?:
|
|
18
|
+
| 'dark'
|
|
19
|
+
| 'light'
|
|
20
|
+
| 'xlight'
|
|
21
|
+
| 'extraDark'
|
|
22
|
+
| 'regular'
|
|
23
|
+
| 'prominent'
|
|
24
|
+
| 'chromeMaterial'
|
|
25
|
+
| 'material'
|
|
26
|
+
| 'thickMaterial'
|
|
27
|
+
| 'thinMaterial'
|
|
28
|
+
| 'ultraThinMaterial'
|
|
29
|
+
| 'chromeMaterialDark'
|
|
30
|
+
| 'materialDark'
|
|
31
|
+
| 'thickMaterialDark'
|
|
32
|
+
| 'thinMaterialDark'
|
|
33
|
+
| 'ultraThinMaterialDark'
|
|
34
|
+
| 'chromeMaterialLight'
|
|
35
|
+
| 'materialLight'
|
|
36
|
+
| 'thickMaterialLight'
|
|
37
|
+
| 'thinMaterialLight'
|
|
38
|
+
| 'ultraThinMaterialLight';
|
|
39
|
+
|
|
40
|
+
/** The blur intensity amount (0-100) - exactly matches community lib */
|
|
41
|
+
blurAmount?: number;
|
|
42
|
+
|
|
43
|
+
/** Fallback color for reduced transparency - exactly matches community lib */
|
|
44
|
+
reducedTransparencyFallbackColor?: string;
|
|
45
|
+
|
|
46
|
+
/** iOS only: Overlay color - exactly matches community lib */
|
|
47
|
+
overlayColor?: string;
|
|
48
|
+
|
|
49
|
+
/** Android only: Downsample factor (higher = more blur but lower quality) */
|
|
50
|
+
downsampleFactor?: number;
|
|
51
|
+
|
|
52
|
+
/** Android only: Blur radius */
|
|
53
|
+
blurRadius?: number;
|
|
54
|
+
|
|
55
|
+
/** Child components */
|
|
56
|
+
children?: React.ReactNode;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Custom BlurView - 100% Compatible with @react-native-community/blur
|
|
61
|
+
*
|
|
62
|
+
* ✅ Same API as @react-native-community/blur
|
|
63
|
+
* ✅ Works on iOS, Android, and Web
|
|
64
|
+
* ✅ Drop-in replacement - just change the import
|
|
65
|
+
* 🚫 Simulates blur (no live backdrop) using semi-transparent layers
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* ```tsx
|
|
69
|
+
* <BlurView
|
|
70
|
+
* style={styles.blur}
|
|
71
|
+
* blurType="light"
|
|
72
|
+
* blurAmount={10}
|
|
73
|
+
* reducedTransparencyFallbackColor="white"
|
|
74
|
+
* />
|
|
75
|
+
* ```
|
|
76
|
+
*/
|
|
77
|
+
const BlurView: React.FC<BlurViewProps> = ({
|
|
78
|
+
style,
|
|
79
|
+
blurType = 'light',
|
|
80
|
+
blurAmount = 100,
|
|
81
|
+
reducedTransparencyFallbackColor,
|
|
82
|
+
overlayColor,
|
|
83
|
+
children,
|
|
84
|
+
}) => {
|
|
85
|
+
// Clamp blur amount to 0-100 range (same as community lib)
|
|
86
|
+
const intensity = Math.max(0, Math.min(100, blurAmount));
|
|
87
|
+
|
|
88
|
+
// Get tint style based on blur type
|
|
89
|
+
const tintStyle = getBlurTintStyle(
|
|
90
|
+
blurType,
|
|
91
|
+
intensity,
|
|
92
|
+
reducedTransparencyFallbackColor,
|
|
93
|
+
overlayColor
|
|
94
|
+
);
|
|
95
|
+
|
|
96
|
+
// Platform-specific rendering
|
|
97
|
+
return (
|
|
98
|
+
<View style={[styles.container, style]}>
|
|
99
|
+
{/* Background blur layer */}
|
|
100
|
+
<View style={[StyleSheet.absoluteFillObject, tintStyle]} />
|
|
101
|
+
|
|
102
|
+
{/* Content layer */}
|
|
103
|
+
<View pointerEvents="box-none" style={styles.content}>
|
|
104
|
+
{children}
|
|
105
|
+
</View>
|
|
106
|
+
</View>
|
|
107
|
+
);
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Get blur tint style based on blurType
|
|
112
|
+
* Matches the exact behavior of @react-native-community/blur
|
|
113
|
+
*/
|
|
114
|
+
function getBlurTintStyle(
|
|
115
|
+
blurType: string,
|
|
116
|
+
intensity: number,
|
|
117
|
+
fallbackColor?: string,
|
|
118
|
+
overlayColor?: string
|
|
119
|
+
): ViewStyle {
|
|
120
|
+
// If overlayColor is provided, use it (iOS behavior)
|
|
121
|
+
if (overlayColor) {
|
|
122
|
+
return { backgroundColor: overlayColor };
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
// Calculate opacity based on intensity (0-100)
|
|
126
|
+
// Higher intensity = more opaque = stronger blur effect
|
|
127
|
+
const opacity = Math.min(0.95, intensity / 100);
|
|
128
|
+
const lightOpacity = opacity * 0.7;
|
|
129
|
+
const darkOpacity = opacity * 0.8;
|
|
130
|
+
|
|
131
|
+
// Match exact blur types from @react-native-community/blur
|
|
132
|
+
switch (blurType) {
|
|
133
|
+
// Dark blur types
|
|
134
|
+
case 'dark':
|
|
135
|
+
return { backgroundColor: `rgba(0, 0, 0, ${darkOpacity})` };
|
|
136
|
+
case 'extraDark':
|
|
137
|
+
return {
|
|
138
|
+
backgroundColor: `rgba(0, 0, 0, ${Math.min(0.98, darkOpacity * 1.2)})`,
|
|
139
|
+
};
|
|
140
|
+
case 'materialDark':
|
|
141
|
+
case 'thickMaterialDark':
|
|
142
|
+
case 'chromeMaterialDark':
|
|
143
|
+
return { backgroundColor: `rgba(28, 28, 30, ${darkOpacity})` };
|
|
144
|
+
case 'thinMaterialDark':
|
|
145
|
+
return { backgroundColor: `rgba(28, 28, 30, ${darkOpacity * 0.7})` };
|
|
146
|
+
case 'ultraThinMaterialDark':
|
|
147
|
+
return { backgroundColor: `rgba(28, 28, 30, ${darkOpacity * 0.5})` };
|
|
148
|
+
|
|
149
|
+
// Light blur types
|
|
150
|
+
case 'light':
|
|
151
|
+
return {
|
|
152
|
+
backgroundColor:
|
|
153
|
+
fallbackColor || `rgba(255, 255, 255, ${lightOpacity})`,
|
|
154
|
+
};
|
|
155
|
+
case 'xlight':
|
|
156
|
+
return { backgroundColor: `rgba(255, 255, 255, ${lightOpacity * 0.6})` };
|
|
157
|
+
case 'materialLight':
|
|
158
|
+
case 'chromeMaterialLight':
|
|
159
|
+
return { backgroundColor: `rgba(255, 255, 255, ${lightOpacity})` };
|
|
160
|
+
case 'thickMaterialLight':
|
|
161
|
+
return { backgroundColor: `rgba(242, 242, 247, ${lightOpacity})` };
|
|
162
|
+
case 'thinMaterialLight':
|
|
163
|
+
return { backgroundColor: `rgba(242, 242, 247, ${lightOpacity * 0.7})` };
|
|
164
|
+
case 'ultraThinMaterialLight':
|
|
165
|
+
return { backgroundColor: `rgba(242, 242, 247, ${lightOpacity * 0.5})` };
|
|
166
|
+
|
|
167
|
+
// Regular/prominent types
|
|
168
|
+
case 'regular':
|
|
169
|
+
case 'prominent':
|
|
170
|
+
return { backgroundColor: `rgba(255, 255, 255, ${lightOpacity * 0.8})` };
|
|
171
|
+
case 'material':
|
|
172
|
+
case 'chromeMaterial':
|
|
173
|
+
return { backgroundColor: `rgba(242, 242, 247, ${lightOpacity})` };
|
|
174
|
+
case 'thickMaterial':
|
|
175
|
+
return { backgroundColor: `rgba(242, 242, 247, ${lightOpacity * 1.1})` };
|
|
176
|
+
case 'thinMaterial':
|
|
177
|
+
return { backgroundColor: `rgba(242, 242, 247, ${lightOpacity * 0.7})` };
|
|
178
|
+
case 'ultraThinMaterial':
|
|
179
|
+
return { backgroundColor: `rgba(242, 242, 247, ${lightOpacity * 0.5})` };
|
|
180
|
+
|
|
181
|
+
// Default
|
|
182
|
+
default:
|
|
183
|
+
return {
|
|
184
|
+
backgroundColor:
|
|
185
|
+
fallbackColor || `rgba(255, 255, 255, ${lightOpacity})`,
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
const styles = StyleSheet.create({
|
|
191
|
+
container: {
|
|
192
|
+
overflow: 'hidden',
|
|
193
|
+
},
|
|
194
|
+
content: {
|
|
195
|
+
flex: 1,
|
|
196
|
+
},
|
|
197
|
+
});
|
|
198
|
+
|
|
199
|
+
export default BlurView;
|
|
@@ -234,7 +234,9 @@ const MovieCardFour: React.FC<MovieCardFourProps> = ({
|
|
|
234
234
|
ref={flatListRef}
|
|
235
235
|
data={data}
|
|
236
236
|
horizontal
|
|
237
|
-
keyExtractor={(item, index) =>
|
|
237
|
+
keyExtractor={(item, index) =>
|
|
238
|
+
item._id || `item-${item.slug || item.name || index}`
|
|
239
|
+
}
|
|
238
240
|
renderItem={renderItem}
|
|
239
241
|
showsHorizontalScrollIndicator={false}
|
|
240
242
|
contentContainerStyle={styles.listContent}
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
type StyleProp,
|
|
13
13
|
type ViewStyle,
|
|
14
14
|
} from 'react-native';
|
|
15
|
-
import { scale } from 'react-native-size-matters';
|
|
15
|
+
import { scale, verticalScale } from 'react-native-size-matters';
|
|
16
16
|
import Animated, {
|
|
17
17
|
type AnimatedStyle,
|
|
18
18
|
type SharedValue,
|
|
@@ -26,6 +26,7 @@ import type { IHistoryItem } from './Card/NowWatching/NowWatching';
|
|
|
26
26
|
import type { ThemeOverride } from '../../theme/themes';
|
|
27
27
|
import { NoContentFallback, type NoContentFallbackProps } from '../Fallbacks';
|
|
28
28
|
import { useInternalTheme } from '../../theme/hook';
|
|
29
|
+
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
29
30
|
|
|
30
31
|
export interface ICustomComponentsForContent {
|
|
31
32
|
type: string;
|
|
@@ -150,6 +151,7 @@ export const Content: React.FC<IContentProps> = ({
|
|
|
150
151
|
isLoading,
|
|
151
152
|
noContentFallbackProps,
|
|
152
153
|
}) => {
|
|
154
|
+
const insets = useSafeAreaInsets();
|
|
153
155
|
const sectionData = useMemo<IGetSectionData[]>(
|
|
154
156
|
() => contentData?.sectionData ?? [],
|
|
155
157
|
[contentData?.sectionData]
|
|
@@ -247,9 +249,8 @@ export const Content: React.FC<IContentProps> = ({
|
|
|
247
249
|
}
|
|
248
250
|
onEndReachedThreshold={0.7}
|
|
249
251
|
contentContainerStyle={[
|
|
250
|
-
{
|
|
251
|
-
|
|
252
|
-
},
|
|
252
|
+
{ paddingBottom: verticalScale(100) + insets.bottom },
|
|
253
|
+
|
|
253
254
|
contentContainerStyle,
|
|
254
255
|
]}
|
|
255
256
|
/>
|
|
@@ -33,6 +33,7 @@ export const ContentView = ({
|
|
|
33
33
|
recommendedContentCardStyles,
|
|
34
34
|
history,
|
|
35
35
|
episodeCardMode,
|
|
36
|
+
pricingAndExpiryInfo,
|
|
36
37
|
}: ComponentProps) => {
|
|
37
38
|
const { theme: appliedTheme } = useInternalTheme(theme);
|
|
38
39
|
const seekTime = history?.currentTime || 0;
|
|
@@ -95,7 +96,13 @@ export const ContentView = ({
|
|
|
95
96
|
isLoading={isLoading}
|
|
96
97
|
style={genreTagsStyles}
|
|
97
98
|
/>
|
|
98
|
-
<MiniInfo
|
|
99
|
+
<MiniInfo
|
|
100
|
+
content={content}
|
|
101
|
+
theme={theme}
|
|
102
|
+
isLoading={isLoading}
|
|
103
|
+
{...pricingAndExpiryInfo}
|
|
104
|
+
/>
|
|
105
|
+
|
|
99
106
|
<AboutSection
|
|
100
107
|
theme={appliedTheme}
|
|
101
108
|
description={content?.description}
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author Naresh Dhamu
|
|
3
|
+
* @lastModified Tue 11 Nov 2025 at 09:23 PM
|
|
4
|
+
*/
|
|
5
|
+
|
|
1
6
|
import React from 'react';
|
|
2
7
|
import {
|
|
3
8
|
View,
|
|
@@ -18,6 +23,20 @@ type Props = {
|
|
|
18
23
|
content?: IContentData;
|
|
19
24
|
theme?: ThemeOverride;
|
|
20
25
|
isLoading?: boolean;
|
|
26
|
+
visible?: boolean;
|
|
27
|
+
userData?: {
|
|
28
|
+
is_buy_or_rent?: 'BUY' | 'RENT';
|
|
29
|
+
rent_expiry_date?: any;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
labels?: {
|
|
33
|
+
purchased?: string;
|
|
34
|
+
rented?: string;
|
|
35
|
+
buyOrRent?: string;
|
|
36
|
+
rentedExpiryPrefix?: string;
|
|
37
|
+
purchasedMsg?: string;
|
|
38
|
+
};
|
|
39
|
+
|
|
21
40
|
style?: {
|
|
22
41
|
container?: StyleProp<ViewStyle>;
|
|
23
42
|
row?: StyleProp<ViewStyle>;
|
|
@@ -44,13 +63,23 @@ export function formatCurrency(
|
|
|
44
63
|
export const MiniInfo = ({
|
|
45
64
|
content,
|
|
46
65
|
theme,
|
|
66
|
+
userData,
|
|
47
67
|
isLoading = false,
|
|
48
68
|
style,
|
|
69
|
+
labels,
|
|
70
|
+
visible = true,
|
|
49
71
|
}: Props): React.ReactElement | null => {
|
|
50
72
|
const { theme: appliedTheme } = useInternalTheme(theme);
|
|
73
|
+
if (!visible) return null;
|
|
74
|
+
const textLabels = {
|
|
75
|
+
purchased: labels?.purchased || 'Purchased',
|
|
76
|
+
rented: labels?.rented || 'Rented',
|
|
77
|
+
buyOrRent: labels?.buyOrRent || 'Buy or Rent',
|
|
78
|
+
rentedExpiryPrefix: labels?.rentedExpiryPrefix || '',
|
|
79
|
+
purchasedMsg: labels?.purchasedMsg || 'You purchased this content',
|
|
80
|
+
};
|
|
51
81
|
|
|
52
82
|
if (isLoading) {
|
|
53
|
-
// Skeleton Placeholder
|
|
54
83
|
return (
|
|
55
84
|
<View
|
|
56
85
|
style={[
|
|
@@ -83,12 +112,14 @@ export const MiniInfo = ({
|
|
|
83
112
|
marginLeft={scale(8)}
|
|
84
113
|
/>
|
|
85
114
|
</SkeletonPlaceholder.Item>
|
|
115
|
+
|
|
86
116
|
<SkeletonPlaceholder.Item
|
|
87
117
|
width={scale(120)}
|
|
88
118
|
height={scale(16)}
|
|
89
119
|
borderRadius={scale(4)}
|
|
90
120
|
marginBottom={scale(4)}
|
|
91
121
|
/>
|
|
122
|
+
|
|
92
123
|
<SkeletonPlaceholder.Item
|
|
93
124
|
width={scale(80)}
|
|
94
125
|
height={scale(14)}
|
|
@@ -106,29 +137,39 @@ export const MiniInfo = ({
|
|
|
106
137
|
|
|
107
138
|
if (content_offering_type !== 'BUY_OR_RENT') return null;
|
|
108
139
|
|
|
109
|
-
const renderBadge = () =>
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
140
|
+
const renderBadge = () => {
|
|
141
|
+
let text = textLabels.buyOrRent;
|
|
142
|
+
|
|
143
|
+
if (userData?.is_buy_or_rent === 'BUY') {
|
|
144
|
+
text = textLabels.purchased;
|
|
145
|
+
} else if (userData?.is_buy_or_rent === 'RENT') {
|
|
146
|
+
text = textLabels.rented;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
return (
|
|
150
|
+
<View
|
|
151
|
+
style={[
|
|
152
|
+
styles.badge,
|
|
153
|
+
{
|
|
154
|
+
backgroundColor: appliedTheme.colors.primary,
|
|
155
|
+
shadowColor: appliedTheme.colors.textPrimary,
|
|
156
|
+
},
|
|
157
|
+
style?.badge,
|
|
158
|
+
]}
|
|
124
159
|
>
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
160
|
+
<Text
|
|
161
|
+
type="caption"
|
|
162
|
+
style={{ color: appliedTheme.colors.onPrimary, fontWeight: '600' }}
|
|
163
|
+
>
|
|
164
|
+
{text}
|
|
165
|
+
</Text>
|
|
166
|
+
</View>
|
|
167
|
+
);
|
|
168
|
+
};
|
|
129
169
|
|
|
130
170
|
const renderPriceInfo = () => {
|
|
131
171
|
if (!price) return null;
|
|
172
|
+
|
|
132
173
|
const text =
|
|
133
174
|
is_buy_or_rent === 'BUY'
|
|
134
175
|
? `Price: ${formatCurrency(price)}`
|
|
@@ -142,13 +183,46 @@ export const MiniInfo = ({
|
|
|
142
183
|
{ color: appliedTheme.colors.textPrimary },
|
|
143
184
|
style?.price,
|
|
144
185
|
]}
|
|
145
|
-
theme={theme}
|
|
146
186
|
>
|
|
147
187
|
{text}
|
|
148
188
|
</Text>
|
|
149
189
|
);
|
|
150
190
|
};
|
|
151
191
|
|
|
192
|
+
const renderUserExpiry = () => {
|
|
193
|
+
if (!userData?.is_buy_or_rent) return null;
|
|
194
|
+
|
|
195
|
+
if (userData.is_buy_or_rent === 'BUY') {
|
|
196
|
+
return (
|
|
197
|
+
<Text
|
|
198
|
+
type="caption"
|
|
199
|
+
style={{
|
|
200
|
+
color: appliedTheme.colors.textSecondary,
|
|
201
|
+
marginTop: scale(4),
|
|
202
|
+
}}
|
|
203
|
+
>
|
|
204
|
+
{textLabels.purchasedMsg}
|
|
205
|
+
</Text>
|
|
206
|
+
);
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
if (userData.is_buy_or_rent === 'RENT') {
|
|
210
|
+
return (
|
|
211
|
+
<Text
|
|
212
|
+
type="caption"
|
|
213
|
+
style={{
|
|
214
|
+
color: appliedTheme.colors.textSecondary,
|
|
215
|
+
marginTop: scale(4),
|
|
216
|
+
}}
|
|
217
|
+
>
|
|
218
|
+
{textLabels.rentedExpiryPrefix} {userData?.rent_expiry_date}
|
|
219
|
+
</Text>
|
|
220
|
+
);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
return null;
|
|
224
|
+
};
|
|
225
|
+
|
|
152
226
|
return (
|
|
153
227
|
<View
|
|
154
228
|
style={[
|
|
@@ -161,7 +235,10 @@ export const MiniInfo = ({
|
|
|
161
235
|
]}
|
|
162
236
|
>
|
|
163
237
|
<View style={styles.headerRow}>{renderBadge()}</View>
|
|
164
|
-
|
|
238
|
+
|
|
239
|
+
{!userData?.is_buy_or_rent && renderPriceInfo()}
|
|
240
|
+
|
|
241
|
+
{renderUserExpiry()}
|
|
165
242
|
</View>
|
|
166
243
|
);
|
|
167
244
|
};
|
|
@@ -248,7 +248,7 @@ export const AppSettings: FC<AppSettingsProps> = ({
|
|
|
248
248
|
<ScrollView
|
|
249
249
|
contentContainerStyle={[
|
|
250
250
|
styles.scrollContent,
|
|
251
|
-
{ paddingBottom: verticalScale(
|
|
251
|
+
{ paddingBottom: verticalScale(100) + insets.bottom },
|
|
252
252
|
]}
|
|
253
253
|
showsVerticalScrollIndicator={false}
|
|
254
254
|
keyboardShouldPersistTaps="handled"
|