Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove non-Favorites lists #5084

Merged
merged 11 commits into from
Oct 14, 2023
Merged
35 changes: 0 additions & 35 deletions e2e/discoverSheetFlow.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,17 +85,6 @@ describe('Discover Screen Flow', () => {
await Helpers.checkIfVisible('chart-header-Unisocks');
});

it('Should add Unisocks to Watchlist & remove from Favorites', async () => {
await Helpers.waitAndTap('add-to-list-button');
await Helpers.checkIfVisible('add-token-sheet');
await Helpers.waitAndTap('add-to-watchlist');
await Helpers.checkIfVisible('remove-from-watchlist');
await Helpers.waitAndTap('remove-from-favorites');
await Helpers.checkIfNotVisible('remove-from-favorites');

await Helpers.waitAndTap('close-action-button');
});

it('Should close expanded state and return to search', async () => {
if (ios) {
// RNBW-4035
Expand Down Expand Up @@ -169,30 +158,6 @@ describe('Discover Screen Flow', () => {
await Helpers.checkIfVisible('discover-header');
});

// TODO: seems the test doesn't do sideswipe on the horizonal list
// skipping the test till someone fixes it, apparently it's low
// priority right now
it.skip('Should cycle through token lists', async () => {
android && (await Helpers.swipe('discover-sheet', 'up', 'slow'));
await Helpers.swipeUntilVisible(
'lists-section',
'discover-sheet',
'up',
100
);
await Helpers.checkIfVisible('lists-section-favorites');
await Helpers.checkIfNotVisible('list-coin-row-Unisocks');
await Helpers.waitAndTap('list-watchlist');
await Helpers.checkIfVisible('lists-section-watchlist');
await Helpers.checkIfVisible('list-coin-row-Unisocks');
await Helpers.waitAndTap('list-trending');
await Helpers.checkIfVisible('lists-section-trending');
await Helpers.waitAndTap('list-defi');
await Helpers.checkIfVisible('lists-section-defi');
await Helpers.waitAndTap('list-stablecoins');
await Helpers.checkIfVisible('lists-section-stablecoins');
});

afterAll(async () => {
// Reset the app state
await device.clearKeychain();
Expand Down
7 changes: 0 additions & 7 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ import {
queryClient,
} from './react-query';
import store from './redux/store';
import { uniswapPairsInit } from './redux/uniswap';
import { walletConnectLoadState } from './redux/walletconnect';
import { rainbowTokenList } from './references';
import { userAssetsQueryKey } from '@/resources/assets/UserAssetsQuery';
Expand Down Expand Up @@ -151,7 +150,6 @@ class OldApp extends Component {
this?.handleAppStateChange
);
this.setState({ eventSubscription: eventSub });
rainbowTokenList.on('update', this.handleTokenListUpdate);
appEvents.on('transactionConfirmed', this.handleTransactionConfirmed);

await this.setupDeeplinking();
Expand Down Expand Up @@ -191,7 +189,6 @@ class OldApp extends Component {

componentWillUnmount() {
this.state.eventSubscription.remove();
rainbowTokenList.off('update', this.handleTokenListUpdate);
this.branchListener();
}

Expand All @@ -202,10 +199,6 @@ class OldApp extends Component {
PerformanceContextMap.set('initialRoute', initialRoute);
};

async handleTokenListUpdate() {
store.dispatch(uniswapPairsInit());
}

handleAppStateChange = async nextAppState => {
// Restore WC connectors when going from BG => FG
if (this.state.appState === 'background' && nextAppState === 'active') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,11 @@ export function FavStar({ toggleFavorite, favorite, theme }: FavStarProps) {
interface InfoProps {
contextMenuProps: any;
showFavoriteButton: boolean;
showAddButton: boolean;
theme: any;
}

export function Info({
contextMenuProps,
showAddButton,
showFavoriteButton,
theme,
}: InfoProps) {
Expand All @@ -85,7 +83,7 @@ export function Info({
<ContextMenuButton
onPressMenuItem={contextMenuProps.handlePressMenuItem}
{...contextMenuProps}
style={(showFavoriteButton || showAddButton) && sx.info}
style={showFavoriteButton && sx.info}
>
<ButtonPressAnimation>
<SafeRadialGradient
Expand Down Expand Up @@ -113,14 +111,12 @@ export default React.memo(function FastCurrencySelectionRow({
uniqueId,
showBalance,
showFavoriteButton,
showAddButton,
onPress,
theme,
nativeCurrency,
nativeCurrencySymbol,
favorite,
toggleFavorite,
onAddPress,
contextMenuProps,
symbol,
address,
Expand All @@ -139,7 +135,6 @@ export default React.memo(function FastCurrencySelectionRow({
const rowTestID = `${testID}-exchange-coin-row-${
symbol ?? item?.symbol ?? ''
}-${type || 'token'}`;

const isInfoButtonVisible =
!item?.isNativeAsset ||
(!isNativeAsset(address ?? item?.address, network) && !showBalance);
Expand Down Expand Up @@ -226,7 +221,6 @@ export default React.memo(function FastCurrencySelectionRow({
{isInfoButtonVisible && (
<Info
contextMenuProps={contextMenuProps}
showAddButton={showAddButton}
showFavoriteButton={showFavoriteButton}
theme={theme}
/>
Expand Down Expand Up @@ -264,26 +258,6 @@ export default React.memo(function FastCurrencySelectionRow({
toggleFavorite={toggleFavorite}
/>
))}
{showAddButton && (
<ButtonPressAnimation onPress={onAddPress}>
<SafeRadialGradient
center={[0, 15]}
colors={colors.gradients.lightestGrey}
style={[sx.gradient, sx.addGradient]}
>
<RNText
style={[
sx.addText,
{
color: colors.alpha(colors.blueGreyDark, 0.3),
},
]}
>
+
</RNText>
</SafeRadialGradient>
</ButtonPressAnimation>
)}
</View>
)}
</View>
Expand Down
146 changes: 0 additions & 146 deletions src/components/coin-row/ExchangeCoinRow.js

This file was deleted.

1 change: 0 additions & 1 deletion src/components/coin-row/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ export { default as CoinRowDetailsIcon } from './CoinRowDetailsIcon';
export { default as CoinRowFavoriteButton } from './CoinRowFavoriteButton';
export { default as CollectiblesSendRow } from './CollectiblesSendRow';
export { default as ContractInteractionCoinRow } from './ContractInteractionCoinRow';
export { default as ExchangeCoinRow } from './ExchangeCoinRow';
export { default as ListCoinRow } from './ListCoinRow';
export { default as RequestCoinRow } from './RequestCoinRow';
export { default as SendCoinRow } from './SendCoinRow';
Expand Down
1 change: 0 additions & 1 deletion src/components/exchange/CurrencySelectionList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ interface CurrencySelectionListProps {
footerSpacer: boolean;
fromDiscover?: boolean;
itemProps: {
onActionAsset: (asset: any, isFavorited?: any) => void;
onPress: (item: any) => void;
showBalance: boolean;
showFavoriteButton: boolean;
Expand Down
Loading