Skip to content

Commit

Permalink
Revert "Collectibles enhancements (#2735)" (#3139)
Browse files Browse the repository at this point in the history
This reverts commit 93c1296.
  • Loading branch information
Cal-L authored Sep 16, 2021
1 parent 2dd900a commit a653f78
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 40 deletions.
49 changes: 18 additions & 31 deletions app/components/UI/CollectibleContracts/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,14 @@ 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 { baseStyles, colors, fontStyles } from '../../../styles/common';
import { 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 @@ -43,7 +42,6 @@ const styles = StyleSheet.create({
emptyContainer: {
flex: 1,
marginBottom: 42,
marginHorizontal: 56,
justifyContent: 'center',
alignItems: 'center',
},
Expand Down Expand Up @@ -74,23 +72,20 @@ const CollectibleContracts = ({ collectibleContracts, collectibles, navigation,
[navigation]
);

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

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

const goToLearnMore = () =>
Expand All @@ -152,30 +146,23 @@ const CollectibleContracts = ({ collectibleContracts, collectibles, navigation,
source={require('../../../images/no-nfts-placeholder.png')}
resizeMode={'contain'}
/>
<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 center style={styles.emptyTitleText} bold>
{strings('wallet.no_nfts_yet')}
</Text>
<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}>
<Text center big link 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
Original file line number Diff line number Diff line change
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?.includes('.mp4')) {
if (renderAnimation && collectible.animation && collectible.animation.includes('.mp4')) {
return (
<MediaPlayer
onClose={onClose}
Expand Down
1 change: 0 additions & 1 deletion app/components/UI/CollectibleModal/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ const CollectibleModal = (props) => {
onClose={() => modalRef.current.dismissModal()}
cover
renderAnimation
resizeMode={'contain'}
collectible={collectible}
style={styles.round}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ exports[`Collectibles should render correctly 1`] = `
}
}
>
Your NFTs will show up here. If you don’t see your NFT, try importing manually.
Don’t see your NFT?
</Text>
</View>
</ScrollView>
Expand Down
2 changes: 1 addition & 1 deletion app/core/AppConstants.js
Original file line number Diff line number Diff line change
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/360058240151-How-to-interact-with-NFTs-OpenSea-and-Rarible',
NFT: 'https://metamask.zendesk.com/hc/en-us/articles/360058238591-NFT-tokens-in-MetaMask-wallet',
},
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,7 @@ SPEC CHECKSUMS:
boost-for-react-native: 39c7adb57c4e60d6c5479dd8623128eb5b3f0f2c
Branch: 6a281514287f99d707615ac62c2cca69e0213df0
CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99
DoubleConversion: cde416483dac037923206447da6e1454df403714
DoubleConversion: 5805e889d232975c086db112ece9ed034df7a0b2
FBLazyVector: 3bb422f41b18121b71783a905c10e58606f7dc3e
FBReactNativeSpec: f2c97f2529dd79c083355182cc158c9f98f4bd6e
Flipper: 1bd2db48dcc31e4b167b9a33ec1df01c2ded4893
Expand All @@ -672,7 +672,7 @@ SPEC CHECKSUMS:
Flipper-RSocket: 127954abe8b162fcaf68d2134d34dc2bd7076154
FlipperKit: 651f50a42eb95c01b3e89a60996dd6aded529eeb
Folly: b73c3869541e86821df3c387eb0af5f65addfab4
glog: 40a13f7840415b9a77023fbcae0f1e6f43192af3
glog: 1f3da668190260b06b429bb211bfbee5cd790c28
libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913
lottie-ios: a50d5c0160425cd4b01b852bb9578963e6d92d31
lottie-react-native: 7ca15c46249b61e3f9ffcf114cb4123e907a2156
Expand Down
5 changes: 2 additions & 3 deletions locales/languages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -274,13 +274,12 @@
"collectible": "Collectible",
"collectibles": "NFTs",
"transactions": "TRANSACTIONS",
"no_collectibles": "Your NFTs will show up here. If you don’t see your NFT, try importing manually.",
"no_collectibles": "Don’t see your NFT?",
"add_tokens": "ADD TOKENS",
"no_tokens": "You don't have any tokens!",
"no_nfts_to_show": "No NFTs to show",
"no_nfts_yet": "No NFTs yet",
"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

0 comments on commit a653f78

Please sign in to comment.