Skip to content

Commit

Permalink
re-enable for e2e
Browse files Browse the repository at this point in the history
  • Loading branch information
walmat committed Sep 4, 2024
1 parent cda585f commit 1ce06a4
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export function NFTEmptyState() {
data: { featuredMint },
} = useMints({ walletAddress: accountAddress });

const nftsEnabled = useExperimentalFlag(NFTS_ENABLED) || nfts_enabled;
const nftsEnabled = (useExperimentalFlag(NFTS_ENABLED) || nfts_enabled) && !IS_TEST;
const mintsEnabled = (useExperimentalFlag(MINTS) || mints_enabled) && !IS_TEST;

if (!nftsEnabled) return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { opacity } from '@/__swaps__/utils/swaps';
import { deviceUtils } from '@/utils';
import { NFTS_ENABLED, useExperimentalFlag } from '@/config';
import { useRemoteConfig } from '@/model/remoteConfig';
import { IS_TEST } from '@/env';

export const TokenFamilyHeaderHeight = 50;

Expand Down Expand Up @@ -48,7 +49,7 @@ const NFTItem = () => {

const NFTLoadingSkeleton = ({ items = 5 }) => {
const { nfts_enabled } = useRemoteConfig();
const nftsEnabled = useExperimentalFlag(NFTS_ENABLED) || nfts_enabled;
const nftsEnabled = (useExperimentalFlag(NFTS_ENABLED) || nfts_enabled) && !IS_TEST;

if (!nftsEnabled) return null;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { NftCollectionSortCriterion } from '@/graphql/__generated__/arc';
import useNftSort from '@/hooks/useNFTsSortBy';
import { useRemoteConfig } from '@/model/remoteConfig';
import { NFTS_ENABLED, useExperimentalFlag } from '@/config';
import { IS_TEST } from '@/env';

const TokenFamilyHeaderHeight = 48;

Expand Down Expand Up @@ -33,7 +34,7 @@ const getMenuItemIcon = (value: NftCollectionSortCriterion) => {

const CollectiblesHeader = () => {
const { nfts_enabled } = useRemoteConfig();
const nftsEnabled = useExperimentalFlag(NFTS_ENABLED) || nfts_enabled;
const nftsEnabled = (useExperimentalFlag(NFTS_ENABLED) || nfts_enabled) && !IS_TEST;
const { nftSort, updateNFTSort } = useNftSort();

if (!nftsEnabled) return null;
Expand Down
3 changes: 2 additions & 1 deletion src/components/asset-list/RecyclerAssetList2/WrappedNFT.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { useNavigation } from '@/navigation';
import Routes from '@/navigation/routesNames';
import { useRemoteConfig } from '@/model/remoteConfig';
import { NFTS_ENABLED, useExperimentalFlag } from '@/config';
import { IS_TEST } from '@/env';

export default React.memo(function WrappedNFT({
onPress,
Expand All @@ -24,7 +25,7 @@ export default React.memo(function WrappedNFT({
externalAddress?: string;
}) {
const { nfts_enabled } = useRemoteConfig();
const nftsEnabled = useExperimentalFlag(NFTS_ENABLED) || nfts_enabled;
const nftsEnabled = (useExperimentalFlag(NFTS_ENABLED) || nfts_enabled) && !IS_TEST;

const assetCollectible = useCollectible(uniqueId, externalAddress);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { useLatestCallback, useOpenFamilies } from '@/hooks';
import { ThemeContextProps } from '@/theme';
import { useRemoteConfig } from '@/model/remoteConfig';
import { NFTS_ENABLED, useExperimentalFlag } from '@/config';
import { IS_TEST } from '@/env';

type Props = {
name: string;
Expand All @@ -15,7 +16,7 @@ type Props = {

export default React.memo(function WrappedTokenFamilyHeader({ name, total, image, theme, testID }: Props) {
const { nfts_enabled } = useRemoteConfig();
const nftsEnabled = useExperimentalFlag(NFTS_ENABLED) || nfts_enabled;
const nftsEnabled = (useExperimentalFlag(NFTS_ENABLED) || nfts_enabled) && !IS_TEST;

const { openFamilies, updateOpenFamilies } = useOpenFamilies();
const isFamilyOpen = openFamilies[name];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { getRemoteConfig, RainbowConfig } from '@/model/remoteConfig';
import { NFTS_ENABLED, REMOTE_CARDS, useExperimentalFlag } from '@/config';
import { useContext } from 'react';
import { RainbowContextType } from '@/helpers/RainbowContext';
import { IS_TEST } from '@/env';

const getStyleOverridesForIndex = (indices: number[]) => (index: number) => {
if (indices.includes(index)) {
Expand Down Expand Up @@ -34,8 +35,6 @@ class BetterLayoutProvider extends LayoutProvider {
}
}

// briefSectionsData: BaseCellType[], isCoinListEdited: boolean, cardIds: string[], isReadOnlyWallet: boolean

const getLayoutProvider = ({
briefSectionsData,
isCoinListEdited,
Expand All @@ -51,8 +50,8 @@ const getLayoutProvider = ({
experimentalConfig: ReturnType<typeof useContext<RainbowContextType>>['config'];
remoteConfig: RainbowConfig;
}) => {
const remoteCardsEnabled = remoteConfig.remote_cards_enabled || experimentalConfig[REMOTE_CARDS];
const nftsEnabled = remoteConfig.nfts_enabled || experimentalConfig[NFTS_ENABLED];
const remoteCardsEnabled = (remoteConfig.remote_cards_enabled || experimentalConfig[REMOTE_CARDS]) && !IS_TEST;
const nftsEnabled = (remoteConfig.nfts_enabled || experimentalConfig[NFTS_ENABLED]) && !IS_TEST;

const indicesToOverride = [];
for (let i = 0; i < briefSectionsData.length; i++) {
Expand Down

0 comments on commit 1ce06a4

Please sign in to comment.