react-native-boxes 1.4.74 → 1.4.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/sample-app/App.tsx +34 -34
- package/sample-app/app.json +30 -30
- package/sample-app/package.json +30 -30
- package/sample-app/tsconfig.json +6 -6
- package/src/Modal.tsx +3 -2
package/package.json
CHANGED
package/sample-app/App.tsx
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
import { StatusBar } from 'expo-status-bar';
|
|
2
|
-
import { StyleSheet, Text, View } from 'react-native';
|
|
3
|
-
import { DemoScreen, Theme, ThemeContext } from 'react-native-boxes'
|
|
4
|
-
import { SafeAreaProvider } from 'react-native-safe-area-context';
|
|
5
|
-
|
|
6
|
-
export default function App() {
|
|
7
|
-
const theme = new Theme()
|
|
8
|
-
|
|
9
|
-
loadAsync({
|
|
10
|
-
'Regular': require('./assets/fonts/Regular.ttf'),
|
|
11
|
-
'Bold': require('./assets/fonts/Bold.ttf'),
|
|
12
|
-
'Styled': require('./assets/fonts/Styled.ttf'),
|
|
13
|
-
})
|
|
14
|
-
return (
|
|
15
|
-
<ThemeContext.Provider value={theme}>
|
|
16
|
-
<SafeAreaProvider>
|
|
17
|
-
<DemoScreen />
|
|
18
|
-
</SafeAreaProvider>
|
|
19
|
-
</ThemeContext.Provider>
|
|
20
|
-
);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
const styles = StyleSheet.create({
|
|
24
|
-
container: {
|
|
25
|
-
flex: 1,
|
|
26
|
-
backgroundColor: '#fff',
|
|
27
|
-
alignItems: 'center',
|
|
28
|
-
justifyContent: 'center',
|
|
29
|
-
},
|
|
30
|
-
});
|
|
31
|
-
function loadAsync(arg0: { Regular: any; Bold: any; Styled: any; }) {
|
|
32
|
-
throw new Error('Function not implemented.');
|
|
33
|
-
}
|
|
34
|
-
|
|
1
|
+
import { StatusBar } from 'expo-status-bar';
|
|
2
|
+
import { StyleSheet, Text, View } from 'react-native';
|
|
3
|
+
import { DemoScreen, Theme, ThemeContext } from 'react-native-boxes'
|
|
4
|
+
import { SafeAreaProvider } from 'react-native-safe-area-context';
|
|
5
|
+
|
|
6
|
+
export default function App() {
|
|
7
|
+
const theme = new Theme()
|
|
8
|
+
|
|
9
|
+
loadAsync({
|
|
10
|
+
'Regular': require('./assets/fonts/Regular.ttf'),
|
|
11
|
+
'Bold': require('./assets/fonts/Bold.ttf'),
|
|
12
|
+
'Styled': require('./assets/fonts/Styled.ttf'),
|
|
13
|
+
})
|
|
14
|
+
return (
|
|
15
|
+
<ThemeContext.Provider value={theme}>
|
|
16
|
+
<SafeAreaProvider>
|
|
17
|
+
<DemoScreen />
|
|
18
|
+
</SafeAreaProvider>
|
|
19
|
+
</ThemeContext.Provider>
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const styles = StyleSheet.create({
|
|
24
|
+
container: {
|
|
25
|
+
flex: 1,
|
|
26
|
+
backgroundColor: '#fff',
|
|
27
|
+
alignItems: 'center',
|
|
28
|
+
justifyContent: 'center',
|
|
29
|
+
},
|
|
30
|
+
});
|
|
31
|
+
function loadAsync(arg0: { Regular: any; Bold: any; Styled: any; }) {
|
|
32
|
+
throw new Error('Function not implemented.');
|
|
33
|
+
}
|
|
34
|
+
|
package/sample-app/app.json
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
{
|
|
2
|
-
"expo": {
|
|
3
|
-
"name": "sample-app",
|
|
4
|
-
"slug": "sample-app",
|
|
5
|
-
"version": "1.0.0",
|
|
6
|
-
"orientation": "portrait",
|
|
7
|
-
"icon": "./assets/icon.png",
|
|
8
|
-
"userInterfaceStyle": "light",
|
|
9
|
-
"splash": {
|
|
10
|
-
"image": "./assets/splash.png",
|
|
11
|
-
"resizeMode": "contain",
|
|
12
|
-
"backgroundColor": "#ffffff"
|
|
13
|
-
},
|
|
14
|
-
"assetBundlePatterns": [
|
|
15
|
-
"**/*"
|
|
16
|
-
],
|
|
17
|
-
"ios": {
|
|
18
|
-
"supportsTablet": true
|
|
19
|
-
},
|
|
20
|
-
"android": {
|
|
21
|
-
"adaptiveIcon": {
|
|
22
|
-
"foregroundImage": "./assets/adaptive-icon.png",
|
|
23
|
-
"backgroundColor": "#ffffff"
|
|
24
|
-
}
|
|
25
|
-
},
|
|
26
|
-
"web": {
|
|
27
|
-
"favicon": "./assets/favicon.png"
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"expo": {
|
|
3
|
+
"name": "sample-app",
|
|
4
|
+
"slug": "sample-app",
|
|
5
|
+
"version": "1.0.0",
|
|
6
|
+
"orientation": "portrait",
|
|
7
|
+
"icon": "./assets/icon.png",
|
|
8
|
+
"userInterfaceStyle": "light",
|
|
9
|
+
"splash": {
|
|
10
|
+
"image": "./assets/splash.png",
|
|
11
|
+
"resizeMode": "contain",
|
|
12
|
+
"backgroundColor": "#ffffff"
|
|
13
|
+
},
|
|
14
|
+
"assetBundlePatterns": [
|
|
15
|
+
"**/*"
|
|
16
|
+
],
|
|
17
|
+
"ios": {
|
|
18
|
+
"supportsTablet": true
|
|
19
|
+
},
|
|
20
|
+
"android": {
|
|
21
|
+
"adaptiveIcon": {
|
|
22
|
+
"foregroundImage": "./assets/adaptive-icon.png",
|
|
23
|
+
"backgroundColor": "#ffffff"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
"web": {
|
|
27
|
+
"favicon": "./assets/favicon.png"
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
package/sample-app/package.json
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "sample-app",
|
|
3
|
-
"version": "1.0.0",
|
|
4
|
-
"main": "node_modules/expo/AppEntry.js",
|
|
5
|
-
"scripts": {
|
|
6
|
-
"start": "expo start",
|
|
7
|
-
"android": "expo start --android",
|
|
8
|
-
"ios": "expo start --ios",
|
|
9
|
-
"web": "expo start --web"
|
|
10
|
-
},
|
|
11
|
-
"dependencies": {
|
|
12
|
-
"@expo/metro-runtime": "~3.1.3",
|
|
13
|
-
"@expo/vector-icons": "^13.0.0",
|
|
14
|
-
"expo": "~50.0.14",
|
|
15
|
-
"expo-status-bar": "~1.11.1",
|
|
16
|
-
"react": "18.2.0",
|
|
17
|
-
"react-dom": "18.2.0",
|
|
18
|
-
"react-native": "0.73.6",
|
|
19
|
-
"react-native-boxes": "^1.4.61",
|
|
20
|
-
"react-native-gesture-handler": "^2.22.1",
|
|
21
|
-
"react-native-safe-area-context": "^4.9.0",
|
|
22
|
-
"react-native-web": "~0.19.6"
|
|
23
|
-
},
|
|
24
|
-
"devDependencies": {
|
|
25
|
-
"@babel/core": "^7.20.0",
|
|
26
|
-
"@types/react": "~18.2.45",
|
|
27
|
-
"typescript": "^5.1.3"
|
|
28
|
-
},
|
|
29
|
-
"private": true
|
|
30
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "sample-app",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"main": "node_modules/expo/AppEntry.js",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"start": "expo start",
|
|
7
|
+
"android": "expo start --android",
|
|
8
|
+
"ios": "expo start --ios",
|
|
9
|
+
"web": "expo start --web"
|
|
10
|
+
},
|
|
11
|
+
"dependencies": {
|
|
12
|
+
"@expo/metro-runtime": "~3.1.3",
|
|
13
|
+
"@expo/vector-icons": "^13.0.0",
|
|
14
|
+
"expo": "~50.0.14",
|
|
15
|
+
"expo-status-bar": "~1.11.1",
|
|
16
|
+
"react": "18.2.0",
|
|
17
|
+
"react-dom": "18.2.0",
|
|
18
|
+
"react-native": "0.73.6",
|
|
19
|
+
"react-native-boxes": "^1.4.61",
|
|
20
|
+
"react-native-gesture-handler": "^2.22.1",
|
|
21
|
+
"react-native-safe-area-context": "^4.9.0",
|
|
22
|
+
"react-native-web": "~0.19.6"
|
|
23
|
+
},
|
|
24
|
+
"devDependencies": {
|
|
25
|
+
"@babel/core": "^7.20.0",
|
|
26
|
+
"@types/react": "~18.2.45",
|
|
27
|
+
"typescript": "^5.1.3"
|
|
28
|
+
},
|
|
29
|
+
"private": true
|
|
30
|
+
}
|
package/sample-app/tsconfig.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "expo/tsconfig.base",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"strict": true
|
|
5
|
-
}
|
|
6
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"extends": "expo/tsconfig.base",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"strict": true
|
|
5
|
+
}
|
|
6
|
+
}
|
package/src/Modal.tsx
CHANGED
|
@@ -35,7 +35,8 @@ export const BottomSheet = (props: BottomSheetProps) => {
|
|
|
35
35
|
const theme = useContext(ThemeContext)
|
|
36
36
|
let cancellable = props.cancellable != undefined ?
|
|
37
37
|
props.cancellable : true
|
|
38
|
-
|
|
38
|
+
let swipeToCloseDisabled = props.swipeToCloseDisabled != undefined ?
|
|
39
|
+
props.swipeToCloseDisabled : false
|
|
39
40
|
useEffect(() => {
|
|
40
41
|
setModalVisible(props.visible)
|
|
41
42
|
if (props.visible)
|
|
@@ -58,7 +59,7 @@ export const BottomSheet = (props: BottomSheetProps) => {
|
|
|
58
59
|
props.onDismiss && props.onDismiss()
|
|
59
60
|
})
|
|
60
61
|
|
|
61
|
-
const Wrapper =
|
|
62
|
+
const Wrapper = swipeToCloseDisabled ? ({ children }: any) => {
|
|
62
63
|
return (
|
|
63
64
|
<View style={[styles.modalContainer, {
|
|
64
65
|
backgroundColor: props.backgroundColor || theme.colors.forground
|