@hoddy-ui/core 2.5.6 → 2.5.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/package.json +1 -1
- package/src/Components/Popup.tsx +27 -20
- package/src/Components/TextField.tsx +1 -1
package/package.json
CHANGED
package/src/Components/Popup.tsx
CHANGED
|
@@ -28,7 +28,7 @@ export const Popup: React.FC<PopupProps> = ({
|
|
|
28
28
|
title,
|
|
29
29
|
sheet,
|
|
30
30
|
bare = false,
|
|
31
|
-
keyboardVerticalOffset,
|
|
31
|
+
keyboardVerticalOffset = -10,
|
|
32
32
|
children,
|
|
33
33
|
open,
|
|
34
34
|
onClose = () => {},
|
|
@@ -82,9 +82,12 @@ export const Popup: React.FC<PopupProps> = ({
|
|
|
82
82
|
width: "100%",
|
|
83
83
|
justifyContent: sheet ? "flex-end" : "center",
|
|
84
84
|
},
|
|
85
|
+
keyboardView: {
|
|
86
|
+
flex: 1,
|
|
87
|
+
},
|
|
85
88
|
avoidingView: {
|
|
86
89
|
minHeight: typeof sheet === "number" ? sheet : undefined,
|
|
87
|
-
maxHeight: "
|
|
90
|
+
maxHeight: "90%",
|
|
88
91
|
zIndex: 1000,
|
|
89
92
|
alignSelf: "center",
|
|
90
93
|
maxWidth: sheet ? undefined : "90%",
|
|
@@ -92,7 +95,7 @@ export const Popup: React.FC<PopupProps> = ({
|
|
|
92
95
|
},
|
|
93
96
|
container: {
|
|
94
97
|
paddingBottom: sheet ? "30@ms" : undefined,
|
|
95
|
-
backgroundColor: theme === "dark" ? "#111" : colors.white[
|
|
98
|
+
backgroundColor: theme === "dark" ? "#111" : colors.white[1],
|
|
96
99
|
borderTopLeftRadius: 20,
|
|
97
100
|
borderTopRightRadius: 20,
|
|
98
101
|
borderBottomRightRadius: sheet ? 0 : 20,
|
|
@@ -135,20 +138,24 @@ export const Popup: React.FC<PopupProps> = ({
|
|
|
135
138
|
onRequestClose={closeAction}
|
|
136
139
|
>
|
|
137
140
|
<UIThemeProvider>
|
|
138
|
-
<
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
/>
|
|
146
|
-
|
|
141
|
+
<KeyboardAvoidingView
|
|
142
|
+
style={styles.keyboardView}
|
|
143
|
+
behavior={Platform.OS === "ios" ? "padding" : undefined}
|
|
144
|
+
keyboardVerticalOffset={keyboardVerticalOffset}
|
|
145
|
+
>
|
|
146
|
+
<TouchableWithoutFeedback onPress={Keyboard.dismiss}>
|
|
147
|
+
<View style={styles.root}>
|
|
148
|
+
<Animated.View style={[styles.backdrop, backdropAnimatedStyle]} />
|
|
149
|
+
{open && (
|
|
150
|
+
<Pressable
|
|
151
|
+
style={[StyleSheet.absoluteFill, { zIndex: 2 }]}
|
|
152
|
+
onPress={closeAction}
|
|
153
|
+
/>
|
|
154
|
+
)}
|
|
147
155
|
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
behavior={Platform.OS === "ios" ? "padding" : "padding"}
|
|
156
|
+
<Animated.View
|
|
157
|
+
style={[styles.avoidingView, contentAnimatedStyle]}
|
|
158
|
+
layout={LinearTransition}
|
|
152
159
|
>
|
|
153
160
|
<Animated.View
|
|
154
161
|
layout={LinearTransition}
|
|
@@ -171,10 +178,10 @@ export const Popup: React.FC<PopupProps> = ({
|
|
|
171
178
|
|
|
172
179
|
<View style={styles.content}>{children}</View>
|
|
173
180
|
</Animated.View>
|
|
174
|
-
</
|
|
175
|
-
</
|
|
176
|
-
</
|
|
177
|
-
</
|
|
181
|
+
</Animated.View>
|
|
182
|
+
</View>
|
|
183
|
+
</TouchableWithoutFeedback>
|
|
184
|
+
</KeyboardAvoidingView>
|
|
178
185
|
</UIThemeProvider>
|
|
179
186
|
</Modal>
|
|
180
187
|
);
|