@hoddy-ui/core 1.0.73 → 1.0.75
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 +31 -18
- package/src/hooks.ts +5 -4
package/package.json
CHANGED
package/src/Components/Popup.tsx
CHANGED
|
@@ -26,13 +26,18 @@ export const Popup: React.FC<PopupProps> = ({
|
|
|
26
26
|
const [showSecondary, setShowSecondary] = useState(false);
|
|
27
27
|
|
|
28
28
|
const styles: any = ScaledSheet.create({
|
|
29
|
+
root: {
|
|
30
|
+
height: "100%",
|
|
31
|
+
width: "100%",
|
|
32
|
+
justifyContent: sheet ? "flex-end" : "center",
|
|
33
|
+
},
|
|
29
34
|
avoidingView: {
|
|
30
|
-
marginTop: sheet ? "auto" : "50%",
|
|
31
35
|
minHeight: typeof sheet === "number" ? sheet : undefined,
|
|
32
36
|
maxHeight: "80%",
|
|
33
37
|
zIndex: 1000,
|
|
34
38
|
alignSelf: "center",
|
|
35
39
|
maxWidth: sheet ? undefined : "90%",
|
|
40
|
+
|
|
36
41
|
width: sheet ? "100%" : undefined,
|
|
37
42
|
},
|
|
38
43
|
container: {
|
|
@@ -92,26 +97,34 @@ export const Popup: React.FC<PopupProps> = ({
|
|
|
92
97
|
visible={showSecondary}
|
|
93
98
|
onRequestClose={closeAction}
|
|
94
99
|
>
|
|
95
|
-
{
|
|
96
|
-
|
|
97
|
-
|
|
100
|
+
<View style={styles.root}>
|
|
101
|
+
{open && (
|
|
102
|
+
<Pressable
|
|
103
|
+
style={StyleSheet.absoluteFill}
|
|
104
|
+
onPress={closeAction}
|
|
105
|
+
/>
|
|
106
|
+
)}
|
|
98
107
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
+
<KeyboardAvoidingView
|
|
109
|
+
style={styles.avoidingView}
|
|
110
|
+
behavior="position"
|
|
111
|
+
>
|
|
112
|
+
<View style={styles.container}>
|
|
113
|
+
{!bare && (
|
|
114
|
+
<View style={styles.title}>
|
|
115
|
+
<IconButton size={20} icon="close" onPress={closeAction} />
|
|
116
|
+
<View style={{ flex: 1 }}>
|
|
117
|
+
<Typography color="textSecondary" align="center">
|
|
118
|
+
{title}
|
|
119
|
+
</Typography>
|
|
120
|
+
</View>
|
|
108
121
|
</View>
|
|
109
|
-
|
|
110
|
-
)}
|
|
122
|
+
)}
|
|
111
123
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
124
|
+
<View style={styles.content}>{children}</View>
|
|
125
|
+
</View>
|
|
126
|
+
</KeyboardAvoidingView>
|
|
127
|
+
</View>
|
|
115
128
|
</Modal>
|
|
116
129
|
</Modal>
|
|
117
130
|
</>
|
package/src/hooks.ts
CHANGED
|
@@ -15,7 +15,7 @@ export const useTheme = () => {
|
|
|
15
15
|
};
|
|
16
16
|
export const useNavScreenOptions = (type: "stack" | "tab" | "drawer") => {
|
|
17
17
|
const colors = useColors();
|
|
18
|
-
const options = {
|
|
18
|
+
const options: any = {
|
|
19
19
|
stack: {
|
|
20
20
|
headerShown: false,
|
|
21
21
|
|
|
@@ -42,8 +42,6 @@ export const useNavScreenOptions = (type: "stack" | "tab" | "drawer") => {
|
|
|
42
42
|
// shadowOffset: { height: -3, width: 0 },
|
|
43
43
|
// shadowRadius: 7,
|
|
44
44
|
// shadowOpacity: 0.1,
|
|
45
|
-
height: (Dimensions.get("screen").height * 0.08) as any,
|
|
46
|
-
|
|
47
45
|
backgroundColor: colors.white[1],
|
|
48
46
|
},
|
|
49
47
|
tabBarActiveTintColor: colors.blue.main,
|
|
@@ -71,6 +69,9 @@ export const useNavScreenOptions = (type: "stack" | "tab" | "drawer") => {
|
|
|
71
69
|
},
|
|
72
70
|
};
|
|
73
71
|
|
|
74
|
-
if (Platform.OS === "android")
|
|
72
|
+
if (Platform.OS === "android") {
|
|
73
|
+
options.tab.tabBarStyle.height = Dimensions.get("screen").height * 0.08;
|
|
74
|
+
options.tab.tabBarStyle.paddingBottom = vs(15);
|
|
75
|
+
}
|
|
75
76
|
return options[type];
|
|
76
77
|
};
|