From 9952f69e76bd60b1dbae88e0e88d35f181c4add1 Mon Sep 17 00:00:00 2001 From: Thomas Schoffelen Date: Tue, 27 Aug 2019 09:31:42 +0200 Subject: [PATCH] Updated example, fix code style. --- .eslintrc.json | 43 +- example/.gitignore | 11 + example/.watchmanconfig | 1 + example/App.js | 52 +- example/app.json | 23 + example/babel.config.js | 6 + example/index.js | 4 - example/package.json | 23 +- package-lock.json | 1902 --------------------------------------- package.json | 92 +- src/components/Popup.js | 103 ++- src/constants.js | 28 +- src/index.js | 41 +- src/utils.js | 17 +- 14 files changed, 241 insertions(+), 2105 deletions(-) create mode 100644 example/.gitignore create mode 100644 example/.watchmanconfig create mode 100644 example/app.json create mode 100644 example/babel.config.js delete mode 100644 example/index.js delete mode 100644 package-lock.json diff --git a/.eslintrc.json b/.eslintrc.json index 6f23e75..11c1912 100644 --- a/.eslintrc.json +++ b/.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": { } - } -} +} \ No newline at end of file diff --git a/example/.gitignore b/example/.gitignore new file mode 100644 index 0000000..4820714 --- /dev/null +++ b/example/.gitignore @@ -0,0 +1,11 @@ +node_modules/**/* +.expo/* +npm-debug.* +*.jks +*.p8 +*.p12 +*.key +*.mobileprovision +*.orig.* +web-build/ +web-report/ diff --git a/example/.watchmanconfig b/example/.watchmanconfig new file mode 100644 index 0000000..0967ef4 --- /dev/null +++ b/example/.watchmanconfig @@ -0,0 +1 @@ +{} diff --git a/example/App.js b/example/App.js index f82a7af..aba5e52 100644 --- a/example/App.js +++ b/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 () { @@ -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} /> - { this.setState({ isVisible: true }) }}> - - Show in Maps - - + +