Skip to content

Commit

Permalink
refactor: activity list deposit status
Browse files Browse the repository at this point in the history
  • Loading branch information
fbwoolf committed Dec 17, 2024
1 parent d60d444 commit 1b268fb
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,26 @@ import { truncateMiddle } from '@leather.io/utils';
import { analytics } from '@shared/utils/analytics';

import { useBitcoinExplorerLink } from '@app/common/hooks/use-bitcoin-explorer-link';
import type { SbtcDepositInfo } from '@app/query/sbtc/sbtc-deposits.query';
import type { SbtcDepositInfo, SbtcStatus } from '@app/query/sbtc/sbtc-deposits.query';

import { TransactionItemLayout } from '../transaction-item/transaction-item.layout';

function getDepositStatus(status: SbtcStatus) {
switch (status) {
case 'pending':
case 'reprocessing':
return 'Pending deposit';
case 'accepted':
return 'Pending mint';
case 'confirmed':
return 'Done';
case 'failed':
return 'Failed';
default:
return '';
}
}

interface SbtcDepositTransactionItemProps {
deposit: SbtcDepositInfo;
}
Expand All @@ -30,7 +46,9 @@ export function SbtcDepositTransactionItem({ deposit }: SbtcDepositTransactionIt
<Avatar.Image alt="ST" src={SbtcAvatarIconSrc} />
</Avatar.Root>
}
txStatus={<Caption color="yellow.action-primary-default">Pending</Caption>}
txStatus={
<Caption color="yellow.action-primary-default">{getDepositStatus(deposit.status)}</Caption>
}
txTitle={<Title textStyle="label.02">BTC → sBTC</Title>}
// Api is only returning 0 right now
txValue={''} // deposit.amount.toString()
Expand Down
2 changes: 1 addition & 1 deletion src/app/query/sbtc/sbtc-deposits.query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import axios from 'axios';

import { useConfigSbtc } from '../common/remote-config/remote-config.query';

enum SbtcStatus {
export enum SbtcStatus {
Pending = 'pending',
Reprocessing = 'reprocessing',
Accepted = 'accepted',
Expand Down

0 comments on commit 1b268fb

Please sign in to comment.