Skip to content

Commit

Permalink
chore: remove transaction from wallet header (deriv-com#14485)
Browse files Browse the repository at this point in the history
  • Loading branch information
aizad-deriv authored Apr 4, 2024
1 parent 55d8b65 commit 65672fc
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const WalletsCarouselLoader = () => {
<div className='wallets-skeleton wallets-carousel-loader__progress-bar__item' />
</div>
<div className='wallets-carousel-loader__actions'>
{Array.from({ length: 4 }).map((_, idx) => (
{Array.from({ length: 3 }).map((_, idx) => (
<div
className='wallets-skeleton wallets-carousel-loader__actions-button'
key={`wallets-carousel-loader-action-${idx}`}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { useHistory } from 'react-router-dom';
import { useActiveWalletAccount } from '@deriv/api-v2';
import useDevice from '../../hooks/useDevice';
import IcCashierAdd from '../../public/images/ic-cashier-deposit.svg';
import IcCashierStatement from '../../public/images/ic-cashier-statement.svg';
import IcCashierTransfer from '../../public/images/ic-cashier-transfer.svg';
import IcCashierWithdrawal from '../../public/images/ic-cashier-withdrawal.svg';
import { IconButton, WalletButton, WalletText } from '../Base';
Expand All @@ -26,17 +25,12 @@ const getWalletHeaderButtons = (isDemo?: boolean) => {
name: 'transfer',
text: 'Transfer',
},
{
icon: <IcCashierStatement />,
name: 'transactions',
text: 'Transactions',
},
] as const;

// Filter out the "Withdraw" button when is_demo is true
const filteredButtons = isDemo ? buttons.filter(button => button.name !== 'withdraw') : buttons;

const orderForDemo = ['reset-balance', 'transfer', 'transactions'];
const orderForDemo = ['reset-balance', 'transfer'];

const sortedButtons = isDemo
? [...filteredButtons].sort((a, b) => orderForDemo.indexOf(a.name) - orderForDemo.indexOf(b.name))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ describe('WalletListCardActions', () => {
expect(screen.getByText('Deposit')).toBeInTheDocument();
expect(screen.getByText('Withdraw')).toBeInTheDocument();
expect(screen.getByText('Transfer')).toBeInTheDocument();
expect(screen.getByText('Transactions')).toBeInTheDocument();
});

it('should show the actions texts if the demo wallet is active', () => {
Expand All @@ -57,7 +56,6 @@ describe('WalletListCardActions', () => {
render(<WalletListCardActions />, { wrapper });
expect(screen.getByText('Reset balance')).toBeInTheDocument();
expect(screen.getByText('Transfer')).toBeInTheDocument();
expect(screen.getByText('Transactions')).toBeInTheDocument();
});

it("shouldn't show the actions texts if the real wallet is inactive", () => {
Expand All @@ -76,7 +74,6 @@ describe('WalletListCardActions', () => {
expect(screen.queryByText('Deposit')).not.toBeInTheDocument();
expect(screen.queryByText('Withdraw')).not.toBeInTheDocument();
expect(screen.queryByText('Transfer')).not.toBeInTheDocument();
expect(screen.queryByText('Transactions')).not.toBeInTheDocument();
});

it('should switch account and redirect to the correct page when clicking on one of the actions and wallet is inactive', () => {
Expand Down Expand Up @@ -133,12 +130,6 @@ describe('WalletListCardActions', () => {
expect(history.location.pathname).toBe('/wallets/cashier/transfer');
});

it('should redirect to cashier page when clicking on transactions', () => {
render(<WalletListCardActions />, { wrapper });
screen.getByRole('button', { name: 'transactions' }).click();
expect(history.location.pathname).toBe('/wallets/cashier/transactions');
});

it('should redirect to cashier page when clicking on reset balance', () => {
(useActiveWalletAccount as jest.Mock).mockReturnValue({
data: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { WalletListCardBadge } from '../../../../components/WalletListCardBadge'
import useDevice from '../../../../hooks/useDevice';
import CloseIcon from '../../../../public/images/close-icon.svg';
import IcCashierDeposit from '../../../../public/images/ic-cashier-deposit.svg';
import IcCashierStatement from '../../../../public/images/ic-cashier-statement.svg';
import IcCashierTransfer from '../../../../public/images/ic-cashier-transfer.svg';
import IcCashierWithdrawal from '../../../../public/images/ic-cashier-withdrawal.svg';
import ResetBalance from '../../../../public/images/plus-thin.svg';
Expand All @@ -34,11 +33,6 @@ const realAccountTabs = [
path: 'transfer',
text: i18n.t('Transfer'),
},
{
icon: <IcCashierStatement />,
path: 'transactions',
text: i18n.t('Transactions'),
},
] as const;

const virtualAccountTabs = [
Expand All @@ -47,11 +41,6 @@ const virtualAccountTabs = [
path: 'transfer',
text: i18n.t('Transfer'),
},
{
icon: <IcCashierStatement />,
path: 'transactions',
text: i18n.t('Transactions'),
},
{
icon: <ResetBalance />,
path: 'reset-balance',
Expand Down
10 changes: 0 additions & 10 deletions packages/wallets/src/public/images/ic-cashier-statement.svg

This file was deleted.

0 comments on commit 65672fc

Please sign in to comment.