react-native-boxes 1.4.14 → 1.4.16

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": "react-native-boxes",
3
- "version": "1.4.14",
3
+ "version": "1.4.16",
4
4
  "description": "A react native library for rapid development of UI using boxes",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
package/src/Message.tsx CHANGED
@@ -5,6 +5,7 @@ import { ThemeContext } from "./ThemeContext";
5
5
  import FontAwesome from '@expo/vector-icons/FontAwesome';
6
6
  import { Platform, Pressable, Text, ViewProps } from "react-native";
7
7
  import { TextView } from "./Text";
8
+ import { isDesktop } from "./utils";
8
9
 
9
10
 
10
11
 
@@ -40,6 +41,7 @@ export function AlertMessage(props:
40
41
  return (
41
42
  <HBox style={[{
42
43
  flex: 1,
44
+ minHeight: isDesktop() ? undefined : '10%',
43
45
  margin: theme.dimens.space.sm,
44
46
  backgroundColor: theme.colors[type] || color,
45
47
  alignItems: 'center',
package/src/Modal.tsx CHANGED
@@ -54,6 +54,26 @@ export const BottomSheet = (props: BottomSheetProps) => {
54
54
  .onEnd(() => {
55
55
  props.onDismiss && props.onDismiss()
56
56
  })
57
+
58
+ const Wrapper = props.swipeToCloseDisabled ? ({ children }: any) => {
59
+ return (
60
+ <View style={[styles.modalContainer, {
61
+ backgroundColor: props.backgroundColor || theme.colors.forground
62
+ }]}>
63
+ {children}
64
+ </View>
65
+ )
66
+ } : ({ children }: any) => {
67
+ return (
68
+ <View style={[styles.modalContainer, {
69
+ backgroundColor: props.backgroundColor || theme.colors.forground
70
+ }]}>
71
+ <GestureDetector gesture={fling}>
72
+ {children}
73
+ </GestureDetector>
74
+ </View>
75
+ )
76
+ }
57
77
  return (
58
78
  <View style={styles.container}>
59
79
  <Modal
@@ -92,43 +112,39 @@ export const BottomSheet = (props: BottomSheetProps) => {
92
112
  visible={modalVisible}
93
113
  onRequestClose={() => cancel()}
94
114
  >
95
- <View style={[styles.modalContainer, {
96
- backgroundColor: props.backgroundColor || theme.colors.forground
97
- }]}>
115
+ <Wrapper>
98
116
  <View style={[{
99
117
  paddingTop: theme.dimens.space.md,
100
118
  paddingStart: theme.dimens.space.lg,
101
119
  paddingEnd: theme.dimens.space.lg,
102
120
  }]}>
103
- <GestureDetector gesture={fling}>
104
- <HBox style={{
105
- justifyContent: 'space-between',
106
- width: '100%'
107
- }}>
108
-
109
- <View style={{ width: theme.dimens.icon.md }} />
110
- {
111
- typeof props.title == 'string' ? (
112
- <Subtitle style={{
113
- fontFamily: theme.fonts.Bold
114
- }}>{props.title.toString()}</Subtitle>
115
- ) : <>{props.title}</>
116
- }
117
- {
118
- cancellable ? (<TouchableOpacity
119
- style={{
120
- padding: theme.dimens.space.sm
121
- }}
122
- onPress={() => {
123
- cancel()
124
- }}>
125
- <CloseIcon />
126
- </TouchableOpacity>) : (
127
- <View style={{ width: theme.dimens.icon.md }} />
128
- )
129
- }
130
- </HBox>
131
- </GestureDetector>
121
+ <HBox style={{
122
+ justifyContent: 'space-between',
123
+ width: '100%'
124
+ }}>
125
+
126
+ <View style={{ width: theme.dimens.icon.md }} />
127
+ {
128
+ typeof props.title == 'string' ? (
129
+ <Subtitle style={{
130
+ fontFamily: theme.fonts.Bold
131
+ }}>{props.title.toString()}</Subtitle>
132
+ ) : <>{props.title}</>
133
+ }
134
+ {
135
+ cancellable ? (<TouchableOpacity
136
+ style={{
137
+ padding: theme.dimens.space.sm
138
+ }}
139
+ onPress={() => {
140
+ cancel()
141
+ }}>
142
+ <CloseIcon />
143
+ </TouchableOpacity>) : (
144
+ <View style={{ width: theme.dimens.icon.md }} />
145
+ )
146
+ }
147
+ </HBox>
132
148
  <VBox style={{
133
149
  width: '100%'
134
150
  }}>
@@ -144,20 +160,18 @@ export const BottomSheet = (props: BottomSheetProps) => {
144
160
  {props.children}
145
161
  </ScrollView>
146
162
  ) : (
147
- <GestureDetector gesture={fling}>
148
- <VBox style={{
149
- width: '100%'
150
- }}>
151
- {props.children}
152
- </VBox>
153
- </GestureDetector>
163
+ <VBox style={{
164
+ width: '100%'
165
+ }}>
166
+ {props.children}
167
+ </VBox>
154
168
  )
155
169
  }
156
170
 
157
171
 
158
172
  </VBox>
159
173
  </View>
160
- </View>
174
+ </Wrapper>
161
175
  </Modal>
162
176
  </View>
163
177
  );