@hoddy-ui/core 1.0.79 → 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 +36 -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 = () => {},
|
|
@@ -99,34 +103,41 @@ export const Popup: React.FC<PopupProps> = ({
|
|
|
99
103
|
visible={showSecondary}
|
|
100
104
|
onRequestClose={closeAction}
|
|
101
105
|
>
|
|
102
|
-
<
|
|
103
|
-
{
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
106
|
+
<TouchableWithoutFeedback onPress={Keyboard.dismiss}>
|
|
107
|
+
<View style={styles.root}>
|
|
108
|
+
{open && (
|
|
109
|
+
<Pressable
|
|
110
|
+
style={StyleSheet.absoluteFill}
|
|
111
|
+
onPress={closeAction}
|
|
112
|
+
/>
|
|
113
|
+
)}
|
|
109
114
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
{
|
|
116
|
-
|
|
117
|
-
<
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
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>
|
|
122
133
|
</View>
|
|
123
|
-
|
|
124
|
-
)}
|
|
134
|
+
)}
|
|
125
135
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
136
|
+
<View style={styles.content}>{children}</View>
|
|
137
|
+
</View>
|
|
138
|
+
</KeyboardAvoidingView>
|
|
139
|
+
</View>
|
|
140
|
+
</TouchableWithoutFeedback>
|
|
130
141
|
</Modal>
|
|
131
142
|
</Modal>
|
|
132
143
|
</>
|