@hoddy-ui/core 1.0.48 → 1.0.50

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hoddy-ui/core",
3
- "version": "1.0.48",
3
+ "version": "1.0.50",
4
4
  "description": "Core rich react native components written in typescript",
5
5
  "main": "index.ts",
6
6
  "repository": {
@@ -1,4 +1,10 @@
1
- import { Modal, Pressable, StyleSheet, View } from "react-native";
1
+ import {
2
+ KeyboardAvoidingView,
3
+ Modal,
4
+ Pressable,
5
+ StyleSheet,
6
+ View,
7
+ } from "react-native";
2
8
 
3
9
  import React, { useState } from "react";
4
10
  import { ScaledSheet } from "react-native-size-matters";
@@ -19,21 +25,22 @@ export const Popup: React.FC<PopupProps> = ({
19
25
  const [show, setShow] = useState(open);
20
26
 
21
27
  const styles: any = ScaledSheet.create({
22
- container: {
28
+ avoidingView: {
23
29
  marginTop: sheet ? "auto" : "50%",
24
- paddingBottom: sheet ? "30@ms" : 0,
25
30
  minHeight: typeof sheet === "number" ? sheet : undefined,
26
31
  maxHeight: "80%",
32
+ alignSelf: "center",
33
+ maxWidth: sheet ? undefined : "90%",
34
+ width: sheet ? "100%" : undefined,
35
+ },
36
+ container: {
37
+ paddingBottom: sheet ? "30@ms" : 0,
27
38
  backgroundColor: colors.white[2],
28
39
  borderTopLeftRadius: 20,
29
40
  borderTopRightRadius: 20,
30
41
  borderBottomRightRadius: sheet ? 0 : 20,
31
42
  borderBottomLeftRadius: sheet ? 0 : 20,
32
- borderColor: colors.white[5],
33
- borderWidth: 0,
34
- alignSelf: "center",
35
- maxWidth: sheet ? undefined : "90%",
36
- width: sheet ? "100%" : undefined,
43
+ width: "100%",
37
44
  },
38
45
  content: {
39
46
  paddingHorizontal: bare ? undefined : "10@ms",
@@ -66,31 +73,40 @@ export const Popup: React.FC<PopupProps> = ({
66
73
 
67
74
  return (
68
75
  <>
69
- {open && <Pressable style={styles.backdrop} />}
70
76
  <Modal
71
77
  transparent
72
- animationType="slide"
78
+ animationType="fade"
73
79
  visible={show}
74
80
  onRequestClose={() => setShow(false)}
75
81
  >
76
- {open && (
77
- <Pressable style={StyleSheet.absoluteFill} onPress={closeAction} />
78
- )}
79
-
80
- <View style={styles.container}>
81
- {!bare && (
82
- <View style={styles.title}>
83
- <IconButton size={20} icon="close" onPress={closeAction} />
84
- <View style={{ flex: 1 }}>
85
- <Typography color="textSecondary" align="center">
86
- {title}
87
- </Typography>
88
- </View>
89
- </View>
82
+ <Pressable style={styles.backdrop} />
83
+ <Modal
84
+ transparent
85
+ animationType="slide"
86
+ visible={show}
87
+ onRequestClose={() => setShow(false)}
88
+ >
89
+ {open && (
90
+ <Pressable style={StyleSheet.absoluteFill} onPress={closeAction} />
90
91
  )}
91
92
 
92
- <View style={styles.content}>{children}</View>
93
- </View>
93
+ <KeyboardAvoidingView style={styles.avoidingView} behavior="position">
94
+ <View style={styles.container}>
95
+ {!bare && (
96
+ <View style={styles.title}>
97
+ <IconButton size={20} icon="close" onPress={closeAction} />
98
+ <View style={{ flex: 1 }}>
99
+ <Typography color="textSecondary" align="center">
100
+ {title}
101
+ </Typography>
102
+ </View>
103
+ </View>
104
+ )}
105
+
106
+ <View style={styles.content}>{children}</View>
107
+ </View>
108
+ </KeyboardAvoidingView>
109
+ </Modal>
94
110
  </Modal>
95
111
  </>
96
112
  );