Skip to content

Commit

Permalink
V2.6.0 release to main (#2921)
Browse files Browse the repository at this point in the history
* Add missing required prop in tests (#2727)

* Add resolution for ws to address security vuln (#2737)

* Add iconUrls to allowed list of keys (#2728)

Co-authored-by: sethkfman <10342624+sethkfman@users.noreply.github.com>

* Feature/use same media player (#2711)

* Use same media player

* Remove unused react-native-video-controls

* Remove SVG and image toggle

* Add onBack

* Update snapshot

* only change one heading

* Use scaling

* Feature/bitrise circle ci hybrid (#2713)

* updated yml segmented code cov

* updated yml triggers

* updated yml triggers

* updated yml triggers

* updated yml codecov

* switched to ci

* switched to ci

* test deploy

* test deploy ios

* format

* imported env variables

* added env variables

* added env variables

* reconfigured build triggers

* reconfigured build triggers

* reconfigured build triggers

* removed fastlane from build scripts and added commnets to bitrise scripts

* testing android artifact upload

* commented out code that is not needed

* added android deploy paths

* test

* Revert "test"

This reverts commit 77ef282.

* updated android deploy paths

* bitrise-yml-bump-version

* bump_version_minor

* workflow

* PROJECT_LOCATION

* bump_version_minor

* new_version_name

* space

* Revert "space"

This reverts commit e0eb5ad.

* 2.1.1

* new_version_name

* torevert

* Revert "torevert"

This reverts commit a315582.

* d

* revert

* env

* ios

* test android build

* bump_version_minor

* temporarily creating debug android build for testing

* VERSION_NAME

* e2e testing

* modified build script to generate debug app for testing

* added pod file install into code prep

* moved pod install to e2e workflow

* update e2e

* updated e2e

* updated e2e script

* added back envs

* updated e2e

* updated e2e

* updated code_setup & e2e

* updated detox script

* added test deploy

* commented out steps for testing

* updated build announce to use bitrise script

* added bitrise announcement script

* refactored bitrise scripts to reflect the notion workflows

* added new yarn step to audit dependencies

* removing scripts and using yarn e2e test

* moved the trigger

* updated yarn audit command

* updated e2e

* updated e2e

* updated build scripts to generate release and added dependency for android test release

* test-android-build

* generic-file-storage

* file-downloader

* Revert "file-downloader"

This reverts commit db69ef5.

* Download keystore

* moved keystore download up in the workflow

* updated keystore pull script

* updated keystore pull script

* added file downloader

* added file downloader

* uploaded keystore file android test

* updated android release

* updated release build to pull keystore from bitrise

* update android bitrise deploy

* added android e2e workflow and updated release signing config

* commented out e2e

* uncommented e2e setup

* uncommented e2e

* updated file format

* uncommented e2e

* comment e2e

* uncommented e2e

* formatting bitrise file

* updated build scripts to use release

* swaped password for release

* test ios release

* updated yarn steps

* update slack bot script

* added group test release

* run android test release

* updated announce script

* update triggers and typos

* update to test ios build

* updated build type for pre-release

* ios app generation

* ios app generation

* updated iOS builds

* use bitrise xcode deploy

* update ios release steps

* added deploy to itunes connect

* formatting

* updated node version

* udpated node version

* Bitrise yml bump version (#2535)

* scriptsworking

* scripts

* scripts

* working

* newscript

* works

* pre-merge-hook

* 1.0.0 (#2560)

* dah

* actions?

* branchasinput

* update

* branch

* Release/testing minor (#2563)

* Bitrise yml bump version (#1)

* added new bitrise yml file

* updated unit test yml

* updated yml

* added code coverage

* added code coverage install

* segment out code setup and validation from test cases

* updating yml audit

* updated yml

* updated yml

* updated yml audits

* updated yml audits

* updated yml audits

* updated yml audits

* updated yml install

* updated yml audit

* updated yml audit

* updated yml segmented code_setup

* updated yml segmented code_setup

* updated yml segmented set to not always run

* updated yml segmented code cov

* updated yml triggers

* updated yml triggers

* updated yml triggers

* updated yml codecov

* switched to ci

* switched to ci

* test deploy

* test deploy ios

* format

* imported env variables

* added env variables

* added env variables

* reconfigured build triggers

* reconfigured build triggers

* reconfigured build triggers

* removed fastlane from build scripts and added commnets to bitrise scripts

* testing android artifact upload

* commented out code that is not needed

* added android deploy paths

* test

* Revert "test"

This reverts commit 77ef282.

* updated android deploy paths

* bitrise-yml-bump-version

* bump_version_minor

* workflow

* PROJECT_LOCATION

* bump_version_minor

* new_version_name

* space

* Revert "space"

This reverts commit e0eb5ad.

* 2.1.1

* new_version_name

* torevert

* Revert "torevert"

This reverts commit a315582.

* d

* revert

* env

* ios

* test android build

* bump_version_minor

* temporarily creating debug android build for testing

* VERSION_NAME

* scriptsworking

* scripts

* scripts

* working

* newscript

* works

* pre-merge-hook

* 1.0.0 (#2560)

* dah

* actions?

* branchasinput

* update

* branch

Co-authored-by: sethkfman <seth.kaufman@consensys.net>

* changename (#2)

* Changetorun (#3)

* changename

* run

* release/test-minor (#4)

* rm-condition (#5)

* Filelocation (#6)

* rm-condition

* file

* Checkout step (#7)

* rm-condition

* file

* checkout-step

* Try (#8)

* a

* Revert "a"

This reverts commit 5df3682.

* Logs (#9)

* a

* Revert "a"

This reverts commit 5df3682.

* logs

* Branch (#10)

* a

* Revert "a"

This reverts commit 5df3682.

* logs

* branch

* Var (#11)

* a

* Revert "a"

This reverts commit 5df3682.

* logs

* branch

* correct

* echo (#12)

* echo

* rm

* pull-request (#13)

* Pull request 2 (#14)

* pull-request

* ref

* GITHUB_REF

* parse

* with-branch (#15)

* Origin branch (#16)

* with-branch

* origin-branch

* base_ref (#17)

* push

* rmrnv

* gh

* action

* event_name

* base_ref

* location

* location

* ls

* find

* file

* file

* GITHUB_TOKEN

* persist

* with

* uses

* bitrise

* sed

* commit

* diff

* release/fake-major

* add-and-commit

* with

* author

* path-to-th-repo

* checkout@v1

* v2

* Bump version name

* useref (#18)

* change

* ref

* something (#19)

* Branch 3 (#20)

* something

* onmerge

* fix

* Branch 4 (#21)

* something

* onmerge

* fix

* GITHUB_REF

* GITHUB_CONTEXT

* GITHUB_CONTEXT

* BASE_REF

* HEAD_REF

* nobump

* something (#22)

* s (#23)

* s

* Bump version name

* types (#24)

* create-pr

* something (#25)

* Release/ww patch (#26)

* something

* opened

* Bump version name

* othercommit

* Release/nohead patch (#36)

* ghactions

* something

* fix

* nopush

* head

* pull

* nohead

* nopull

* nohead

* update

* gitpush

* force

* Bump version name

* opened

Co-authored-by: github-actions <github-actions@github.com>

* rmonpush

* Bump version name

* startsWith

* main

* rmstartwith

* line

Co-authored-by: sethkfman <seth.kaufman@consensys.net>
Co-authored-by: github-actions <github-actions@github.com>

* newscript

* release/testbump-patch (#2570)

* space

* branch

* notopenend

* diff

* Bump version name

Co-authored-by: github-actions <github-actions@github.com>

* addbranch

* version

* ifrelease

* add

* lasttest

* ifcontains

* branch

Co-authored-by: sethkfman <seth.kaufman@consensys.net>
Co-authored-by: github-actions <github-actions@github.com>

* iOS build update

* iOS build update

* added android and ios in a single release build

* added android and ios in a single release build

* updated iOS release

* updated iOS release

* updated iOS release

* updated iOS release

* added android to test_release

* test iOS build with export options

* test iOS build with export options

* setup android release build

* fix action condition (#2576)

* updated export options to include provisioning profile and added deploy to bitrise steps to ios

* bump_version

* start_release_builds

* androidthenios

* cachepull

* before_run

* deploy-to-itunesconnect

* onefirsttheother

* iosfirst

* comments

* updated slack announce script

* uncommented deploy and slack announce

* testing full release (#2582)

* testing full release

* Bump version name

Co-authored-by: github-actions <github-actions@github.com>

* update ios deploy step

* removed test comment (#2584)

* removed test comment

* Bump version name

Co-authored-by: github-actions <github-actions@github.com>

* testing android google play staging

* increased versionCode & PROJECT VERSION

* added iOS build

* added test comment (#2585)

* added test comment

* Bump version name

Co-authored-by: github-actions <github-actions@github.com>

* run android only deploy

* run ios only deploy

* run ios only deploy

* run ios only deploy

* Release/testbuild patch (#2589)

* Swaps: BSC Support (#2468)

* Swaps: Add cache thresholds configuration (#2514)

* removed test comments

* Bump version name

Co-authored-by: Pedro Pablo Aste Kompen <wachunei@gmail.com>
Co-authored-by: github-actions <github-actions@github.com>

* removed fastlane files and minor tweaks to scripts

* updated e2e tests

* updated e2e tests

* updated yarn steps e2e

* updated android scripts

* updated build scrips and yml

* updated e2e builds

* remove CircleCi yml

* added circleci script back

* added emulator print out command

* updated ios e2e test steps

* removed devices

* added creation of emulator to script

* added creation of emulator to script

* added creation of emulator to script

* added creation of emulator to script

* added creation of emulator to script

* removed starting emulators

* updated emulator name

* avd list

* avd creation

* updated bitrise to tigger for v2.3.0 release build test

* updated bundler version

* updated build script

* updated build script

* updated change log with hide zero balance change (#2623)

* updated version name

* updated android emulator name

* added build comments and verbose logging for tests

* added build comments and refactored test inits

* testing parallel deploys

* added comments

* formatting

* moved code snipets

* modified build triggers

* modified build triggers

* added deploy steps for parallel deploy

* updated triggers

* updated trigger

* updated change log

* stop caching

* update build triggers

* update build triggers

* update audit script

* testing parallel deployment

* testing parallel deployment

* testing parallel deployment

* disable release in circleCI

* testing parallel deployment

* updated deploy directory

* updated deploy step

* deploy apk

* updated changelog (#2648)

* updated deploy scripts

* remove code coverage

* updated provisioning profile name

* updated provisioning profile name

* updated version for test 2.3.1

* updated provisioning profile

* update provisioning profile

* added fastlane and gemfiles back

* disabled circle CI and added back slack bot announcement

* commented all CI related tasks

* revert bitrise specific scripting

* commented out bitrise release triggers

* removed ci commneted code

* reverted script changes

* minor syntax tweaks to scripts

* updated the bitrise version to match package

Co-authored-by: Esteban Mino <efmino@uc.cl>
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Pedro Pablo Aste Kompen <wachunei@gmail.com>

* Bugfix/fix ws resolution (#2742)

* Revert "Add resolution for ws to address security vuln (#2737)"

This reverts commit e2226ca.

* Use improved-yarn-audit and exclude 1748

* Convert token id to hexadecimal for collectible transfer (#2703)

* Convert token id to hexadecimal for transfer

* Add test for toHexadecimal

Co-authored-by: Ricky Miller <ricky.miller@gmail.com>

* make null conversionrate safe (#2706)

Co-authored-by: ricky <ricky.miller@gmail.com>

* @metamask/mobile-provider@2.1.0 (#2626)

* @metamask/mobile-provider@2.1.0

* yarn

* bugfix/notifications reducer (#2741)

* Feature/simplify custom gas (#2738)

* Use single method for fast/average/slow

* Use newly added constants

* Educate gas fees (#2611)

Co-authored-by: sethkfman <10342624+sethkfman@users.noreply.github.com>
Co-authored-by: Pedro Pablo Aste Kompen <wachunei@gmail.com>

* On-Ramp: Refactor and Wyre countries (#2617)

Co-authored-by: Esteban Miño <efmino@uc.cl>

* Swaps: Allow every token on user wallet to be swapped (#2701)

* Swaps: Update Market price unavailable and Price impact text (#2702)

Co-authored-by: sethkfman <10342624+sethkfman@users.noreply.github.com>

* @metamask/controllers@10.1.0 (#2749)

* bump

* bump

* yarn

* bugfix/notification visibility (#2746)

* isvisible

* onfinished

* removeonappstate

* Circleci fix (#2757)

* reintallpods

* min9.0

* order

* circleci

* 12.5

* branch

* v2.5.0 (#2748)

* Bump

* Update CHANGELOG.md

* add heading back

* bump to 748

* bump date as well

* Use MediaPlayer (#2759)

* Use MediaPlayer

* height -> HEIGHT

* Add isInteraction: false (#2777)

* Fix: empty state when using fiat on non-mainnet transactions (#2776)

* Add mainnet condition

* Implement secondary values

* Design adjustments

* Fix boldness

* Update test

Co-authored-by: ricky <ricky.miller@gmail.com>

* update CHANGELOG.md (#2796)

* update changelog

* update

* bump version code

* Updated config.yml

* Optional chaining dollarBalance (#2809)

* bumped version and updated changelog (#2810)

* bumped version and updated changelog

* removed config.yml update

* removed changelog

* Lionbridge latest translations for secret recovery phrase and subtitle files (#2743)

* updated translation files with latest translations for secret recovery phrase

* added subtitles to secret phrase videos

* added english subtitles

* added urls for translations and updated video players to show subtitles

* updated subtitle location

* updated translation files with latest secret recovery text

* removed subtitle logic from player

* update translations

* Review Translations (#2806)

* Lionbridge

* Lionbridge

* Client Update

* Lionbridge

Co-authored-by: Brennan <Mark.Brennan@lionbridge.com>
Co-authored-by: !corpitSVCUFC <!corpitSVCUFC@corpnet.liox.org>

* bumped version and updated changelog

* Update subtitles-en.vtt

removed formatting

* Optional chaining dollarBalance (#2809)

* bumped version and updated changelog

* moved files into folder

* removed duplicate swaps section

* updated video and subtitle location

Co-authored-by: Brennan <Mark.Brennan@lionbridge.com>
Co-authored-by: !corpitSVCUFC <!corpitSVCUFC@corpnet.liox.org>
Co-authored-by: Andre Pimenta <andrepimenta7@gmail.com>

* bumped version (#2843)

* Don't render swap router address in recents (#2823)

* Don't render swap router address in recents, fixes: #2822

* Use getSwapsContractAddress

* rename toLowerCaseCompare to toLowerCaseEquals

* Update test

* Rename

* Remove Picker deprecation warning (#2709)

Use @react-native-community/picker

* Improvement/react navigation upgrade 5 (#2731)

* Move to new dependencies

* move navigation.getparam to route.params

* add navigationOptions

* Fix dismiss and drawer working

* Fix remaining route params

* Fix switch navigator and fiat on ramp nav

* Fix routename and pop

* Remove screen props

* Fix deeplink navigation

* Fix navigation for inner screens

* Ignore navigation warning

* Fix get route

* Fix showing protect wallet modal

* Add route to proptypes

* Add more missing proptypes

* Update tests

* Fix some more navigations

* Update collectibles navigatoin

* Use useNavigation

* Use optional chaining on `dangerouslyGetParent()`

* Removing ?? null and ?? undefined

* Reorganize nav imports in App/index

* Update findRouteNameFromNavigatorState

* Remove noop functions

* Adding testing for navigation

* Add more navigation tests

* Add comment explaining the test files

* Remove unnecessary boolean casting

* Remove unnecessary variable

* Remove unnecessary boolean casting

* Fixes navigation issues

* Fix navigation issues

* Fix QR scanner

* fixed enroll navigation reset issue

* Fix going to wallet view

* updated test cases

* Fix simple notification

* Fix going to onboarding

* added snapshots to test

* fixed what new modal test

* added picker to package.json

* yarn clean

* yarn update command

* snapshot update

* removed the dive method on the wrapper

* snapshot update

* update yarn unit test

* commented out cache in build step

* Bug/fix nft gesture experience (#2862)

* Fix collections modal

* Make eslint happy

* Clean up modal code
TODO: Converting components into hooks will save us from re-renders and from doing things like waiting to focus on inputs

* Remove in-house safe area from reusable modal for now

* Fix scroll interaction in collectible modal action sheet

* Use color from overlay

* Add test snap files

* Update snapshots and make tests pass

* uncommented cache for bitrise

Co-authored-by: Pedro Pablo Aste Kompen <wachunei@gmail.com>
Co-authored-by: sethkfman <seth.kaufman@consensys.net>
Co-authored-by: Cal Leung <cleun007@gmail.com>

* Swaps: Fix isZero undefined error (#2883)

* Fix time formatting on transactions (#2854)

* [Optimism] Feature/custom network gas estimates (#2865)

* Move to new dependencies

* move navigation.getparam to route.params

* add navigationOptions

* Fix dismiss and drawer working

* Fix remaining route params

* Fix switch navigator and fiat on ramp nav

* Fix routename and pop

* Remove screen props

* Fix deeplink navigation

* Fix navigation for inner screens

* Ignore navigation warning

* Fix get route

* Fix showing protect wallet modal

* Add route to proptypes

* Add more missing proptypes

* Update tests

* Fix some more navigations

* Update collectibles navigatoin

* Use useNavigation

* Use optional chaining on `dangerouslyGetParent()`

* Removing ?? null and ?? undefined

* Reorganize nav imports in App/index

* Update findRouteNameFromNavigatorState

* Remove noop functions

* Adding testing for navigation

* Add more navigation tests

* Add comment explaining the test files

* Remove unnecessary boolean casting

* Remove unnecessary variable

* Remove unnecessary boolean casting

* Fixes navigation issues

* Fix navigation issues

* Fix QR scanner

* fixed enroll navigation reset issue

* Fix going to wallet view

* updated test cases

* Fix simple notification

* Fix going to onboarding

* added snapshots to test

* fixed what new modal test

* added picker to package.json

* yarn clean

* yarn update command

* snapshot update

* removed the dive method on the wrapper

* snapshot update

* update yarn unit test

* added logic for gas calculations on custom networks identified by the network controller

* added test controller

* updated path for temp controller

* updated for local file ref

* update lock for local dep

* updated dep

* disable cache

* updated dep

* updated dep

* added stub for getTokenListState

* removed cache comments

* removed console.log

* updated spacing

* update token list get and added todo

* added undefined check

* updated the logic for contractMap:wq

* updated logic for token list

* updated getTokensList

* updated lock file

* cache commented on bitrise

* updated yarn

* added resolutions for pbkdf

* updated package

* added resolutions

* updated controllers and engine code

* updated snapshots

* refactor conditional

* Remove hard coded upper limit to gas limit (#2884)

* updated controller version

* updated yarn lock

Co-authored-by: andrepimenta <andrepimenta7@gmail.com>
Co-authored-by: Pedro Pablo Aste Kompen <wachunei@gmail.com>
Co-authored-by: Dan J Miller <danjm.com@gmail.com>
Co-authored-by: ricky <ricky.miller@gmail.com>

* RC - v2.6.0

* RC v2.6.0 - yarn lock update & version code bump (#2888)

* fixed yarn lock file, deleted local contrller, updated package

* updated lock

* updated lock

* version code bump

* Remove broken optional native dependency (#2882)

All native dependencies that fail to compile when installing have been
removed from the project.

The only remaining example of this was a transitive dependency of
`dnode`, which was an unused direct dependency. It has been removed. It
was not imported anywhere, but it was referenced as a variable name in
one unused module. This module has also been removed.

* Fix prop type warning (#2821)

* fix prop type warning

* update snapshot

* RC 2.6.0 - SWAPS fix (#2900)

* added optional to pop call and bumped version code

* trigger rc 2.6.0 build

* remove RC build trigger

* moved changelogs

Co-authored-by: ricky <ricky.miller@gmail.com>
Co-authored-by: Andre Pimenta <andrepimenta7@gmail.com>
Co-authored-by: Esteban Mino <efmino@uc.cl>
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Pedro Pablo Aste Kompen <wachunei@gmail.com>
Co-authored-by: Alex Donesky <alex.donesky@consensys.net>
Co-authored-by: Brennan <Mark.Brennan@lionbridge.com>
Co-authored-by: !corpitSVCUFC <!corpitSVCUFC@corpnet.liox.org>
Co-authored-by: Cal Leung <cleun007@gmail.com>
Co-authored-by: Dan J Miller <danjm.com@gmail.com>
Co-authored-by: Mark Stacey <markjstacey@gmail.com>
  • Loading branch information
12 people committed Aug 5, 2021
1 parent 1aadb84 commit dcbc45e
Show file tree
Hide file tree
Showing 219 changed files with 12,304 additions and 9,527 deletions.
5 changes: 5 additions & 0 deletions .eslintrc.js
Expand Up @@ -20,6 +20,11 @@ module.exports = {
waitFor: true,
__DEV__: true
},
settings: {
'import/resolver': {
typescript: {} // this loads <rootdir>/tsconfig.json to eslint
}
},
rules: {
'no-catch-shadow': 0,
'no-console': ['warn', { allow: ['warn', 'error'] }],
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,12 @@
# Changelog

## v.2.6.0 - July 9 2021
- [#2865](https://github.com/MetaMask/metamask-mobile/pull/2865): Added support for custom network gas estimates
- [#2854](https://github.com/MetaMask/metamask-mobile/pull/2854): Fix time formatting on transactions
- [#2883](https://github.com/MetaMask/metamask-mobile/pull/2883): Swaps: Fix isZero undefined error
- [#2731](https://github.com/MetaMask/metamask-mobile/pull/2731): Improvement/react navigation upgrade 5
- [#2709](https://github.com/MetaMask/metamask-mobile/pull/2709): Remove Picker deprecation warning

## v.2.5.0 - June 15 2021
- [#2809](https://github.com/MetaMask/metamask-mobile/pull/2809): Optional chaining dollarBalance
- [#2776](https://github.com/MetaMask/metamask-mobile/pull/2776): Fix: empty state when using fiat on non-mainnet transactions
Expand Down
4 changes: 2 additions & 2 deletions android/app/build.gradle
Expand Up @@ -166,8 +166,8 @@ android {
applicationId "io.metamask"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 750
versionName "2.5.0"
versionCode 755
versionName "2.6.0"
multiDexEnabled true
testBuildType System.getProperty('testBuildType', 'debug')
missingDimensionStrategy "minReactNative", "minReactNative46"
Expand Down
6 changes: 3 additions & 3 deletions app/components/Nav/App/__snapshots__/index.test.js.snap
@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`App should render correctly 1`] = `
<NavigationContainer
theme="light"
/>
<ForwardRef(NavigationContainer)>
<Navigator />
</ForwardRef(NavigationContainer)>
`;
181 changes: 82 additions & 99 deletions app/components/Nav/App/index.js
@@ -1,8 +1,10 @@
import React, { PureComponent } from 'react';
import { createAppContainer, createSwitchNavigator, NavigationActions } from 'react-navigation';
import Branch from 'react-native-branch';
import { NavigationContainer, CommonActions } from '@react-navigation/native';
import { createSwitchNavigator } from '@react-navigation/compat';
import { createStackNavigator } from '@react-navigation/stack';
import { createDrawerNavigator } from '@react-navigation/drawer';

import { createStackNavigator } from 'react-navigation-stack';
import { createDrawerNavigator } from 'react-navigation-drawer';
import Login from '../../Views/Login';
import QRScanner from '../../Views/QRScanner';
import Onboarding from '../../Views/Onboarding';
Expand All @@ -22,121 +24,100 @@ import Main from '../Main';
import DrawerView from '../../UI/DrawerView';
import OptinMetrics from '../../UI/OptinMetrics';
import SimpleWebview from '../../Views/SimpleWebview';
import DrawerStatusTracker from '../../../core/DrawerStatusTracker';

//import DrawerStatusTracker from '../../../core/DrawerStatusTracker';
import SharedDeeplinkManager from '../../../core/DeeplinkManager';
import Engine from '../../../core/Engine';
import Logger from '../../../util/Logger';
import Branch from 'react-native-branch';
import AppConstants from '../../../core/AppConstants';
import Logger from '../../../util/Logger';
import { trackErrorAsAnalytics } from '../../../util/analyticsV2';

const Stack = createStackNavigator();
const Drawer = createDrawerNavigator();
/**
* Stack navigator responsible for the onboarding process
* Create Wallet, Import from Seed and Sync
*/
const OnboardingNav = createStackNavigator(
{
Onboarding: {
screen: Onboarding
},
OnboardingCarousel: {
screen: OnboardingCarousel
},
CreateWallet: {
screen: CreateWallet
},
ChoosePassword: {
screen: ChoosePassword
},
AccountBackupStep1: {
screen: AccountBackupStep1
},
AccountBackupStep1B: {
screen: AccountBackupStep1B
},
ManualBackupStep1: {
screen: ManualBackupStep1
},
ManualBackupStep2: {
screen: ManualBackupStep2
},
ManualBackupStep3: {
screen: ManualBackupStep3
},
ImportFromSeed: {
screen: ImportFromSeed
},
OptinMetrics: {
screen: OptinMetrics
}
},
{
initialRouteName: 'OnboardingCarousel'
}
const OnboardingNav = () => (
<Stack.Navigator initialRouteName="OnboardingCarousel">
<Stack.Screen name="Onboarding" component={Onboarding} options={Onboarding.navigationOptions} />
<Stack.Screen
name="OnboardingCarousel"
component={OnboardingCarousel}
options={OnboardingCarousel.navigationOptions}
/>
<Stack.Screen name="CreateWallet" component={CreateWallet} options={CreateWallet.navigationOptions} />
<Stack.Screen name="ChoosePassword" component={ChoosePassword} options={ChoosePassword.navigationOptions} />
<Stack.Screen
name="AccountBackupStep1"
component={AccountBackupStep1}
options={AccountBackupStep1.navigationOptions}
/>
<Stack.Screen
name="AccountBackupStep1B"
component={AccountBackupStep1B}
options={AccountBackupStep1B.navigationOptions}
/>
<Stack.Screen
name="ManualBackupStep1"
component={ManualBackupStep1}
options={ManualBackupStep1.navigationOptions}
/>
<Stack.Screen
name="ManualBackupStep2"
component={ManualBackupStep2}
options={ManualBackupStep2.navigationOptions}
/>
<Stack.Screen
name="ManualBackupStep3"
component={ManualBackupStep3}
options={ManualBackupStep3.navigationOptions}
/>
<Stack.Screen name="ImportFromSeed" component={ImportFromSeed} options={ImportFromSeed.navigationOptions} />
<Stack.Screen name="OptinMetrics" component={OptinMetrics} options={OptinMetrics.navigationOptions} />
</Stack.Navigator>
);

/**
* Parent Stack navigator that allows the
* child OnboardingNav navigator to push modals on top of it
*/
const OnboardingRootNav = createStackNavigator(
{
OnboardingNav: {
screen: OnboardingNav,
navigationOptions: {
header: null
}
},
SyncWithExtensionSuccess: {
screen: SyncWithExtensionSuccess
},
QRScanner: {
screen: QRScanner,
navigationOptions: {
header: null
}
},
Webview: {
screen: createStackNavigator(
{
SimpleWebview: {
screen: SimpleWebview
}
},
{
mode: 'modal'
}
),
navigationOptions: {
header: null
}
}
},
{
mode: 'modal'
}
const SimpleWebviewScreen = () => (
<Stack.Navigator mode={'modal'}>
<Stack.Screen name="SimpleWebview" component={SimpleWebview} options={SimpleWebview.navigationOptions} />
</Stack.Navigator>
);

const OnboardingRootNav = () => (
<Stack.Navigator mode="modal" screenOptions={{ headerShown: false }}>
<Stack.Screen name="OnboardingNav" component={OnboardingNav} />
<Stack.Screen name="SyncWithExtensionSuccess" component={SyncWithExtensionSuccess} />
<Stack.Screen name="QRScanner" component={QRScanner} header={null} />
<Stack.Screen name="Webview" header={null} component={SimpleWebviewScreen} />
</Stack.Navigator>
);

/**
* Main app navigator which handles all the screens
* after the user is already onboarded
*/
const HomeNav = createDrawerNavigator(
{
Main: {
screen: Main
}
},
{
contentComponent: DrawerView,
drawerWidth: 315,
overlayColor: 'rgba(0, 0, 0, 0.5)'
}

const HomeNav = () => (
<Drawer.Navigator
drawerContent={props => <DrawerView {...props} />}
// eslint-disable-next-line
drawerStyle={{
backgroundColor: 'rgba(0, 0, 0, 0.5)',
width: 315
}}
>
<Drawer.Screen name="Main" component={Main} />
</Drawer.Navigator>
);

// Is this necessary?
/**
* Drawer status tracking
*/
const defaultGetStateForAction = HomeNav.router.getStateForAction;
DrawerStatusTracker.init();
HomeNav.router.getStateForAction = (action, state) => {
Expand All @@ -150,11 +131,13 @@ HomeNav.router.getStateForAction = (action, state) => {
return defaultGetStateForAction(action, state);
};
*/

/**
* Top level switch navigator which decides
* which top level view to show
*/

const AppNavigator = createSwitchNavigator(
{
Entry,
Expand All @@ -169,15 +152,13 @@ const AppNavigator = createSwitchNavigator(
}
);

const AppContainer = createAppContainer(AppNavigator);

class App extends PureComponent {
unsubscribeFromBranch;

componentDidMount = () => {
SharedDeeplinkManager.init({
navigate: (routeName, opts) => {
this.navigator.dispatch(NavigationActions.navigate({ routeName, params: opts }));
navigate: (name, opts) => {
this.navigator.dispatch(CommonActions.navigate({ name, params: opts }));
}
});
if (!this.unsubscribeFromBranch) {
Expand Down Expand Up @@ -213,11 +194,13 @@ class App extends PureComponent {

render() {
return (
<AppContainer
<NavigationContainer
ref={nav => {
this.navigator = nav;
}}
/>
>
<AppNavigator />
</NavigationContainer>
);
}
}
Expand Down

0 comments on commit dcbc45e

Please sign in to comment.