related-ui-components 1.7.5 → 1.7.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/commonjs/app.js +24 -31
- package/lib/commonjs/app.js.map +1 -1
- package/lib/commonjs/components/Card/Card.js +1 -1
- package/lib/commonjs/components/Popup/Popup.js +33 -32
- package/lib/commonjs/components/Popup/Popup.js.map +1 -1
- package/lib/commonjs/components/RedeemedVoucher/RedeemedVoucherSheet.js +445 -0
- package/lib/commonjs/components/RedeemedVoucher/RedeemedVoucherSheet.js.map +1 -0
- package/lib/module/app.js +22 -30
- package/lib/module/app.js.map +1 -1
- package/lib/module/components/Card/Card.js +1 -1
- package/lib/module/components/Popup/Popup.js +34 -33
- package/lib/module/components/Popup/Popup.js.map +1 -1
- package/lib/module/components/RedeemedVoucher/RedeemedVoucherSheet.js +438 -0
- package/lib/module/components/RedeemedVoucher/RedeemedVoucherSheet.js.map +1 -0
- package/lib/typescript/commonjs/app.d.ts.map +1 -1
- package/lib/typescript/commonjs/components/Popup/Popup.d.ts.map +1 -1
- package/lib/typescript/commonjs/components/RedeemedVoucher/RedeemedVoucherSheet.d.ts +58 -0
- package/lib/typescript/commonjs/components/RedeemedVoucher/RedeemedVoucherSheet.d.ts.map +1 -0
- package/lib/typescript/module/app.d.ts.map +1 -1
- package/lib/typescript/module/components/Popup/Popup.d.ts.map +1 -1
- package/lib/typescript/module/components/RedeemedVoucher/RedeemedVoucherSheet.d.ts +58 -0
- package/lib/typescript/module/components/RedeemedVoucher/RedeemedVoucherSheet.d.ts.map +1 -0
- package/package.json +4 -2
- package/src/app.tsx +19 -19
- package/src/components/Card/Card.tsx +1 -1
- package/src/components/Popup/Popup.tsx +53 -98
- package/src/components/RedeemedVoucher/RedeemedVoucherSheet.tsx +547 -0
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ImageSourcePropType, StyleProp, ViewStyle } from "react-native";
|
|
3
|
+
import { BottomSheetProps } from "@gorhom/bottom-sheet";
|
|
4
|
+
type Props = {
|
|
5
|
+
visible: boolean;
|
|
6
|
+
onClose: () => void;
|
|
7
|
+
code: string;
|
|
8
|
+
amount?: number;
|
|
9
|
+
expiry?: string;
|
|
10
|
+
image?: ImageSourcePropType;
|
|
11
|
+
title?: string;
|
|
12
|
+
currency?: string;
|
|
13
|
+
codeReadyText?: string;
|
|
14
|
+
qrCodeLabel?: string;
|
|
15
|
+
barCodeLabel?: string;
|
|
16
|
+
myVouchersButtonText?: string;
|
|
17
|
+
onMyVouchersButtonPress?: () => void;
|
|
18
|
+
onCopyCode?: (copiedCode: string) => void;
|
|
19
|
+
showAppleWalletButton?: boolean;
|
|
20
|
+
appleWalletButtonText?: string;
|
|
21
|
+
onAppleWalletButtonPress?: () => void;
|
|
22
|
+
appleWalletIconSource?: ImageSourcePropType;
|
|
23
|
+
qrCodeSize?: number;
|
|
24
|
+
activeTabColors?: string[];
|
|
25
|
+
inactiveTabBackgroundColor?: string;
|
|
26
|
+
inactiveTabBorderColor?: string;
|
|
27
|
+
inactiveTabTextColor?: string;
|
|
28
|
+
primaryButtonColors?: string[];
|
|
29
|
+
allowBarcodeSwitch?: boolean;
|
|
30
|
+
renderBarcodeComponent?: (code: string) => React.ReactNode;
|
|
31
|
+
renderCopyIcon?: () => React.ReactNode;
|
|
32
|
+
amountIconComponent?: React.ReactNode;
|
|
33
|
+
expiryIconComponent?: React.ReactNode;
|
|
34
|
+
snapPoints?: string[];
|
|
35
|
+
sheetBackgroundStyle?: StyleProp<ViewStyle>;
|
|
36
|
+
sheetHandleStyle?: StyleProp<ViewStyle>;
|
|
37
|
+
backdropPressBehavior?: "close" | "none" | number;
|
|
38
|
+
bottomSheetOverrideProps?: Partial<Omit<BottomSheetProps, "children" | "snapPoints" | "index" | "onClose" | "enablePanDownToClose" | "backgroundStyle" | "handleIndicatorStyle" | "backdropComponent">>;
|
|
39
|
+
tabGradientStart?: {
|
|
40
|
+
x: number;
|
|
41
|
+
y: number;
|
|
42
|
+
};
|
|
43
|
+
tabGradientEnd?: {
|
|
44
|
+
x: number;
|
|
45
|
+
y: number;
|
|
46
|
+
};
|
|
47
|
+
primaryButtonGradientStart?: {
|
|
48
|
+
x: number;
|
|
49
|
+
y: number;
|
|
50
|
+
};
|
|
51
|
+
primaryButtonGradientEnd?: {
|
|
52
|
+
x: number;
|
|
53
|
+
y: number;
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
declare const RedeemedVoucherSheet: React.FC<Props>;
|
|
57
|
+
export default RedeemedVoucherSheet;
|
|
58
|
+
//# sourceMappingURL=RedeemedVoucherSheet.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RedeemedVoucherSheet.d.ts","sourceRoot":"","sources":["../../../../../src/components/RedeemedVoucher/RedeemedVoucherSheet.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAuC,MAAM,OAAO,CAAC;AAC5D,OAAO,EAOL,mBAAmB,EACnB,SAAS,EACT,SAAS,EACV,MAAM,cAAc,CAAC;AACtB,OAAoB,EAElB,gBAAgB,EAGjB,MAAM,sBAAsB,CAAC;AAO9B,KAAK,KAAK,GAAG;IACX,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,mBAAmB,CAAC;IAE5B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,uBAAuB,CAAC,EAAE,MAAM,IAAI,CAAC;IACrC,UAAU,CAAC,EAA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c,CAAC,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC1C,0BAA0B,CAAC,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACtD,wBAAwB,CAAC,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CACrD,CAAC;AAEF,QAAA,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CA8RzC,CAAC;AAsLF,eAAe,oBAAoB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../../../src/app.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../../../src/app.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AASxC,QAAA,MAAM,QAAQ,yBAiGb,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Popup.d.ts","sourceRoot":"","sources":["../../../../../src/components/Popup/Popup.tsx"],"names":[],"mappings":"AACA,OAAc,EAAE,EAAE,EAAE,SAAS,
|
|
1
|
+
{"version":3,"file":"Popup.d.ts","sourceRoot":"","sources":["../../../../../src/components/Popup/Popup.tsx"],"names":[],"mappings":"AACA,OAAc,EAAE,EAAE,EAAE,SAAS,EAAwC,MAAM,OAAO,CAAC;AACnF,OAAO,EAOL,mBAAmB,EAMnB,SAAS,EACT,SAAS,EACT,UAAU,EAGX,MAAM,cAAc,CAAC;AAGtB,UAAU,UAAU;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,eAAe,CAAC,EAAE,mBAAmB,CAAC;IACt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CAAC,UAAU,CA6LzB,CAAC;AA2IF,eAAe,KAAK,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ImageSourcePropType, StyleProp, ViewStyle } from "react-native";
|
|
3
|
+
import { BottomSheetProps } from "@gorhom/bottom-sheet";
|
|
4
|
+
type Props = {
|
|
5
|
+
visible: boolean;
|
|
6
|
+
onClose: () => void;
|
|
7
|
+
code: string;
|
|
8
|
+
amount?: number;
|
|
9
|
+
expiry?: string;
|
|
10
|
+
image?: ImageSourcePropType;
|
|
11
|
+
title?: string;
|
|
12
|
+
currency?: string;
|
|
13
|
+
codeReadyText?: string;
|
|
14
|
+
qrCodeLabel?: string;
|
|
15
|
+
barCodeLabel?: string;
|
|
16
|
+
myVouchersButtonText?: string;
|
|
17
|
+
onMyVouchersButtonPress?: () => void;
|
|
18
|
+
onCopyCode?: (copiedCode: string) => void;
|
|
19
|
+
showAppleWalletButton?: boolean;
|
|
20
|
+
appleWalletButtonText?: string;
|
|
21
|
+
onAppleWalletButtonPress?: () => void;
|
|
22
|
+
appleWalletIconSource?: ImageSourcePropType;
|
|
23
|
+
qrCodeSize?: number;
|
|
24
|
+
activeTabColors?: string[];
|
|
25
|
+
inactiveTabBackgroundColor?: string;
|
|
26
|
+
inactiveTabBorderColor?: string;
|
|
27
|
+
inactiveTabTextColor?: string;
|
|
28
|
+
primaryButtonColors?: string[];
|
|
29
|
+
allowBarcodeSwitch?: boolean;
|
|
30
|
+
renderBarcodeComponent?: (code: string) => React.ReactNode;
|
|
31
|
+
renderCopyIcon?: () => React.ReactNode;
|
|
32
|
+
amountIconComponent?: React.ReactNode;
|
|
33
|
+
expiryIconComponent?: React.ReactNode;
|
|
34
|
+
snapPoints?: string[];
|
|
35
|
+
sheetBackgroundStyle?: StyleProp<ViewStyle>;
|
|
36
|
+
sheetHandleStyle?: StyleProp<ViewStyle>;
|
|
37
|
+
backdropPressBehavior?: "close" | "none" | number;
|
|
38
|
+
bottomSheetOverrideProps?: Partial<Omit<BottomSheetProps, "children" | "snapPoints" | "index" | "onClose" | "enablePanDownToClose" | "backgroundStyle" | "handleIndicatorStyle" | "backdropComponent">>;
|
|
39
|
+
tabGradientStart?: {
|
|
40
|
+
x: number;
|
|
41
|
+
y: number;
|
|
42
|
+
};
|
|
43
|
+
tabGradientEnd?: {
|
|
44
|
+
x: number;
|
|
45
|
+
y: number;
|
|
46
|
+
};
|
|
47
|
+
primaryButtonGradientStart?: {
|
|
48
|
+
x: number;
|
|
49
|
+
y: number;
|
|
50
|
+
};
|
|
51
|
+
primaryButtonGradientEnd?: {
|
|
52
|
+
x: number;
|
|
53
|
+
y: number;
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
declare const RedeemedVoucherSheet: React.FC<Props>;
|
|
57
|
+
export default RedeemedVoucherSheet;
|
|
58
|
+
//# sourceMappingURL=RedeemedVoucherSheet.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RedeemedVoucherSheet.d.ts","sourceRoot":"","sources":["../../../../../src/components/RedeemedVoucher/RedeemedVoucherSheet.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAuC,MAAM,OAAO,CAAC;AAC5D,OAAO,EAOL,mBAAmB,EACnB,SAAS,EACT,SAAS,EACV,MAAM,cAAc,CAAC;AACtB,OAAoB,EAElB,gBAAgB,EAGjB,MAAM,sBAAsB,CAAC;AAO9B,KAAK,KAAK,GAAG;IACX,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,mBAAmB,CAAC;IAE5B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,C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B,iBAAiB,GACjB,sBAAsB,GACtB,mBAAmB,CACtB,CACF,CAAC;IACF,gBAAgB,CAAC,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC5C,cAAc,CAAC,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC1C,0BAA0B,CAAC,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACtD,wBAAwB,CAAC,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CACrD,CAAC;AAEF,QAAA,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CA8RzC,CAAC;AAsLF,eAAe,oBAAoB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "related-ui-components",
|
|
3
3
|
"main": "./src/index.ts",
|
|
4
|
-
"version": "1.7.
|
|
4
|
+
"version": "1.7.7",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"start": "expo start",
|
|
7
7
|
"reset-project": "node ./scripts/reset-project.js",
|
|
@@ -42,12 +42,14 @@
|
|
|
42
42
|
"react-native-calendars": "^1.1310.0",
|
|
43
43
|
"react-native-gesture-handler": "~2.20.2",
|
|
44
44
|
"react-native-modal": "^14.0.0-rc.1",
|
|
45
|
+
"react-native-qrcode-svg": "^6.3.15",
|
|
45
46
|
"react-native-reanimated": "^3.16.1",
|
|
46
47
|
"react-native-safe-area-context": "4.12.0",
|
|
47
48
|
"react-native-screens": "~4.4.0",
|
|
48
49
|
"react-native-svg": "15.8.0",
|
|
49
50
|
"react-native-web": "~0.19.13",
|
|
50
|
-
"react-native-webview": "13.12.5"
|
|
51
|
+
"react-native-webview": "13.12.5",
|
|
52
|
+
"expo-clipboard": "~7.0.1"
|
|
51
53
|
},
|
|
52
54
|
"devDependencies": {
|
|
53
55
|
"@babel/core": "^7.25.2",
|
package/src/app.tsx
CHANGED
|
@@ -4,6 +4,8 @@ import { FilterResult, Filters, Popup, UnlockRewards } from "./components";
|
|
|
4
4
|
import BRANDS from "./constants/BRANDS";
|
|
5
5
|
import { Ionicons } from "@expo/vector-icons";
|
|
6
6
|
import { useTheme } from "./theme";
|
|
7
|
+
import RedeemedVoucherSheet from "./components/RedeemedVoucher/RedeemedVoucherSheet";
|
|
8
|
+
import { GestureHandlerRootView } from "react-native-gesture-handler";
|
|
7
9
|
|
|
8
10
|
const MyScreen = () => {
|
|
9
11
|
const [isFilterVisible, setIsFilterVisible] = useState(false);
|
|
@@ -83,25 +85,23 @@ const MyScreen = () => {
|
|
|
83
85
|
|
|
84
86
|
return (
|
|
85
87
|
<>
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
//
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
<
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
<Button title="Show Filters" onPress={() => setIsFilterVisible(true)} />
|
|
104
|
-
</View>
|
|
88
|
+
<GestureHandlerRootView>
|
|
89
|
+
<RedeemedVoucherSheet
|
|
90
|
+
visible={true}
|
|
91
|
+
onClose={() => {}}
|
|
92
|
+
code="0000P78SHV50KK"
|
|
93
|
+
// amount={100}
|
|
94
|
+
expiry="22/01/2025"
|
|
95
|
+
currency="USD"
|
|
96
|
+
title="Voucher Activated!"
|
|
97
|
+
// primaryButtonColors={["red", "blue"]}
|
|
98
|
+
onMyVouchersButtonPress={() => console.log("My Vouchers pressed")}
|
|
99
|
+
onCopyCode={(code) => console.log("Copied:", code)}
|
|
100
|
+
// To use custom icons:
|
|
101
|
+
// amountIconComponent={<Image source={YourCustomAmountIcon} style={{width: 20, height: 20, marginRight: 5}} />}
|
|
102
|
+
// renderCopyIcon={() => <Text style={{fontSize: 22, color: 'blue'}}>COPY</Text>}
|
|
103
|
+
/>
|
|
104
|
+
</GestureHandlerRootView>
|
|
105
105
|
</>
|
|
106
106
|
);
|
|
107
107
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useTheme, ThemeType } from "../../theme";
|
|
2
|
-
import React, { FC, ReactNode, useEffect, useRef, useState } from "react";
|
|
2
|
+
import React, { FC, ReactNode, useEffect, useMemo, useRef, useState } from "react";
|
|
3
3
|
import {
|
|
4
4
|
Modal,
|
|
5
5
|
View,
|
|
@@ -66,6 +66,7 @@ const Popup: FC<PopupProps> = ({
|
|
|
66
66
|
title,
|
|
67
67
|
content,
|
|
68
68
|
subtitle,
|
|
69
|
+
children,
|
|
69
70
|
primaryButtonText,
|
|
70
71
|
onPrimaryButtonPress,
|
|
71
72
|
secondaryButtonText,
|
|
@@ -87,17 +88,16 @@ const Popup: FC<PopupProps> = ({
|
|
|
87
88
|
closeIconStyle,
|
|
88
89
|
closeIconVariant = "floating",
|
|
89
90
|
subtitleStyle,
|
|
90
|
-
isRTL
|
|
91
|
+
isRTL: propIsRTL,
|
|
91
92
|
closeIconColor,
|
|
92
93
|
closeIconSize = 28,
|
|
93
|
-
children,
|
|
94
94
|
modalStyle,
|
|
95
95
|
overlay,
|
|
96
96
|
customContent,
|
|
97
97
|
}) => {
|
|
98
|
-
const { theme, isRTL:
|
|
99
|
-
isRTL =
|
|
100
|
-
const styles = createStyles(theme);
|
|
98
|
+
const { theme, isRTL: themeIsRTL } = useTheme();
|
|
99
|
+
const isRTL = propIsRTL !== undefined ? propIsRTL : themeIsRTL;
|
|
100
|
+
const styles = useMemo(() => createStyles(theme), [theme]);
|
|
101
101
|
|
|
102
102
|
const [modalRendered, setModalRendered] = useState(visible);
|
|
103
103
|
const slideAnim = useRef(new Animated.Value(screenHeight)).current;
|
|
@@ -121,42 +121,9 @@ const Popup: FC<PopupProps> = ({
|
|
|
121
121
|
setModalRendered(false);
|
|
122
122
|
});
|
|
123
123
|
}
|
|
124
|
-
}, [visible, slideAnim
|
|
124
|
+
}, [visible, slideAnim]);
|
|
125
125
|
|
|
126
|
-
const
|
|
127
|
-
<View style={[children == null && styles.popupContainer, containerStyle]}>
|
|
128
|
-
<CloseIcon
|
|
129
|
-
show={showCloseIcon}
|
|
130
|
-
onPress={onClose}
|
|
131
|
-
customIcon={customCloseIcon}
|
|
132
|
-
variant={closeIconVariant}
|
|
133
|
-
containerStyle={closeIconContainerStyle}
|
|
134
|
-
iconStyle={closeIconStyle}
|
|
135
|
-
color={closeIconColor}
|
|
136
|
-
size={closeIconSize}
|
|
137
|
-
isRTL={isRTL}
|
|
138
|
-
/>
|
|
139
|
-
{overlay && (
|
|
140
|
-
<View style={styles.overlayContainer} pointerEvents="none">
|
|
141
|
-
{overlay}
|
|
142
|
-
</View>
|
|
143
|
-
)}
|
|
144
|
-
{children ||
|
|
145
|
-
(backgroundImage ? (
|
|
146
|
-
<ImageBackground
|
|
147
|
-
source={backgroundImage}
|
|
148
|
-
style={styles.backgroundImage}
|
|
149
|
-
imageStyle={styles.backgroundImageStyle}
|
|
150
|
-
>
|
|
151
|
-
<PopupInnerContent />
|
|
152
|
-
</ImageBackground>
|
|
153
|
-
) : (
|
|
154
|
-
<PopupInnerContent />
|
|
155
|
-
))}
|
|
156
|
-
</View>
|
|
157
|
-
);
|
|
158
|
-
|
|
159
|
-
const PopupInnerContent = () => (
|
|
126
|
+
const renderDefaultContent = () => (
|
|
160
127
|
<View style={[styles.contentContainer, contentContainerStyle]}>
|
|
161
128
|
{illustrationImage && (
|
|
162
129
|
<View style={styles.illustrationContainer}>
|
|
@@ -167,52 +134,24 @@ const Popup: FC<PopupProps> = ({
|
|
|
167
134
|
/>
|
|
168
135
|
</View>
|
|
169
136
|
)}
|
|
170
|
-
|
|
171
137
|
{title && (
|
|
172
|
-
<Text
|
|
173
|
-
style={[
|
|
174
|
-
styles.title,
|
|
175
|
-
{ color: theme.text, textAlign: "center" },
|
|
176
|
-
titleStyle,
|
|
177
|
-
]}
|
|
178
|
-
>
|
|
138
|
+
<Text style={[styles.title, { color: theme.text, textAlign: "center" }, titleStyle]}>
|
|
179
139
|
{title}
|
|
180
140
|
</Text>
|
|
181
141
|
)}
|
|
182
|
-
|
|
183
142
|
{subtitle && (
|
|
184
|
-
<Text
|
|
185
|
-
style={[
|
|
186
|
-
styles.subtitle,
|
|
187
|
-
{ color: theme.text, textAlign: "center" },
|
|
188
|
-
subtitleStyle,
|
|
189
|
-
]}
|
|
190
|
-
>
|
|
143
|
+
<Text style={[styles.subtitle, { color: theme.text, textAlign: "center" }, subtitleStyle]}>
|
|
191
144
|
{subtitle}
|
|
192
145
|
</Text>
|
|
193
146
|
)}
|
|
194
|
-
|
|
195
147
|
{content && (
|
|
196
|
-
<Text
|
|
197
|
-
style={[
|
|
198
|
-
styles.content,
|
|
199
|
-
{ color: theme.text, textAlign: "center" },
|
|
200
|
-
contentStyle,
|
|
201
|
-
]}
|
|
202
|
-
>
|
|
148
|
+
<Text style={[styles.content, { color: theme.text, textAlign: "center" }, contentStyle]}>
|
|
203
149
|
{content}
|
|
204
150
|
</Text>
|
|
205
151
|
)}
|
|
206
|
-
|
|
207
152
|
{customContent && <View>{customContent}</View>}
|
|
208
|
-
|
|
209
153
|
{(secondaryButtonText || primaryButtonText) && (
|
|
210
|
-
<View
|
|
211
|
-
style={[
|
|
212
|
-
styles.buttonContainer,
|
|
213
|
-
{ flexDirection: isRTL ? "row-reverse" : "row" },
|
|
214
|
-
]}
|
|
215
|
-
>
|
|
154
|
+
<View style={[styles.buttonContainer, { flexDirection: isRTL ? "row-reverse" : "row" }]}>
|
|
216
155
|
{secondaryButtonText && (
|
|
217
156
|
<TouchableOpacity
|
|
218
157
|
style={[
|
|
@@ -225,34 +164,17 @@ const Popup: FC<PopupProps> = ({
|
|
|
225
164
|
]}
|
|
226
165
|
onPress={onSecondaryButtonPress}
|
|
227
166
|
>
|
|
228
|
-
<Text
|
|
229
|
-
style={[
|
|
230
|
-
styles.secondaryButtonText,
|
|
231
|
-
{ color: theme.primary },
|
|
232
|
-
secondaryButtonTextStyle,
|
|
233
|
-
]}
|
|
234
|
-
>
|
|
167
|
+
<Text style={[styles.secondaryButtonText, { color: theme.primary }, secondaryButtonTextStyle]}>
|
|
235
168
|
{secondaryButtonText}
|
|
236
169
|
</Text>
|
|
237
170
|
</TouchableOpacity>
|
|
238
171
|
)}
|
|
239
|
-
|
|
240
172
|
{primaryButtonText && (
|
|
241
173
|
<TouchableOpacity
|
|
242
|
-
style={[
|
|
243
|
-
styles.primaryButton,
|
|
244
|
-
{ backgroundColor: theme.primary },
|
|
245
|
-
primaryButtonStyle,
|
|
246
|
-
]}
|
|
174
|
+
style={[styles.primaryButton, { backgroundColor: theme.primary }, primaryButtonStyle]}
|
|
247
175
|
onPress={onPrimaryButtonPress}
|
|
248
176
|
>
|
|
249
|
-
<Text
|
|
250
|
-
style={[
|
|
251
|
-
styles.primaryButtonText,
|
|
252
|
-
{ color: theme.onPrimary },
|
|
253
|
-
primaryButtonTextStyle,
|
|
254
|
-
]}
|
|
255
|
-
>
|
|
177
|
+
<Text style={[styles.primaryButtonText, { color: theme.onPrimary }, primaryButtonTextStyle]}>
|
|
256
178
|
{primaryButtonText}
|
|
257
179
|
</Text>
|
|
258
180
|
</TouchableOpacity>
|
|
@@ -262,10 +184,14 @@ const Popup: FC<PopupProps> = ({
|
|
|
262
184
|
</View>
|
|
263
185
|
);
|
|
264
186
|
|
|
187
|
+
if (!modalRendered && !visible) {
|
|
188
|
+
return null;
|
|
189
|
+
}
|
|
190
|
+
|
|
265
191
|
return (
|
|
266
192
|
<Modal
|
|
267
193
|
transparent
|
|
268
|
-
visible={modalRendered}
|
|
194
|
+
visible={modalRendered}
|
|
269
195
|
animationType="none"
|
|
270
196
|
onRequestClose={onClose}
|
|
271
197
|
statusBarTranslucent
|
|
@@ -279,15 +205,44 @@ const Popup: FC<PopupProps> = ({
|
|
|
279
205
|
)}
|
|
280
206
|
<Animated.View
|
|
281
207
|
style={[
|
|
282
|
-
{
|
|
283
|
-
transform: [{ translateY: slideAnim }],
|
|
284
|
-
},
|
|
208
|
+
{ transform: [{ translateY: slideAnim }] },
|
|
285
209
|
styles.animatedContainer,
|
|
286
210
|
]}
|
|
287
211
|
pointerEvents="box-none"
|
|
288
212
|
>
|
|
289
213
|
<TouchableWithoutFeedback>
|
|
290
|
-
<
|
|
214
|
+
<View style={[!children && styles.popupContainer, containerStyle]}>
|
|
215
|
+
<CloseIcon
|
|
216
|
+
show={showCloseIcon}
|
|
217
|
+
onPress={onClose}
|
|
218
|
+
customIcon={customCloseIcon}
|
|
219
|
+
variant={closeIconVariant}
|
|
220
|
+
containerStyle={closeIconContainerStyle}
|
|
221
|
+
iconStyle={closeIconStyle}
|
|
222
|
+
color={closeIconColor}
|
|
223
|
+
size={closeIconSize}
|
|
224
|
+
isRTL={isRTL}
|
|
225
|
+
/>
|
|
226
|
+
{overlay && (
|
|
227
|
+
<View style={styles.overlayContainer} pointerEvents="none">
|
|
228
|
+
{overlay}
|
|
229
|
+
</View>
|
|
230
|
+
)}
|
|
231
|
+
|
|
232
|
+
{children ? (
|
|
233
|
+
children
|
|
234
|
+
) : backgroundImage ? (
|
|
235
|
+
<ImageBackground
|
|
236
|
+
source={backgroundImage}
|
|
237
|
+
style={styles.backgroundImage}
|
|
238
|
+
imageStyle={styles.backgroundImageStyle}
|
|
239
|
+
>
|
|
240
|
+
{renderDefaultContent()}
|
|
241
|
+
</ImageBackground>
|
|
242
|
+
) : (
|
|
243
|
+
renderDefaultContent()
|
|
244
|
+
)}
|
|
245
|
+
</View>
|
|
291
246
|
</TouchableWithoutFeedback>
|
|
292
247
|
</Animated.View>
|
|
293
248
|
</View>
|