Skip to content

Commit

Permalink
Merge pull request from GHSA-vfh4-cj95-8jv6
Browse files Browse the repository at this point in the history
* upgraded to react-native-webview 11.13.0 and applied the patches from 11.0.2

* added imports to patch file

* updated logics for when a url is updated on the browser view

* updated webview patch to removed injected code android studio added during debugging

* enable the dispaly of a port number if entered on url

* updated webview patch with latest keyboard updates

* Collectibles enhancements (#2735)

* resizemode

* margintop

* transparent

* emptystate

* snaps

* backgroundColor

* snaps

* update snapshot

* fix typo

Co-authored-by: sethkfman <seth.kaufman@consensys.net>
Co-authored-by: Ibrahim Taveras <ibrahimtaveras@ibrahims-mbp.myfiosgateway.com>

* Release/3.0.1 patch (#2976)

* bumped version

* updated changelog

* updated formatting

* trigger patch build

* removed build trigger

* bugfix: issue #2763 (#2808)

* Remove extra top padding on send flow (#2907)

* Replace safe area view for send flow. Wrap send flow input focus in interaction block.

* Replace focus with optional chaining

* Update snapshot tests

* Remove redundant safe area view on Send component

* On-Ramp: Add on-ramp analytics (#2973)

* Add on-ramp analytics

* Add anonymized pairs

* Add more anonymized pairs

* Add fiatAmountInUsd for transak orders

* Move constants to app/constants

* Fix header layout. (#2980)

* Merge pull request from GHSA-3pg9-fvh4-99rr

* Fix address bar icon (#2893)

* Fix check if icon is empty

* Use boolean

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

* Remove cache pull

* added exclusion to yarn audit and upgraded url-parse module

* disable caching on ci

* updated yarn.lock and bitrise flow

* added caching back into bitrise build

Co-authored-by: Pedro Pablo Aste Kompen <wachunei@gmail.com>
Co-authored-by: ricky <ricky.miller@gmail.com>
Co-authored-by: sethkfman <seth.kaufman@consensys.net>
Co-authored-by: sethkfman <10342624+sethkfman@users.noreply.github.com>

* Feature/video subtitles (#2813)

* 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

* merge develop and trouble shoot subtitles

* 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>

* using updated to exo player for android video

* bumped version and updated changelog

* refactored subtitle uri and implemenation

* Update subtitles-en.vtt

removed formatting

* moved videos into secretPhrase folder

* udpated uri

* update uri

* Optional chaining dollarBalance (#2809)

* bumped version and updated changelog

* moved files into folder

* removed duplcate changelog

* updated comments

* removed duplicate swaps section

* removed debug param

* refactored video and subtitle location

* updated broken link

* updated fetching of subtitles for video

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

* Branch updates (#2804)

* handleDeeplinks

* bumpbranch

* pods

* functional

* notused

* handleDeeplinks

* handleDeeplink

* mock

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

* Fix: Add TransakWebview mediaPlayback props for KYC (#2996)

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

* [FIX] GH Action Permission for Bump-Version (#2961)

* updated permissions for gh action

* test bump action

* test bump action

* bump controllers to v14.0.2 (#2952)

* [EIP1559] Improve time estimates (#2955)

* Improve eip1559 time estimates

* Add extendOptions to EditGasFee Components

* Update test

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

* updated permission and add improvements to slack notification

* removed test workflow

* removed before_run not needed in e2e

* updated bump version script to bump version code everything we push to main or develop

* removed types didn't apply in push

Co-authored-by: ricky <ricky.miller@gmail.com>
Co-authored-by: Andre Pimenta <andrepimenta7@gmail.com>
Co-authored-by: Pedro Pablo Aste Kompen <wachunei@gmail.com>

* upgrade walletconnect (#2956)

* [FIX] Account for `txParams.data` when we sync (#2999)

* Account for txParams.data when we sync

* Remove "Bummer!" wording

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

* Fix/ci release update (#3004)

* removed release build trigger

* updated GH action tigger on pull requests not pushes

* [FEATURE] - Storage Limit - Reduce Txs Being Stored (#2972)

* added controller test tarball and updated path

* added DefaultPreference to save OPT_IN METRICS data

* added react native default prefs to pod

* added view on chain footer to list view, dis-allow list for onboarding and analytics in store

* updated yarn.lock file

* updated copy on footer

* updated tarball for latest controller PR

* yarn.lock update

* disable cache

* enable cache

* added migration for new values being stored in default preferences

* trigger test build

* [FIX] Account for `txParams.data` when we sync (#2999)

* Account for txParams.data when we sync

* Remove "Bummer!" wording

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

* Fix/ci release update (#3004)

* removed release build trigger

* updated GH action tigger on pull requests not pushes

* updated to v14.2.0 controllers

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

* Revert "Collectibles enhancements (#2735)" (#3005)

This reverts commit 93c1296.

* v3.1.0 RC (#3009)

* updated changelog for 3.1.0

* Bump version name

* version bumped

* updated changelog

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

* RC 3.0.1 - Downgrade Android SDK Version (#3010)

* downgraded SDK version

* bump version

* uncomment release build steps and disable slack notification that needs logic update to work outside of PR release flow

* fix deep links bug related to branch updates (#3017)

* [FIX] Delete Message (#2981)

* fix(DeleteMessage): uUse word 'delete' for all languages

* update delete to be translation variable

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

* remove tarball (#3024)

* fix eddit button (#3026)

* RC 3.1.0 (v3) (#3025)

* release(3.1.0 v3): Pump version number

* release(3.1.0 v3): Update changelog

* release(3.1.0 v3): Delete merge message

* release(3.1.0 v3): Update title

* release(3.1.0 v3): Update changelog

* release(3.1.0 v3): Add deleted title

* release(3.1.0 v3): Delete duplicates

* release(3.1.0 v3): Update changelog

* fix(CHANGELOG): Title (#3027)

* Make decelerationRate normal (#3006)

Co-authored-by: yulodl <yulodl@gmail.com>

* do not translate logic strings (#3031)

* tidy util dir based on discussions (#3030)

* [FIX] Uni V3 NFT animated SVG crash

* Switched to sslip.io instead of xip.io (#2718)

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

* Bump multihashes from 0.4.14 to 4.0.2 (#2527)

Bumps [multihashes](https://github.com/multiformats/js-multihash) from 0.4.14 to 4.0.2.
- [Release notes](https://github.com/multiformats/js-multihash/releases)
- [Changelog](https://github.com/multiformats/js-multihash/blob/master/CHANGELOG.md)
- [Commits](multiformats/js-multihash@v0.4.14...v4.0.2)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Andre Pimenta <andrepimenta7@gmail.com>

* increase the heap size to help mitigate the out of memory issue (#3038)

* [FIX] Video Subtitles Not Loading Properly (#3029)

* updated scope of variables to reflect currently selected language

* reverted podfile.lock changes

* [2783] Change default account name for ENS reversed-resolved name (#2878)

* Fix token transfer to address (#3046)

* v3.2.0 RC (#3044)

* Swaps V2 Integration (#3013)

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

* Bump minor version

* Update changelog

* Reset changelog

* Update changelog

* updated changelog

* updated changelog

* updated changelog

* updated changelog

* format changelogs

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

* Revert multihashes (#3054)

* release(3.2.0): Pump verion number (#3056)

* Remove SwapsLiveness checks for non supported networks (#3057)

* [FEATURE] Update Recents (#3028)

render recents based on items stored in redux instead of from transactions

* remove circle ci badge (#3060)

* Enable Slack Notification on Successful Build (#3055)

* create a bitrise test slack step

* updated slack script

* update import

* updated e2e scripts to include minSDK being set to 26

* revert build.sh changes

* updated request import

* switched to non-depricated package

* updated bitrise build dep

* test

* test

* Slack Message Test

* removed bitrise test triggers & remove test text from slack message

* slack test

* added test trigger

* updated bitrise format

* update require

* removed test text and triggers

* Create general issue template (#3015)

* Bump redux-persist from 5.10.0 to 6.0.0 (#2526)

Bumps [redux-persist](https://github.com/rt2zz/redux-persist) from 5.10.0 to 6.0.0.
- [Release notes](https://github.com/rt2zz/redux-persist/releases)
- [Changelog](https://github.com/rt2zz/redux-persist/blob/master/CHANGELOG.md)
- [Commits](rt2zz/redux-persist@v5.10.0...v6.0.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Andre Pimenta <andrepimenta7@gmail.com>

* Bump regenerator-runtime from 0.13.1 to 0.13.9 (#2931)

Bumps [regenerator-runtime](https://github.com/facebook/regenerator) from 0.13.1 to 0.13.9.
- [Release notes](https://github.com/facebook/regenerator/releases)
- [Commits](https://github.com/facebook/regenerator/compare/regenerator-runtime@0.13.1...regenerator-runtime@0.13.9)

---
updated-dependencies:
- dependency-name: regenerator-runtime
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: sethkfman <10342624+sethkfman@users.noreply.github.com>
Co-authored-by: Andre Pimenta <andrepimenta7@gmail.com>

* Bump @react-native-community/cookies from 4.0.1 to 5.0.1 (#3069)

Bumps [@react-native-community/cookies](https://github.com/react-native-community/cookies) from 4.0.1 to 5.0.1.
- [Release notes](https://github.com/react-native-community/cookies/releases)
- [Changelog](https://github.com/react-native-cookies/cookies/blob/master/.releaserc)
- [Commits](react-native-cookies/cookies@v4.0.1...v5.0.1)

---
updated-dependencies:
- dependency-name: "@react-native-community/cookies"
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Update custom token copy (#3080)

* Make Engine .ts (#3072)

Make Engine TypeScript and leverage our Transaction Type from controllers

* fix issues 2100 (#3081)

* fix issues 2100

       /**
	 * fix bug: #2100
	 * 
	 * reason: redux-persist load storage data by 'getItem' API with a timeout (5 seconds default) when app ’cold start',
	 * on some old devices, I/O is slow and 'readfile' operation may take long time Occasionally, when this happened, timeout
	 * will lead to redux-persist rehydrate state with undefined and an Error(https://github.com/rt2zz/redux-persist/blob/master/src/persistReducer.js#89).
	 * 
	 * solution: the easy way to fix is to set a big timeout on config, Go further, we could save 'keyring' etc some important
	 * data to separate files or backup for this. the second way is not complicated, we could set
	 * serialize and deserialize to false to get JSON object and modify setItem/getItem API to save/load data.
	 */

* remove comment

* Use Logger

Co-authored-by: sethkfman <10342624+sethkfman@users.noreply.github.com>
Co-authored-by: Ricky Miller <ricky.miller@gmail.com>

* Bump @react-navigation/compat from 5.3.15 to 5.3.20 (#3068)

Bumps [@react-navigation/compat](https://github.com/react-navigation/react-navigation/tree/HEAD/packages/compat) from 5.3.15 to 5.3.20.
- [Release notes](https://github.com/react-navigation/react-navigation/releases)
- [Changelog](https://github.com/react-navigation/react-navigation/blob/@react-navigation/compat@5.3.20/packages/compat/CHANGELOG.md)
- [Commits](https://github.com/react-navigation/react-navigation/commits/@react-navigation/compat@5.3.20/packages/compat)

---
updated-dependencies:
- dependency-name: "@react-navigation/compat"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: sethkfman <10342624+sethkfman@users.noreply.github.com>

* Integrate changes from controllers v15.0.2 (#3071)

* ignored tokens updates

* add migration

* cleanup

* bump @metamask/controllers to 15.0.2

* Add support for wallet_switchEthereumChain (#3023)

* Add support for wallet_switchEthereumChain

* updated method name

* Update app/core/RPCMethods/wallet_switchEthereumChain.js

Optimized params logic

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

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

* Feature/improve warning eth sign (#2852)

* remove duplicate swap translations

* updated eth_sign warning

* added styling to warning message to allow different severity of warning

* updated prop name

* updated line height for alert text

* updated line spacing per design feedback

* updated snapshot

* removed translations that were not needed

* updated snapshot

* Bump eth-url-parser from 1.0.2 to 1.0.4 (#3084)

Bumps [eth-url-parser](https://github.com/brunobar79/eth-url-parser) from 1.0.2 to 1.0.4.
- [Release notes](https://github.com/brunobar79/eth-url-parser/releases)
- [Commits](brunobar79/eth-url-parser@v1.0.2...v1.0.4)

---
updated-dependencies:
- dependency-name: eth-url-parser
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: sethkfman <10342624+sethkfman@users.noreply.github.com>

* Add typescript eslint from metamask (#3088)

* Add typescript eslint from metamask

* address new lints

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

* [FIX] Handle token icon remote resource

* Catch undefined navigate on buy eth (#3100)

* [FIX] Bug in token balance

* updated eth signing warning copy (#3103)

* Improvement/upgrade redux and tests (#3066)

* Begin converting tests to TS

* Upgrade redux. Update tests to TS and clean up.

* Remove unused line

* Leave react-redux 5.1.1 for testing purposes

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

* [FEATURE] Add browser analytics

* [FIX] Fix undefined values in CustomGas component (#2977)

* Remove CustomGas component

* Removing custom gas breaks action sheet layout. Temporarily add View tag to fix this for now.

* Check lint status

* Prettify Approve view

* Remove unused warningGasPriceHigh

* update snapshot

* completely remove CustomGas

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

* Merge pull request from GHSA-rc56-6qmj-qg85

* Patch react-native & react-native-webview to remove learning from Android keyboards

* Initialize Android text input with BaseInputConnection

* Opt out of safe browsing

* Update bitrise.yml with NDK steps

* Fix bitrise.yml. Remove ds store diffs.

* Update README.md with NDK instructions

* chore: update swaps-controller and send clientId on fetchSwapsFeatureLiveness (#3101)

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

* upgraded to react-native-webview 11.13.0 and applied the patches from 11.0.2

* Collectibles enhancements (#2735)

* resizemode

* margintop

* transparent

* emptystate

* snaps

* backgroundColor

* snaps

* update snapshot

* fix typo

Co-authored-by: sethkfman <seth.kaufman@consensys.net>
Co-authored-by: Ibrahim Taveras <ibrahimtaveras@ibrahims-mbp.myfiosgateway.com>

* Improvement/upgrade redux and tests (#3066)

* Begin converting tests to TS

* Upgrade redux. Update tests to TS and clean up.

* Remove unused line

* Leave react-redux 5.1.1 for testing purposes

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

* rebase with MM develop

* Improvement/upgrade redux and tests (#3066)

* Begin converting tests to TS

* Upgrade redux. Update tests to TS and clean up.

* Remove unused line

* Leave react-redux 5.1.1 for testing purposes

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

Co-authored-by: Esteban Miño <efmino@uc.cl>
Co-authored-by: Ibrahim Taveras <ibrahimtaveras@ibrahims-mbp.myfiosgateway.com>
Co-authored-by: Cal Leung <cleun007@gmail.com>
Co-authored-by: Pedro Pablo Aste Kompen <wachunei@gmail.com>
Co-authored-by: Andre Pimenta <andrepimenta7@gmail.com>
Co-authored-by: ricky <ricky.miller@gmail.com>
Co-authored-by: Brennan <Mark.Brennan@lionbridge.com>
Co-authored-by: !corpitSVCUFC <!corpitSVCUFC@corpnet.liox.org>
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Gustavo Antunes <gantunes@uc.cl>
Co-authored-by: yulodl <yulodl@gmail.com>
Co-authored-by: Javonne Martin <javonne.martin@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Matthew Epps <mepps32@gmail.com>
Co-authored-by: liangwu <liangwu.cas@gmail.com>
Co-authored-by: Alex Donesky <adonesky@gmail.com>
  • Loading branch information
17 people committed Sep 9, 2021
1 parent e3e03f9 commit 4a5127e
Show file tree
Hide file tree
Showing 15 changed files with 214 additions and 120 deletions.
49 changes: 31 additions & 18 deletions app/components/UI/CollectibleContracts/index.js
Expand Up @@ -3,14 +3,15 @@ import PropTypes from 'prop-types';
import { TouchableOpacity, StyleSheet, View, InteractionManager, Image } from 'react-native';
import { connect } from 'react-redux';
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
import { colors, fontStyles } from '../../../styles/common';
import { baseStyles, colors, fontStyles } from '../../../styles/common';
import { strings } from '../../../../locales/i18n';
import CollectibleContractElement from '../CollectibleContractElement';
import Analytics from '../../../core/Analytics';
import { ANALYTICS_EVENT_OPTS } from '../../../util/analytics';
import { favoritesCollectiblesObjectSelector } from '../../../reducers/collectibles';
import Text from '../../Base/Text';
import AppConstants from '../../../core/AppConstants';
import StyledButton from '../StyledButton';
import { toLowerCaseEquals } from '../../../util/general';

const styles = StyleSheet.create({
Expand Down Expand Up @@ -42,6 +43,7 @@ const styles = StyleSheet.create({
emptyContainer: {
flex: 1,
marginBottom: 42,
marginHorizontal: 56,
justifyContent: 'center',
alignItems: 'center',
},
Expand Down Expand Up @@ -72,20 +74,23 @@ const CollectibleContracts = ({ collectibleContracts, collectibles, navigation,
[navigation]
);

const goToAddCollectible = () => {
const goToAddCollectible = useCallback(() => {
navigation.push('AddAsset', { assetType: 'collectible' });
InteractionManager.runAfterInteractions(() => {
Analytics.trackEvent(ANALYTICS_EVENT_OPTS.WALLET_ADD_COLLECTIBLES);
});
};
}, [navigation]);

const renderFooter = () => (
<View style={styles.footer} key={'collectible-contracts-footer'}>
<TouchableOpacity style={styles.add} onPress={goToAddCollectible} testID={'add-collectible-button'}>
<Icon name="plus" size={16} color={colors.blue} />
<Text style={styles.addText}>{strings('wallet.add_collectibles')}</Text>
</TouchableOpacity>
</View>
const renderFooter = useCallback(
() => (
<View style={styles.footer} key={'collectible-contracts-footer'}>
<TouchableOpacity style={styles.add} onPress={goToAddCollectible} testID={'add-collectible-button'}>
<Icon name="plus" size={16} color={colors.blue} />
<Text style={styles.addText}>{strings('wallet.add_collectibles')}</Text>
</TouchableOpacity>
</View>
),
[goToAddCollectible]
);

const renderCollectibleContract = useCallback(
Expand Down Expand Up @@ -130,9 +135,10 @@ const CollectibleContracts = ({ collectibleContracts, collectibles, navigation,
<View>
{renderFavoriteCollectibles()}
<View>{collectibleContracts?.map((item, index) => renderCollectibleContract(item, index))}</View>
{renderFooter()}
</View>
),
[collectibleContracts, renderFavoriteCollectibles, renderCollectibleContract]
[collectibleContracts, renderFavoriteCollectibles, renderCollectibleContract, renderFooter]
);

const goToLearnMore = () =>
Expand All @@ -146,23 +152,30 @@ const CollectibleContracts = ({ collectibleContracts, collectibles, navigation,
source={require('../../../images/no-nfts-placeholder.png')}
resizeMode={'contain'}
/>
<Text center style={styles.emptyTitleText} bold>
{strings('wallet.no_nfts_yet')}
<Text center style={[styles.emptyTitleText, styles.emptySectionText]}>
{strings('wallet.no_nfts_to_show')}
</Text>

<Text center style={[styles.emptyText, styles.emptySectionText]}>
{strings('wallet.no_collectibles')}
</Text>
<Text center big link onPress={goToLearnMore}>
<StyledButton
type={'blue'}
onPress={goToAddCollectible}
containerStyle={[baseStyles.flexGrow, styles.emptySectionText]}
>
{strings('wallet.manually_import_nfts')}
</StyledButton>
<Text center big link style={styles.emptySectionText} onPress={goToLearnMore}>
{strings('wallet.learn_more')}
</Text>
</View>
<Text big style={styles.emptyText}>
{strings('wallet.no_collectibles')}
</Text>
</View>
);

return (
<View style={styles.wrapper} testID={'collectible-contracts'}>
{collectibles.length ? renderList() : renderEmpty()}
{renderFooter()}
</View>
);
};
Expand Down
2 changes: 1 addition & 1 deletion app/components/UI/CollectibleMedia/index.js
Expand Up @@ -71,7 +71,7 @@ export default function CollectibleMedia({ collectible, renderAnimation, style,
}, [collectible, small, big, setSourceUri, setIsUniV3NFT]);

const renderMedia = useCallback(() => {
if (renderAnimation && collectible.animation && collectible.animation.includes('.mp4')) {
if (renderAnimation && collectible.animation?.includes('.mp4')) {
return (
<MediaPlayer
onClose={onClose}
Expand Down
1 change: 1 addition & 0 deletions app/components/UI/CollectibleModal/index.js
Expand Up @@ -90,6 +90,7 @@ const CollectibleModal = (props) => {
onClose={() => modalRef.current.dismissModal()}
cover
renderAnimation
resizeMode={'contain'}
collectible={collectible}
style={styles.round}
/>
Expand Down
Expand Up @@ -37,7 +37,7 @@ exports[`Collectibles should render correctly 1`] = `
}
}
>
Don’t see your NFT?
Your NFTs will show up here. If you don’t see your NFT, try importing manually.
</Text>
</View>
</ScrollView>
Expand Down
38 changes: 38 additions & 0 deletions app/components/UI/CustomGas/__snapshots__/index.test.tsx.snap
@@ -0,0 +1,38 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`CustomGas should render correctly 1`] = `
<CustomGas
accounts={
Object {
"0x": "0x",
}
}
basicGasEstimates={
Object {
"averageGwei": 10,
"fastGwei": 10,
"safeLowGwei": 10,
}
}
chainId="1"
conversionRate={0.1}
currentCurrency="usd"
dispatch={[Function]}
gas={"0"}
gasPrice={"0"}
generateTransform={[MockFunction]}
route={
Object {
"params": Object {},
}
}
ticker="ETH"
transaction={
Object {
"from": "0x",
"value": 100,
}
}
warningGasPriceHigh=""
/>
`;
56 changes: 56 additions & 0 deletions app/components/UI/CustomGas/index.test.tsx
@@ -0,0 +1,56 @@
jest.useFakeTimers();

import React from 'react';
import CustomGas from './';
import configureMockStore from 'redux-mock-store';
import { shallow } from 'enzyme';
import { BN } from 'ethereumjs-util';
import { Provider } from 'react-redux';

const generateTransform = jest.fn();
const mockStore = configureMockStore();
const initialState = {
engine: {
backgroundState: {
CurrencyRateController: {
currentCurrency: 'usd',
conversionRate: 0.1
},
AccountTrackerController: {
accounts: {
'0x': '0x'
}
},
NetworkController: {
provider: {
ticker: 'ETH',
chainId: '1'
}
}
}
},
transaction: {
from: '0x',
value: 100
},
customGasPriceBN: 10
};
const store = mockStore(initialState);

describe('CustomGas', () => {
it('should render correctly', () => {
const wrapper = shallow(
<Provider store={store}>
<CustomGas
route={{ params: {} }}
basicGasEstimates={{ averageGwei: 10, fastGwei: 10, safeLowGwei: 10 }}
generateTransform={generateTransform}
gas={new BN(0)}
gasPrice={new BN(0)}
warningGasPriceHigh=""
/>
</Provider>
);
expect(wrapper.dive()).toMatchSnapshot();
});
});
11 changes: 6 additions & 5 deletions app/components/UI/Navbar/index.js
Expand Up @@ -410,7 +410,7 @@ export function getSendFlowTitle(title, navigation, route) {
*/
export function getBrowserViewNavbarOptions(navigation, route) {
const url = route.params?.url ?? '';
let hostname = null;
let host = null;
let isHttps = false;

const isHomepage = (url) => getHost(url) === getHost(HOMEPAGE_URL);
Expand All @@ -420,15 +420,16 @@ export function getBrowserViewNavbarOptions(navigation, route) {
if (url && !isHomepage(url)) {
isHttps = url && url.toLowerCase().substr(0, 6) === 'https:';
const urlObj = new URL(url);
hostname = urlObj.hostname.toLowerCase().replace(/^www\./, '');
//Using host so the port number will be displayed on the address bar
host = urlObj.host.toLowerCase().replace(/^www\./, '');
if (isGatewayUrl(urlObj) && url.search(`${AppConstants.IPFS_OVERRIDE_PARAM}=false`) === -1) {
const ensUrl = route.params?.currentEnsName ?? '';
if (ensUrl) {
hostname = ensUrl.toLowerCase().replace(/^www\./, '');
host = ensUrl.toLowerCase().replace(/^www\./, '');
}
}
} else {
hostname = strings('browser.title');
host = strings('browser.title');
}

function onPress() {
Expand All @@ -455,7 +456,7 @@ export function getBrowserViewNavbarOptions(navigation, route) {
navigation={navigation}
route={route}
url={url}
hostname={hostname}
hostname={host}
https={isHttps}
/>
),
Expand Down
13 changes: 10 additions & 3 deletions app/components/Views/BrowserTab/index.js
Expand Up @@ -291,7 +291,6 @@ export const BrowserTab = (props) => {
url = url.replace(replace(key), `https://${sessionENSNames[key].hostname}/`);
}
}

return url;
};

Expand Down Expand Up @@ -1267,13 +1266,15 @@ export const BrowserTab = (props) => {
*/
const onLoadStart = async ({ nativeEvent }) => {
const { hostname } = new URL(nativeEvent.url);

if (!isAllowedUrl(hostname)) {
return handleNotAllowedUrl(nativeEvent.url);
}
webviewUrlPostMessagePromiseResolve.current = null;
setError(false);
changeUrl(nativeEvent, 'start');

//For Android url on the navigation bar should only update upon load.
if (Device.isAndroid()) changeUrl(nativeEvent, 'start');

icon.current = null;
if (isHomepage()) {
injectHomePageScripts();
Expand All @@ -1292,6 +1293,11 @@ export const BrowserTab = (props) => {
setProgress(progress);
};

const onLoad = ({ nativeEvent }) => {
//For iOS url on the navigation bar should only update upon load.
if (Device.isIos()) changeUrl(nativeEvent, 'start');
};

/**
* When website finished loading
*/
Expand Down Expand Up @@ -1897,6 +1903,7 @@ export const BrowserTab = (props) => {
injectedJavaScriptBeforeContentLoaded={entryScriptWeb3}
style={styles.webview}
onLoadStart={onLoadStart}
onLoad={onLoad}
onLoadEnd={onLoadEnd}
onLoadProgress={onLoadProgress}
onMessage={onMessage}
Expand Down
2 changes: 1 addition & 1 deletion app/core/AppConstants.js
Expand Up @@ -73,7 +73,7 @@ export default {
TERMS_AND_CONDITIONS: 'https://consensys.net/terms-of-use/',
PRIVACY_POLICY: 'https://consensys.net/privacy-policy/',
CONNECTIVITY_ISSUES: 'https://metamask.zendesk.com/hc/en-us/articles/360059386712',
NFT: 'https://metamask.zendesk.com/hc/en-us/articles/360058238591-NFT-tokens-in-MetaMask-wallet',
NFT: 'https://metamask.zendesk.com/hc/en-us/articles/360058240151-How-to-interact-with-NFTs-OpenSea-and-Rarible',
},
ERRORS: {
INFURA_BLOCKED_MESSAGE: 'EthQuery - RPC Error - This service is not available in your country',
Expand Down
Binary file modified app/images/no-nfts-placeholder.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 5 additions & 5 deletions ios/Podfile.lock
Expand Up @@ -278,8 +278,8 @@ PODS:
- React-Core
- react-native-camera/RN (3.44.3):
- React-Core
- react-native-cookies (4.0.1):
- React
- react-native-cookies (5.0.1):
- React-Core
- react-native-netinfo (6.0.0):
- React-Core
- react-native-randombytes (3.6.1):
Expand All @@ -297,7 +297,7 @@ PODS:
- React
- react-native-viewpager (3.3.1):
- React
- react-native-webview (11.0.2):
- react-native-webview (11.13.0):
- React-Core
- React-RCTActionSheet (0.63.4):
- React-Core/RCTActionSheetHeaders (= 0.63.4)
Expand Down Expand Up @@ -693,15 +693,15 @@ SPEC CHECKSUMS:
react-native-blur: cad4d93b364f91e7b7931b3fa935455487e5c33c
react-native-branch: be13c92d6fa4e9b0904d65f6ea910905c8f074bd
react-native-camera: b8cc03e2feec0c04403d0998e37cf519d8fd4c6f
react-native-cookies: ff2e6865dff2e5feeca8f1ed082ae7898e4fa912
react-native-cookies: ce50e42ace7cf0dd47769260ca5bbe8eee607e4e
react-native-netinfo: e849fc21ca2f4128a5726c801a82fc6f4a6db50d
react-native-randombytes: 421f1c7d48c0af8dbcd471b0324393ebf8fe7846
react-native-safe-area-context: f0906bf8bc9835ac9a9d3f97e8bde2a997d8da79
react-native-splash-screen: 200d11d188e2e78cea3ad319964f6142b6384865
react-native-video: 0bb76b6d6b77da3009611586c7dbf817b947f30e
react-native-view-shot: 4475fde003fe8a210053d1f98fb9e06c1d834e1c
react-native-viewpager: f730c1d175a2c1ae789464855d4a2c14247d3109
react-native-webview: dfd7202ff115c44d3ea401c2f36122fb3ac79f07
react-native-webview: 133a6a5149f963259646e710b4545c67ef35d7c9
React-RCTActionSheet: 89a0ca9f4a06c1f93c26067af074ccdce0f40336
React-RCTAnimation: 1bde3ecc0c104c55df246eda516e0deb03c4e49b
React-RCTBlob: a97d378b527740cc667e03ebfa183a75231ab0f0
Expand Down
5 changes: 3 additions & 2 deletions locales/languages/en.json
Expand Up @@ -274,12 +274,13 @@
"collectible": "Collectible",
"collectibles": "NFTs",
"transactions": "TRANSACTIONS",
"no_collectibles": "Don’t see your NFT?",
"no_collectibles": "Your NFTs will show up here. If you don’t see your NFT, try importing manually.",
"add_tokens": "ADD TOKENS",
"no_tokens": "You don't have any tokens!",
"no_nfts_yet": "No NFTs yet",
"no_nfts_to_show": "No NFTs to show",
"learn_more": "Learn more",
"add_collectibles": "ADD NFTs",
"manually_import_nfts": "Import manually",
"no_transactions": "You have no transactions!",
"send_button": "Send",
"deposit_button": "Deposit",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -201,7 +201,7 @@
"react-native-vector-icons": "6.4.2",
"react-native-video": "^5.1.1",
"react-native-view-shot": "^3.1.2",
"react-native-webview": "^11.0.2",
"react-native-webview": "^11.13.0",
"react-redux": "7.2.4",
"readable-stream": "1.0.33",
"redux": "4.1.1",
Expand Down

0 comments on commit 4a5127e

Please sign in to comment.