@hoddy-ui/core 1.0.78 → 1.0.80
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/package.json +1 -1
- package/src/Components/Popup.tsx +38 -25
- package/src/types.ts +1 -0
package/package.json
CHANGED
package/src/Components/Popup.tsx
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
|
+
Keyboard,
|
|
2
3
|
KeyboardAvoidingView,
|
|
3
4
|
Modal,
|
|
5
|
+
Platform,
|
|
4
6
|
Pressable,
|
|
5
7
|
StyleSheet,
|
|
8
|
+
TouchableWithoutFeedback,
|
|
6
9
|
View,
|
|
7
10
|
} from "react-native";
|
|
8
11
|
|
|
@@ -17,6 +20,7 @@ export const Popup: React.FC<PopupProps> = ({
|
|
|
17
20
|
title,
|
|
18
21
|
sheet,
|
|
19
22
|
bare = false,
|
|
23
|
+
keyboardVerticalOffset,
|
|
20
24
|
children,
|
|
21
25
|
open,
|
|
22
26
|
onClose = () => {},
|
|
@@ -86,6 +90,7 @@ export const Popup: React.FC<PopupProps> = ({
|
|
|
86
90
|
<Modal
|
|
87
91
|
transparent
|
|
88
92
|
animationType="fade"
|
|
93
|
+
statusBarTranslucent
|
|
89
94
|
visible={show}
|
|
90
95
|
onRequestClose={closeAction}
|
|
91
96
|
>
|
|
@@ -94,37 +99,45 @@ export const Popup: React.FC<PopupProps> = ({
|
|
|
94
99
|
<Modal
|
|
95
100
|
transparent
|
|
96
101
|
animationType="slide"
|
|
102
|
+
statusBarTranslucent
|
|
97
103
|
visible={showSecondary}
|
|
98
104
|
onRequestClose={closeAction}
|
|
99
105
|
>
|
|
100
|
-
<
|
|
101
|
-
{
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
106
|
+
<TouchableWithoutFeedback onPress={Keyboard.dismiss}>
|
|
107
|
+
<View style={styles.root}>
|
|
108
|
+
{open && (
|
|
109
|
+
<Pressable
|
|
110
|
+
style={StyleSheet.absoluteFill}
|
|
111
|
+
onPress={closeAction}
|
|
112
|
+
/>
|
|
113
|
+
)}
|
|
107
114
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
{
|
|
114
|
-
|
|
115
|
-
<
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
115
|
+
<KeyboardAvoidingView
|
|
116
|
+
style={styles.avoidingView}
|
|
117
|
+
keyboardVerticalOffset={keyboardVerticalOffset}
|
|
118
|
+
behavior={Platform.OS === "ios" ? "position" : "padding"}
|
|
119
|
+
>
|
|
120
|
+
<View style={styles.container}>
|
|
121
|
+
{!bare && (
|
|
122
|
+
<View style={styles.title}>
|
|
123
|
+
<IconButton
|
|
124
|
+
size={20}
|
|
125
|
+
icon="close"
|
|
126
|
+
onPress={closeAction}
|
|
127
|
+
/>
|
|
128
|
+
<View style={{ flex: 1 }}>
|
|
129
|
+
<Typography color="textSecondary" align="center">
|
|
130
|
+
{title}
|
|
131
|
+
</Typography>
|
|
132
|
+
</View>
|
|
120
133
|
</View>
|
|
121
|
-
|
|
122
|
-
)}
|
|
134
|
+
)}
|
|
123
135
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
136
|
+
<View style={styles.content}>{children}</View>
|
|
137
|
+
</View>
|
|
138
|
+
</KeyboardAvoidingView>
|
|
139
|
+
</View>
|
|
140
|
+
</TouchableWithoutFeedback>
|
|
128
141
|
</Modal>
|
|
129
142
|
</Modal>
|
|
130
143
|
</>
|