Skip to content

Commit

Permalink
Merge branch 'develop' into @derek/nav
Browse files Browse the repository at this point in the history
  • Loading branch information
dereknelson committed Oct 13, 2023
2 parents 03e2573 + 488acd7 commit 5fc22bd
Show file tree
Hide file tree
Showing 90 changed files with 10,367 additions and 2,042 deletions.
36 changes: 22 additions & 14 deletions e2e/deeplinks.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,18 +88,18 @@ describe('Deeplinks spec', () => {
await Helpers.tapAlertWithButton('OK');
});

it.skip('should show the Profile Sheet for rainbow.me universal links with ENS names', async () => {
it('should show the Profile Sheet for rainbow.me universal links with ENS names', async () => {
await Helpers.openDeeplinkFromBackground(
'https://rainbow.me/rainbowwallet.eth'
'https://rainbow.me/profile/rainbowwallet.eth'
);
await Helpers.checkIfVisible('profile-sheet', 30000);
await Helpers.checkIfElementByTextIsVisible('rainbowwallet.eth', 30000);
await Helpers.swipe('profile-sheet', 'down');
});

it.skip('should show the Profile Sheet for rainbow.me universal links with 0x addresses', async () => {
it('should show the Profile Sheet for rainbow.me universal links with 0x addresses', async () => {
await Helpers.openDeeplinkFromBackground(
'https://rainbow.me/0xE46aBAf75cFbFF815c0b7FfeD6F02B0760eA27f1'
'https://rainbow.me/profile/0xE46aBAf75cFbFF815c0b7FfeD6F02B0760eA27f1'
);
await Helpers.checkIfVisible('profile-sheet', 30000);
await Helpers.checkIfElementByTextIsVisible(
Expand All @@ -109,38 +109,46 @@ describe('Deeplinks spec', () => {
await Helpers.swipe('profile-sheet', 'down');
});

it.skip('should be able to handle ethereum payments urls for ETH (mainnet)', async () => {
it('should be able to handle ethereum payments urls for ETH (mainnet)', async () => {
const url = escapeUrl('ethereum:payment-brunobarbieri.eth@1?value=1e2');
await testEthereumDeeplink(url, false);
});

it.skip('should be able to handle ethereum payments urls for ETH (optimism)', async () => {
it('should be able to handle ethereum payments urls for ETH (optimism)', async () => {
const url = escapeUrl('ethereum:payment-brunobarbieri.eth@10?value=1e15');
await testEthereumDeeplink(url, false);
});

it.skip('should be able to handle ethereum payments urls for DAI (mainnet)', async () => {
// FIXME: when doing open deeplinks with cold start, the account assets state
// comes back empty, find a fix and then change these tests to cold-start again
it('should be able to handle ethereum payments urls for DAI (mainnet)', async () => {
const url = escapeUrl(
'ethereum:0x6b175474e89094c44da98b954eedeac495271d0f@1/transfer?address=brunobarbieri.eth&uint256=1e18'
);
await testEthereumDeeplink(url);
await testEthereumDeeplink(url, false);
});

it.skip('should be able to handle ethereum payments urls for ETH (arbitrum)', async () => {
// FIXME: when doing open deeplinks with cold start, the account assets state
// comes back empty, find a fix and then change these tests to cold-start again
it('should be able to handle ethereum payments urls for ETH (arbitrum)', async () => {
const url = 'ethereum:payment-brunobarbieri.eth@42161?value=1e15';
await testEthereumDeeplink(url);
await testEthereumDeeplink(url, false);
});

it.skip('should be able to handle ethereum payments urls for DAI (optimism)', async () => {
// FIXME: when doing open deeplinks with cold start, the account assets state
// comes back empty, find a fix and then change these tests to cold-start again
it('should be able to handle ethereum payments urls for DAI (optimism)', async () => {
const url = escapeUrl(
'ethereum:0xda10009cbd5d07dd0cecc66161fc93d7c9000da1@10/transfer?address=brunobarbieri.eth&uint256=1e15'
);
await testEthereumDeeplink(url);
await testEthereumDeeplink(url, false);
});

it.skip('should be able to handle ethereum payments urls for MATIC (polygon)', async () => {
// FIXME: when doing open deeplinks with cold start, the account assets state
// comes back empty, find a fix and then change these tests to cold-start again
it('should be able to handle ethereum payments urls for MATIC (polygon)', async () => {
const url = escapeUrl('ethereum:payment-brunobarbieri.eth@137?value=1e15');
await testEthereumDeeplink(url);
await testEthereumDeeplink(url, false);
});

afterAll(async () => {
Expand Down
1 change: 1 addition & 0 deletions e2e/watchedWalletCollectionActionsFlow.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ describe('Watched showcase and hidden actions flow', () => {
);
await Helpers.waitAndTap('import-sheet-button');
await Helpers.waitAndTap('wallet-info-submit-button');
await Helpers.checkIfVisible('wallet-screen', 80000);
});

it('opens NFT', async () => {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@
"@react-navigation/material-top-tabs": "6.6.2",
"@react-navigation/native": "6.1.6",
"@react-navigation/stack": "6.3.16",
"@reservoir0x/reservoir-sdk": "1.2.1",
"@reservoir0x/reservoir-sdk": "1.4.5",
"@segment/analytics-react-native": "2.15.0",
"@segment/sovran-react-native": "1.0.4",
"@sentry/react-native": "3.4.1",
Expand Down
7 changes: 2 additions & 5 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ import {
persistOptions,
queryClient,
} from './react-query';
import { additionalDataUpdateL2AssetBalance } from './redux/additionalAssetsData';
import store from './redux/store';
import { uniswapPairsInit } from './redux/uniswap';
import { walletConnectLoadState } from './redux/walletconnect';
Expand All @@ -85,7 +84,7 @@ import { migrate } from '@/migrations';
import { initListeners as initWalletConnectListeners } from '@/walletConnect';
import { saveFCMToken } from '@/notifications/tokens';
import branch from 'react-native-branch';
import { initializeReservoirClient } from '@/resources/nftOffers/utils';
import { initializeReservoirClient } from '@/resources/reservoir/client';

if (__DEV__) {
reactNativeDisableYellowBox && LogBox.ignoreAllLogs();
Expand Down Expand Up @@ -243,9 +242,7 @@ class OldApp extends Component {
setTimeout(() => {
logger.debug('Reloading balances for network', network);
if (isL2) {
if (tx.internalType === TransactionType.trade) {
store.dispatch(additionalDataUpdateL2AssetBalance(tx));
} else if (tx.internalType !== TransactionType.authorize) {
if (tx.internalType !== TransactionType.authorize) {
// for swaps, we don't want to trigger update balances on unlock txs
queryClient.invalidateQueries({
queryKey: userAssetsQueryKey({
Expand Down
39 changes: 39 additions & 0 deletions src/analytics/event.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { CardType } from '@/components/cards/GenericCard';
import { LearnCategory } from '@/components/cards/utils/types';
import { FiatProviderName } from '@/entities/f2c';
import { Network } from '@/networks/types';

/**
* All events, used by `analytics.track()`
Expand Down Expand Up @@ -81,6 +82,7 @@ export const event = {
poapsOpenedMintSheet: 'Opened POAP mint sheet',
poapsMintedPoap: 'Minted POAP',
poapsViewedOnPoap: 'Viewed POAP on poap.gallery',

positionsOpenedSheet: 'Opened position Sheet',
positionsOpenedExternalDapp: 'Viewed external dapp',

Expand All @@ -89,6 +91,12 @@ export const event = {
mintsPressedMintButton: 'Pressed mint button in mints sheet',
mintsPressedViewAllMintsButton: 'Pressed view all mints button in mints card',
mintsChangedFilter: 'Changed mints filter',

mintsOpenedSheet: 'Opened NFT Mint Sheet',
mintsOpeningMintDotFun: 'Opening Mintdotfun',
mintsMintingNFT: 'Minting NFT',
mintsMintedNFT: 'Minted NFT',
mintsErrorMintingNFT: 'Error Minting NFT',
} as const;

/**
Expand Down Expand Up @@ -292,6 +300,37 @@ export type EventProperties = {
rainbowFee: number;
offerCurrency: { symbol: string; contractAddress: string };
};
[event.mintsMintingNFT]: {
contract: string;
chainId: number;
quantity: number;
collectionName: string;
priceInEth: string;
};
[event.mintsMintedNFT]: {
contract: string;
chainId: number;
quantity: number;
collectionName: string;
priceInEth: string;
};
[event.mintsErrorMintingNFT]: {
contract: string;
chainId: number;
quantity: number;
collectionName: string;
priceInEth: string;
};
[event.mintsOpenedSheet]: {
contract: string;
chainId: number;
collectionName: string;
};
[event.mintsOpeningMintDotFun]: {
contract: string;
chainId: number;
collectionName: string;
};
[event.poapsMintedPoap]: {
eventId: number;
type: 'qrHash' | 'secretWord';
Expand Down
2 changes: 2 additions & 0 deletions src/analytics/userProperties.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import { NativeCurrencyKey } from '@/entities';
import { Language } from '@/languages';

// these are all reported seperately so they must be optional
export interface UserProperties {
// settings
currentAddressHash?: string; // NEW
currency?: NativeCurrencyKey;
language?: Language;
enabledTestnets?: boolean;
enabledFlashbots?: boolean;
pinnedCoins?: string[];
Expand Down
15 changes: 10 additions & 5 deletions src/components/L2Disclaimer.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { padding, position } from '@/styles';
import { darkModeThemeColors } from '@/styles/colors';
import { ethereumUtils } from '@/utils';
import { getNetworkObj } from '@/networks';
import * as lang from '@/languages';

const L2Disclaimer = ({
assetType,
Expand All @@ -22,9 +23,8 @@ const L2Disclaimer = ({
marginHorizontal = 19,
onPress,
prominent,
sending,
customText,
symbol,
verb,
forceDarkMode,
}) => {
const localColors = isNft ? darkModeThemeColors : colors;
Expand Down Expand Up @@ -80,9 +80,14 @@ const L2Disclaimer = ({
size="smedium"
weight={prominent ? 'heavy' : 'bold'}
>
{verb ? verb : sending ? `Sending` : `This ${symbol} is`} on the{' '}
{getNetworkObj(ethereumUtils.getNetworkFromType(assetType)).name}{' '}
network
{customText
? customText
: lang.t(lang.l.expanded_state.asset.l2_disclaimer, {
symbol,
network: getNetworkObj(
ethereumUtils.getNetworkFromType(assetType)
).name,
})}
</Text>
</Column>
<Column align="end" justify="center">
Expand Down
1 change: 1 addition & 0 deletions src/components/buttons/rainbow-button/RainbowButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ const ButtonLabel = styled(Text).attrs(
type === RainbowButtonTypes.addCash ? 'roundedTight' : 'rounded',
size: type === RainbowButtonTypes.small ? 'large' : 'larger',
weight: type === RainbowButtonTypes.small ? 'bold' : 'heavy',
numberOfLines: 1,
})
)({});

Expand Down
42 changes: 23 additions & 19 deletions src/components/cards/FeaturedMintCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
useColorMode,
useForegroundColor,
} from '@/design-system';
import React, { useEffect, useState } from 'react';
import React, { useCallback, useEffect, useState } from 'react';
import { ButtonPressAnimation } from '../animations';
import { useMints } from '@/resources/mints';
import { useAccountProfile, useDimensions } from '@/hooks';
Expand All @@ -24,11 +24,13 @@ import {
convertRawAmountToRoundedDecimal,
} from '@/helpers/utilities';
import { BlurView } from '@react-native-community/blur';
import { Linking, View } from 'react-native';
import { View } from 'react-native';
import { IS_IOS } from '@/env';
import { Media } from '../Media';
import { analyticsV2 } from '@/analytics';
import * as i18n from '@/languages';
import { navigateToMintCollection } from '@/resources/reservoir/mints';
import { ethereumUtils } from '@/utils';

const IMAGE_SIZE = 111;

Expand Down Expand Up @@ -71,6 +73,24 @@ export function FeaturedMintCard() {

useEffect(() => setMediaRendered(false), [imageUrl]);

const handlePress = useCallback(() => {
if (featuredMint) {
analyticsV2.track(analyticsV2.event.mintsPressedFeaturedMintCard, {
contractAddress: featuredMint.contractAddress,
chainId: featuredMint.chainId,
totalMints: featuredMint.totalMints,
mintsLastHour: featuredMint.totalMints,
priceInEth: convertRawAmountToRoundedDecimal(
featuredMint.mintStatus.price,
18,
6
),
});
const network = ethereumUtils.getNetworkFromChainId(featuredMint.chainId);
navigateToMintCollection(featuredMint.contract, network);
}
}, [featuredMint]);

return featuredMint ? (
<ColorModeProvider value="darkTinted">
<AccentColorProvider color={accentColor ?? labelSecondary}>
Expand Down Expand Up @@ -108,23 +128,7 @@ export function FeaturedMintCard() {
overflow: 'hidden',
padding: 12,
}}
onPress={() => {
analyticsV2.track(
analyticsV2.event.mintsPressedFeaturedMintCard,
{
contractAddress: featuredMint.contractAddress,
chainId: featuredMint.chainId,
totalMints: featuredMint.totalMints,
mintsLastHour: featuredMint.totalMints,
priceInEth: convertRawAmountToRoundedDecimal(
featuredMint.mintStatus.price,
18,
6
),
}
);
Linking.openURL(featuredMint.externalURL);
}}
onPress={handlePress}
scaleTo={0.96}
>
<Cover>
Expand Down
18 changes: 11 additions & 7 deletions src/components/cards/LearnCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,16 @@ export const LearnCard = ({ cardDetails, rotate, type }: LearnCardProps) => {
{type === 'square' ? (
<Box height="full" justifyContent="space-between">
<Inline alignHorizontal="justify">
<Text
size="13pt"
weight="heavy"
color={{ custom: primaryTextColor }}
>
{`􀫸 ${i18n.t(translations.learn).toUpperCase()}`}
</Text>
<Box style={{ maxWidth: 80 }}>
<Text
size="13pt"
weight="heavy"
color={{ custom: primaryTextColor }}
numberOfLines={1}
>
{`􀫸 ${i18n.t(translations.learn).toUpperCase()}`}
</Text>
</Box>
<IconOrb color={orbColorLight} icon={emoji} />
</Inline>
<Stack space="10px">
Expand All @@ -83,6 +86,7 @@ export const LearnCard = ({ cardDetails, rotate, type }: LearnCardProps) => {
color={{ custom: primaryTextColor }}
size="17pt"
weight="heavy"
numberOfLines={2}
>
{i18n.t(translations.cards[key].title)}
</Text>
Expand Down
Loading

0 comments on commit 5fc22bd

Please sign in to comment.