@boneframework/native-components 1.0.59 → 1.0.61
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.
|
@@ -3,17 +3,18 @@ import Lottie from 'lottie-react';
|
|
|
3
3
|
|
|
4
4
|
function Animation({source, style = {}, onAnimationFinish = () => {}, autoPlay = true, loop = true, speed = 1.5}) {
|
|
5
5
|
|
|
6
|
-
const lottieRef = useRef
|
|
6
|
+
const lottieRef = useRef(null);
|
|
7
7
|
|
|
8
8
|
return(
|
|
9
9
|
<Lottie
|
|
10
|
-
|
|
10
|
+
animationData={source}
|
|
11
11
|
autoPlay={autoPlay}
|
|
12
12
|
loop={loop}
|
|
13
13
|
style={style}
|
|
14
14
|
speed={speed}
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
onComplete={onAnimationFinish}
|
|
16
|
+
lottieRef={lottieRef}
|
|
17
|
+
onDOMLoaded={() => lottieRef.current?.setSpeed(speed)}
|
|
17
18
|
/>
|
|
18
19
|
);
|
|
19
20
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@boneframework/native-components",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.61",
|
|
4
4
|
"description": "Expo React Native Components for Bone Framework",
|
|
5
5
|
"main": "src/Bone.ts",
|
|
6
6
|
"scripts": {
|
|
@@ -42,6 +42,7 @@
|
|
|
42
42
|
"expo-image-picker": "^17.0.9",
|
|
43
43
|
"expo-linear-gradient": "^15.0.8",
|
|
44
44
|
"expo-location": "^19.0.8",
|
|
45
|
+
"expo-maps": "^0.12.10",
|
|
45
46
|
"expo-notifications": "^0.32.14",
|
|
46
47
|
"expo-router": "^6.0.17",
|
|
47
48
|
"expo-secure-store": "^15.0.8",
|
|
@@ -52,7 +53,6 @@
|
|
|
52
53
|
"pigeon-maps": "^0.22.1",
|
|
53
54
|
"react": "19.1.0",
|
|
54
55
|
"react-native-gesture-handler": "^2.29.1",
|
|
55
|
-
"react-native-maps": "^1.26.19",
|
|
56
56
|
"react-native-progress": "^5.0.1",
|
|
57
57
|
"toggle-switch-react-native": "^3.3.0",
|
|
58
58
|
"yup": "^1.7.1"
|
|
@@ -1,14 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
function MapScreen(props) {
|
|
6
|
-
return (
|
|
7
|
-
<View style={styles.container}>
|
|
8
|
-
<MapView style={styles.map} />
|
|
9
|
-
</View>
|
|
10
|
-
);
|
|
11
|
-
}
|
|
2
|
+
import { AppleMaps, GoogleMaps } from 'expo-maps';
|
|
3
|
+
import {Platform, StyleSheet, Text, View} from "react-native";
|
|
12
4
|
|
|
13
5
|
const styles = StyleSheet.create({
|
|
14
6
|
container: {
|
|
@@ -20,4 +12,18 @@ const styles = StyleSheet.create({
|
|
|
20
12
|
},
|
|
21
13
|
});
|
|
22
14
|
|
|
15
|
+
function MapScreen(props) {
|
|
16
|
+
|
|
17
|
+
const children = props.children;
|
|
18
|
+
|
|
19
|
+
if (Platform.OS === 'ios')
|
|
20
|
+
return <View style={styles.container}><AppleMaps.View style={styles.map} {...props} >{children}</AppleMaps.View></View>;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
if (Platform.OS === 'android') {
|
|
24
|
+
return <View style={styles.container}><GoogleMaps.View style={styles.map} {...props} >{children}</GoogleMaps.View></View>;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
|
|
23
29
|
export default MapScreen;
|
|
@@ -8,14 +8,20 @@ function MapScreen(props) {
|
|
|
8
8
|
|
|
9
9
|
return (
|
|
10
10
|
<View style={styles.container}>
|
|
11
|
-
<Map
|
|
11
|
+
<Map
|
|
12
|
+
defaultCenter={center}
|
|
13
|
+
defaultZoom={center}
|
|
14
|
+
defaultHeight={styles.map.height}
|
|
15
|
+
defaultWidth={styles.map.width}
|
|
12
16
|
center={center}
|
|
13
17
|
zoom={zoom}
|
|
14
18
|
onBoundsChanged={({ center, zoom }) => {
|
|
15
19
|
setCenter(center)
|
|
16
20
|
setZoom(zoom)
|
|
17
21
|
}}
|
|
18
|
-
|
|
22
|
+
>
|
|
23
|
+
{props.children}
|
|
24
|
+
</Map>
|
|
19
25
|
</View>
|
|
20
26
|
)
|
|
21
27
|
}
|