Skip to content

Commit

Permalink
Updated example, fix code style.
Browse files Browse the repository at this point in the history
  • Loading branch information
tschoffelen committed Aug 27, 2019
1 parent dfdcbec commit 9952f69
Show file tree
Hide file tree
Showing 14 changed files with 241 additions and 2,105 deletions.
43 changes: 24 additions & 19 deletions .eslintrc.json
@@ -1,21 +1,26 @@
{
"root": true,
"parser": "babel-eslint",
"extends": [
"standard",
"standard-react"
],
"globals": {
"Atomics": "readonly",
"SharedArrayBuffer": "readonly"
},
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module",
"ecmaFeatures": {
"jsx": true,
"modules": true,
"experimentalObjectRestSpread": true
"env": {
"browser": true,
"es6": true,
"node": true
},
"extends": [
"standard"
],
"globals": {
"Atomics": "readonly",
"SharedArrayBuffer": "readonly"
},
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": 2018,
"sourceType": "module"
},
"plugins": [
"react"
],
"rules": {
}
}
}
}
11 changes: 11 additions & 0 deletions example/.gitignore
@@ -0,0 +1,11 @@
node_modules/**/*
.expo/*
npm-debug.*
*.jks
*.p8
*.p12
*.key
*.mobileprovision
*.orig.*
web-build/
web-report/
1 change: 1 addition & 0 deletions example/.watchmanconfig
@@ -0,0 +1 @@
{}
52 changes: 22 additions & 30 deletions example/App.js
@@ -1,17 +1,24 @@
/**
* Sample React Native App
* https://github.com/facebook/react-native
* @flow
*/

import React, { Component } from 'react'
import { TouchableOpacity, StyleSheet, Text, View } from 'react-native'
import { Button, StyleSheet, View } from 'react-native'

import { Popup, showLocation } from 'react-native-map-link'

import { Popup } from 'react-native-map-link'
const options = {
latitude: 38.8976763,
longitude: -77.0387185,
title: 'The White House',
dialogTitle: 'This is the dialog Title',
dialogMessage: 'This is the amazing dialog Message',
cancelText: 'This is the cancel button text'
}

export default class App extends Component {
state = {
isVisible: false
constructor (props) {
super(props)

this.state = {
isVisible: false
}
}

render () {
Expand All @@ -22,20 +29,11 @@ export default class App extends Component {
onCancelPressed={() => this.setState({ isVisible: false })}
onAppPressed={() => this.setState({ isVisible: false })}
onBackButtonPressed={() => this.setState({ isVisible: false })}
options={{
latitude: 38.8976763,
longitude: -77.0387185,
title: 'The White House',
dialogTitle: 'This is the dialog Title',
dialogMessage: 'This is the amazing dialog Message',
cancelText: 'This is the cancel button text'
}}
options={options}
/>
<TouchableOpacity style={{ padding: 20 }} onPress={() => { this.setState({ isVisible: true }) }}>
<Text style={styles.welcome}>
Show in Maps
</Text>
</TouchableOpacity>

<Button onPress={() => showLocation(options)} title='Show in Maps using action sheet'/>
<Button onPress={() => { this.setState({ isVisible: true }) }} title='Show in Maps using Popup'/>
</View>
)
}
Expand All @@ -46,12 +44,6 @@ const styles = StyleSheet.create({
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#F5FCFF'
},
welcome: {
fontSize: 20,
textAlign: 'center',
color: '#4682BC',
margin: 10
backgroundColor: '#fff'
}
})
23 changes: 23 additions & 0 deletions example/app.json
@@ -0,0 +1,23 @@
{
"expo": {
"name": "MapLink",
"slug": "example",
"privacy": "public",
"sdkVersion": "34.0.0",
"platforms": [
"ios",
"android"
],
"version": "1.0.0",
"orientation": "portrait",
"updates": {
"fallbackToCacheTimeout": 0
},
"assetBundlePatterns": [
"**/*"
],
"ios": {
"supportsTablet": true
}
}
}
6 changes: 6 additions & 0 deletions example/babel.config.js
@@ -0,0 +1,6 @@
module.exports = function(api) {
api.cache(true);
return {
presets: ['babel-preset-expo'],
};
};
4 changes: 0 additions & 4 deletions example/index.js

This file was deleted.

23 changes: 15 additions & 8 deletions example/package.json
@@ -1,13 +1,20 @@
{
"name": "example",
"version": "0.0.1",
"private": true,
"main": "node_modules/expo/AppEntry.js",
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start"
"start": "expo start",
"android": "expo start --android",
"ios": "expo start --ios",
"web": "expo start --web",
"eject": "expo eject"
},
"dependencies": {
"react": "^16.8.6",
"react-native": "^0.59.9",
"react-native-map-link": "^2.4.3"
}
"expo": "^34.0.1",
"react": "16.8.3",
"react-native": "https://github.com/expo/react-native/archive/sdk-34.0.0.tar.gz",
"react-native-map-link": "^2.4.5"
},
"devDependencies": {
"babel-preset-expo": "^6.0.0"
},
"private": true
}

0 comments on commit 9952f69

Please sign in to comment.