Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V3.0.0 - Big Refactor, updated libraries, project converted to typescript, Popup refactored #270

Merged
merged 18 commits into from
Mar 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,15 @@
"env": {
"jest": true
},
"parser": "@babel/eslint-parser",
"extends": "@react-native-community",
"plugins": ["@babel"],
"parser": "@typescript-eslint/parser",
"extends": [
"@react-native-community",
"plugin:@typescript-eslint/recommended"
],
"plugins": ["@typescript-eslint"],
"settings": {
"react": {
"version": "16.8"
"version": "18.2"
}
}
}
13 changes: 8 additions & 5 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
name: Linting

on: [ push, pull_request ]
on: [push, pull_request]

jobs:
eslint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Use Node 16
uses: actions/setup-node@v2
uses: actions/checkout@v4

- name: Use Node 20
uses: actions/setup-node@v4
with:
node-version: 16
node-version: 20
cache: yarn

- name: Install dependencies
run: yarn

- name: Run linter
run: yarn lint
42 changes: 42 additions & 0 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Push
concurrency:
group: push
on:
push:
branches:
- master
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
issues: write
pull-requests: write
id-token: write
steps:
- name: Check out repository code
uses: actions/checkout@v4
with:
persist-credentials: false

- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 20
cache: yarn

- name: Install dependencies
run: yarn --frozen-lockfile

- name: Build
run: yarn build

- name: Install latest npm
run: npm install -g npm@latest

- name: Release
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
NPM_TOKEN: ${{secrets.NPM_TOKEN}}
NPM_CONFIG_PROVENANCE: true
run: yarn release
13 changes: 8 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
name: Unit tests

on: [ push, pull_request ]
on: [push, pull_request]

jobs:
jest:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Use Node 16
uses: actions/setup-node@v2
uses: actions/checkout@v4

- name: Use Node 20
uses: actions/setup-node@v4
with:
node-version: 16
node-version: 20
cache: yarn

- name: Install dependencies
run: yarn

- name: Run tests
run: yarn test
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,10 @@ node_modules
.vscode
package-lock.json
example/yarn.lock

# Jest
#
.jest/

# ts outDir
lib/
10 changes: 5 additions & 5 deletions docs/add-app.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,14 @@ URL schemes.
This document describes the steps required to add support for a new
maps/directions app to the library.


## General guidelines

* Only submit one new app integration per pull request.

- Only submit one new app integration per pull request.

## Step by step

### 1. Add constants

Start by updating [`src/constants.js`](../src/constants.js).

Start by determining a key that you will use to identify the new app.
Expand All @@ -28,21 +27,22 @@ title to the `title` variable.
The URL scheme you add to the `prefixes` variable will be used to
determine if the app exists on the client's device.


### 2. Add icon

Add a 150x150 pixels icon with that same name to the `src/images`
directory, and then add the appropriate reference to that icon to the
`icons` object in the `src/constants.js` file.

### 3. Add logic

In [`src/index.js`](../src/index.js) you will find the logic to actually open the app. Add the
logic for your new app there, and make sure to test it on Android and
iOS. Some apps use different URL formats for each platform.

### 4. Update README

Add the new app to the list at the top of `README.md`. Also make sure
to add any iOS-specific new URL schemes to the
`LSApplicationQueriesSchemes` information just below it.


Thanks!
2 changes: 1 addition & 1 deletion docs/expo.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

These instructions are provided to help you configure your Expo app to work with this library. When using Expo there are two workflows: managed and bare. The instructions for each are slightly different.

# iOS
# IOS

## Bare Workflow

Expand Down
4 changes: 2 additions & 2 deletions docs/popup.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { Popup } from 'react-native-map-link';
onCancelPressed={() => this.setState({ isVisible: false })}
onAppPressed={() => this.setState({ isVisible: false })}
onBackButtonPressed={() => this.setState({ isVisible: false })}
modalProps={{ // you can put all react-native-modal props inside.
modalProps={{ // you can put all modal props inside.
animationIn: 'slideInUp'
}}
appsWhiteList={[ /* Array of apps (apple-maps, google-maps, etc...) that you want
Expand All @@ -25,7 +25,7 @@ import { Popup } from 'react-native-map-link';
/>
```

The Popup component uses <a href="https://github.com/react-native-community/react-native-modal">react-native-modal</a>. So you can pass all react-native-modal properties inside "modalProps" to modify styling and animations.
The Popup component uses <a href="https://reactnative.dev/docs/modal">react native modal</a>. So you can pass all react native modal properties inside "modalProps" to modify styling and animations.

Also, you can customize the styling of the popup by passing an object like this in the `style` prop of the `Popup` component:

Expand Down
37 changes: 31 additions & 6 deletions example/.gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,36 @@
node_modules/**/*
.expo/*
npm-debug.*
# Learn more https://docs.github.com/en/get-started/getting-started-with-git/ignoring-files

# dependencies
node_modules/

# Expo
.expo/
dist/
web-build/
web-report/

# Native
*.orig.*
*.jks
*.p8
*.p12
*.key
*.mobileprovision
*.orig.*
web-build/
web-report/

# Metro
.metro-health-check*

# debug
npm-debug.*
yarn-debug.*
yarn-error.*

# macOS
.DS_Store
*.pem

# local env files
.env*.local

# typescript
*.tsbuildinfo
1 change: 0 additions & 1 deletion example/.watchmanconfig

This file was deleted.

94 changes: 0 additions & 94 deletions example/App.js

This file was deleted.

Loading