@hoddy-ui/core 1.0.51 → 1.0.53
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
|
@@ -2,7 +2,7 @@ import { Ionicons, MaterialIcons } from "@expo/vector-icons";
|
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { ActivityIndicator, Text, TouchableOpacity } from "react-native";
|
|
4
4
|
import { ScaledSheet, moderateScale } from "react-native-size-matters";
|
|
5
|
-
import { useColors } from "../hooks";
|
|
5
|
+
import { useColors, useTheme } from "../hooks";
|
|
6
6
|
import { ButtonProps, IconButtonProps, LinkButtonProps } from "../types";
|
|
7
7
|
|
|
8
8
|
export const LinkButton: React.FC<LinkButtonProps> = ({
|
|
@@ -43,16 +43,13 @@ export const IconButton: React.FC<IconButtonProps> = ({
|
|
|
43
43
|
iconType = "material",
|
|
44
44
|
}) => {
|
|
45
45
|
const colors = useColors();
|
|
46
|
-
|
|
46
|
+
const bgColor = heme === "light" ? "#fff" : "#222";
|
|
47
|
+
const theme = useTheme();
|
|
47
48
|
const styles: any = ScaledSheet.create({
|
|
48
49
|
container: {
|
|
49
50
|
alignSelf: "flex-start",
|
|
50
51
|
flexGrow: 0,
|
|
51
|
-
backgroundColor: bg
|
|
52
|
-
? colors.white[1]
|
|
53
|
-
: elevation! > 0
|
|
54
|
-
? colors.white[1]
|
|
55
|
-
: null,
|
|
52
|
+
backgroundColor: bg ? bgColor : elevation! > 0 ? bgColor : null,
|
|
56
53
|
padding: "5@ms",
|
|
57
54
|
shadowColor: "#000",
|
|
58
55
|
shadowOpacity: 0.1,
|
|
@@ -66,7 +63,7 @@ export const IconButton: React.FC<IconButtonProps> = ({
|
|
|
66
63
|
justifyContent: "center",
|
|
67
64
|
shadowRadius: elevation,
|
|
68
65
|
elevation: elevation,
|
|
69
|
-
borderRadius: size,
|
|
66
|
+
borderRadius: size * 5,
|
|
70
67
|
},
|
|
71
68
|
text: {
|
|
72
69
|
color: disabled ? "#777" : colors[color].main,
|
package/src/Components/Popup.tsx
CHANGED
|
@@ -23,12 +23,14 @@ export const Popup: React.FC<PopupProps> = ({
|
|
|
23
23
|
}) => {
|
|
24
24
|
const colors = useColors();
|
|
25
25
|
const [show, setShow] = useState(open);
|
|
26
|
+
const [showSecondary, setShowSecondary] = useState(false);
|
|
26
27
|
|
|
27
28
|
const styles: any = ScaledSheet.create({
|
|
28
29
|
avoidingView: {
|
|
29
30
|
marginTop: sheet ? "auto" : "50%",
|
|
30
31
|
minHeight: typeof sheet === "number" ? sheet : undefined,
|
|
31
32
|
maxHeight: "80%",
|
|
33
|
+
zIndex: 1000,
|
|
32
34
|
alignSelf: "center",
|
|
33
35
|
maxWidth: sheet ? undefined : "90%",
|
|
34
36
|
width: sheet ? "100%" : undefined,
|
|
@@ -56,14 +58,17 @@ export const Popup: React.FC<PopupProps> = ({
|
|
|
56
58
|
backdrop: {
|
|
57
59
|
position: "absolute",
|
|
58
60
|
height: "100%",
|
|
61
|
+
zIndex: -1,
|
|
59
62
|
width: "100%",
|
|
60
|
-
zIndex: 10000,
|
|
61
63
|
backgroundColor: "#000b",
|
|
62
64
|
},
|
|
63
65
|
});
|
|
64
66
|
|
|
65
67
|
React.useEffect(() => {
|
|
66
68
|
setShow(open);
|
|
69
|
+
setTimeout(() => {
|
|
70
|
+
setShowSecondary(open);
|
|
71
|
+
}, 500);
|
|
67
72
|
}, [open]);
|
|
68
73
|
|
|
69
74
|
const closeAction = () => {
|
|
@@ -79,11 +84,12 @@ export const Popup: React.FC<PopupProps> = ({
|
|
|
79
84
|
visible={show}
|
|
80
85
|
onRequestClose={() => setShow(false)}
|
|
81
86
|
>
|
|
82
|
-
<
|
|
87
|
+
<View style={styles.backdrop} />
|
|
88
|
+
|
|
83
89
|
<Modal
|
|
84
90
|
transparent
|
|
85
91
|
animationType="slide"
|
|
86
|
-
visible={
|
|
92
|
+
visible={showSecondary}
|
|
87
93
|
onRequestClose={() => setShow(false)}
|
|
88
94
|
>
|
|
89
95
|
{open && (
|