@hoddy-ui/core 1.0.49 → 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.49",
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",
@@ -83,20 +90,22 @@ export const Popup: React.FC<PopupProps> = ({
83
90
  <Pressable style={StyleSheet.absoluteFill} onPress={closeAction} />
84
91
  )}
85
92
 
86
- <View style={styles.container}>
87
- {!bare && (
88
- <View style={styles.title}>
89
- <IconButton size={20} icon="close" onPress={closeAction} />
90
- <View style={{ flex: 1 }}>
91
- <Typography color="textSecondary" align="center">
92
- {title}
93
- </Typography>
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>
94
103
  </View>
95
- </View>
96
- )}
104
+ )}
97
105
 
98
- <View style={styles.content}>{children}</View>
99
- </View>
106
+ <View style={styles.content}>{children}</View>
107
+ </View>
108
+ </KeyboardAvoidingView>
100
109
  </Modal>
101
110
  </Modal>
102
111
  </>