Skip to content

Commit

Permalink
vault history page
Browse files Browse the repository at this point in the history
  • Loading branch information
tyleroooo committed Sep 26, 2024
1 parent 7f49616 commit 91584aa
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/constants/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export enum PortfolioRoute {
export enum HistoryRoute {
Trades = 'trades',
Transfers = 'transfers',
VaultTransfers = 'vault-transfers',
Payments = 'payments',
}

Expand Down
6 changes: 6 additions & 0 deletions src/pages/portfolio/History.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ export const History = () => {
href: HistoryRoute.Transfers,
tag: 'USDC',
},
{
value: HistoryRoute.VaultTransfers,
label: <h3>MegaVault Transfers</h3>,
href: HistoryRoute.VaultTransfers,
tag: 'USDC',
},
// TODO - TRCL-1693 -
// {
// value: HistoryRoute.Payments,
Expand Down
5 changes: 5 additions & 0 deletions src/pages/portfolio/Portfolio.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import { openDialog } from '@/state/dialogs';

import { shortenNumberForDisplay } from '@/lib/numbers';

import { VaultTransactionsTable } from '../vaults/VaultTransactions';
import { PortfolioNavMobile } from './PortfolioNavMobile';

const Overview = lazy(() => import('./Overview').then((module) => ({ default: module.Overview })));
Expand Down Expand Up @@ -114,6 +115,10 @@ const PortfolioPage = () => {
/>
}
/>
<Route
path={HistoryRoute.VaultTransfers}
element={<VaultTransactionsTable withOuterBorders />}
/>
{/* TODO - TRCL-1693
<Route
path={HistoryRoute.Payments}
Expand Down
5 changes: 5 additions & 0 deletions src/pages/portfolio/PortfolioNavMobile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ export const PortfolioNavMobile = () => {
label: stringGetter({ key: STRING_KEYS.TRANSFERS }),
description: stringGetter({ key: STRING_KEYS.TRANSFERS_DESCRIPTION }),
},
{
value: `${AppRoute.Portfolio}/${PortfolioRoute.History}/${HistoryRoute.VaultTransfers}`,
label: 'Vault Transfers',
description: 'Transfers to and from the MegaVault',
},
// TODO: TRCL-1693 - re-enable when Payments are ready
// {
// value: `${AppRoute.Portfolio}/${PortfolioRoute.History}/${HistoryRoute.Payments}`,
Expand Down
10 changes: 8 additions & 2 deletions src/pages/vaults/VaultTransactions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,13 @@ export const VaultTransactionsCard = ({ className }: { className?: string }) =>
);
};
const $ShowHideHistoryButton = styled(Button)``;
const VaultTransactionsTable = ({ className }: { className?: string }) => {
export const VaultTransactionsTable = ({
className,
withOuterBorders,
}: {
className?: string;
withOuterBorders?: boolean;
}) => {
const stringGetter = useStringGetter();
const transactions = useLoadedVaultAccountTransfers() ?? EMPTY_ARR;

Expand Down Expand Up @@ -117,7 +123,7 @@ const VaultTransactionsTable = ({ className }: { className?: string }) => {
}}
columns={columns}
className={className}
withOuterBorder={transactions.length === 0}
withOuterBorder={transactions.length === 0 || withOuterBorders}
/>
);
};
Expand Down

0 comments on commit 91584aa

Please sign in to comment.