|
1 | 1 | import React from 'react'; |
2 | | -import { View } from 'react-native'; |
| 2 | +import { View, StyleSheet } from 'react-native'; |
3 | 3 | import MapView from 'react-native-maps'; |
4 | 4 |
|
5 | 5 | import { storiesOf } from '@storybook/react'; |
6 | 6 | import { action } from '@storybook/addon-actions'; |
7 | 7 |
|
8 | 8 | storiesOf('MapView', module) |
9 | | - .add('basic', () => <MapView region={{ latitude: 48.86, longitude: 2.34 }} />) |
| 9 | + .add('basic', () => ( |
| 10 | + <View style={styles.container}> |
| 11 | + <MapView region={{ latitude: 48.86, longitude: 2.34 }} /> |
| 12 | + </View> |
| 13 | + )) |
10 | 14 | .add('onRegionChangeComplete', () => ( |
11 | | - <View> |
| 15 | + <View style={styles.container}> |
12 | 16 | <MapView |
13 | 17 | region={{ latitude: 48.86, longitude: 2.34 }} |
14 | 18 | onRegionChangeComplete={action('onRegionChangeComplete toggled')} |
15 | 19 | /> |
16 | 20 | </View> |
17 | 21 | )) |
18 | 22 | .add('onPress', () => ( |
19 | | - <View> |
| 23 | + <View style={styles.container}> |
20 | 24 | <MapView region={{ latitude: 48.86, longitude: 2.34 }} onPress={action('onPress toggled')} /> |
21 | 25 | </View> |
22 | 26 | )); |
| 27 | + |
23 | 28 | storiesOf('Marker', module).add('basic', () => ( |
24 | | - <MapView region={{ latitude: 48.88, longitude: 2.32 }}> |
25 | | - <MapView.Marker |
26 | | - title="BAM" |
27 | | - description="Shape the future of mobile with us" |
28 | | - coordinate={{ latitude: 48.8828463, longitude: 2.3229091 }} |
29 | | - /> |
30 | | - </MapView> |
| 29 | + <View style={styles.container}> |
| 30 | + <MapView region={{ latitude: 48.88, longitude: 2.32 }}> |
| 31 | + <MapView.Marker |
| 32 | + title="BAM" |
| 33 | + description="Shape the future of mobile with us" |
| 34 | + coordinate={{ latitude: 48.8828463, longitude: 2.3229091 }} |
| 35 | + /> |
| 36 | + </MapView> |
| 37 | + </View> |
31 | 38 | )); |
| 39 | + |
| 40 | +const styles = StyleSheet.create({ |
| 41 | + container: { |
| 42 | + height: '100vh', |
| 43 | + }, |
| 44 | +}); |
0 commit comments