Skip to content

Commit

Permalink
feat(suite): hide nfts to experimental
Browse files Browse the repository at this point in the history
  • Loading branch information
enjojoy committed Dec 11, 2024
1 parent d7787da commit a69d5d1
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { useDispatch, useSelector } from 'src/hooks/suite';
import { goto } from 'src/actions/suite/routerActions';
import { selectSelectedAccount } from 'src/reducers/wallet/selectedAccountReducer';
import { NavigationItem, SubpageNavigation } from 'src/components/suite/layouts/SuiteLayout';

import { selectHasExperimentalFeature } from 'src/reducers/suite/suiteReducer';
export const ACCOUNT_TABS = [
'wallet-index',
'wallet-details',
Expand All @@ -23,7 +23,7 @@ export const AccountNavigation = () => {
const account = useSelector(selectSelectedAccount);
const routerParams = useSelector(state => state.router.params) as WalletParams;
const dispatch = useDispatch();

const enabledNftSection = useSelector(selectHasExperimentalFeature('nft-section'));
const network = getNetworkOptional(routerParams?.symbol);
const networkType = account?.networkType || network?.networkType || '';

Expand Down Expand Up @@ -62,7 +62,7 @@ export const AccountNavigation = () => {
goToWithAnalytics('wallet-nfts', { preserveParams: true });
},
title: <Translation id="TR_NAV_NFTS" />,
isHidden: !hasNetworkFeatures(account, 'nfts'),
isHidden: !hasNetworkFeatures(account, 'nfts') || !enabledNftSection,
activeRoutes: ['wallet-nfts', 'wallet-nfts-hidden'],
'data-testid': '@wallet/menu/wallet-nfts',
},
Expand Down
6 changes: 5 additions & 1 deletion packages/suite/src/constants/suite/experimental.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Route } from '@suite-common/suite-types';

import { Dispatch } from '../../types/suite';

export type ExperimentalFeature = 'password-manager' | 'tor-snowflake';
export type ExperimentalFeature = 'password-manager' | 'tor-snowflake' | 'nft-section';

export type ExperimentalFeatureConfig = {
title: TranslationKey;
Expand Down Expand Up @@ -39,4 +39,8 @@ export const EXPERIMENTAL_FEATURES: Record<ExperimentalFeature, ExperimentalFeat
}
},
},
'nft-section': {
title: 'TR_EXPERIMENTAL_NFT_SECTION',
description: 'TR_EXPERIMENTAL_NFT_SECTION_DESCRIPTION',
},
};
9 changes: 9 additions & 0 deletions packages/suite/src/support/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4996,6 +4996,15 @@ export default defineMessages({
defaultMessage: 'Experimental',
description: 'Section title for Early Access program so far',
},
TR_EXPERIMENTAL_NFT_SECTION: {
id: 'TR_EXPERIMENTAL_NFT_SECTION',
defaultMessage: 'NFT Section',
},
TR_EXPERIMENTAL_NFT_SECTION_DESCRIPTION: {
id: 'TR_EXPERIMENTAL_NFT_SECTION_DESCRIPTION',
defaultMessage:
'Access NFT section in your wallet. Right now available only for EVM based chains.',
},
TR_EXPERIMENTAL_FEATURES_ALLOW: {
id: 'TR_EXPERIMENTAL_FEATURES_ALLOW',
defaultMessage: 'Experimental features',
Expand Down

0 comments on commit a69d5d1

Please sign in to comment.