Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
brtkx committed Dec 13, 2024
1 parent 6d55520 commit dbb6910
Show file tree
Hide file tree
Showing 2 changed files with 444 additions and 260 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import { TransactionsTableRow } from './TransactionsTableRow'
import { EmptyTransactionHistory } from './EmptyTransactionHistory'
import { MergedTransaction } from '../../state/app/state'
import { useNativeCurrency } from '../../hooks/useNativeCurrency'
import { Loader } from '../common/atoms/Loader'

export const BatchTransferNativeTokenTooltip = ({
children,
Expand Down Expand Up @@ -139,9 +140,8 @@ export const TransactionHistoryTable = (
) => {
const {
transactions,
loading,
completed,
error,
senderData,
receiverData,
failedChainPairs,
resume,
selectedTabIndex,
Expand All @@ -153,7 +153,7 @@ export const TransactionHistoryTable = (
const isTxHistoryEmpty = transactions.length === 0
const isPendingTab = selectedTabIndex === 0

const paused = !loading && !completed
const paused = !senderData.loadingForSender && !senderData.completedForSender

const contentWrapperRef = useRef<HTMLDivElement | null>(null)
const tableRef = useRef<Table | null>(null)
Expand Down Expand Up @@ -194,8 +194,11 @@ export const TransactionHistoryTable = (
if (isTxHistoryEmpty) {
return (
<EmptyTransactionHistory
loading={loading}
isError={typeof error !== 'undefined'}
loading={senderData.loadingForSender || receiverData.loadingForReceiver}
isError={
typeof senderData.errorForSender !== 'undefined' ||
typeof receiverData.errorForReceiver !== 'undefined'
}
paused={paused}
resume={resume}
tabType={isPendingTab ? 'pending' : 'settled'}
Expand All @@ -214,14 +217,26 @@ export const TransactionHistoryTable = (
isPendingTab ? '' : 'rounded-tl-lg'
)}
>
{loading ? (
{senderData.loadingForSender ? (
<div className="flex h-[28px] items-center space-x-2">
<FailedChainPairsTooltip failedChainPairs={failedChainPairs} />
<HistoryLoader />
</div>
) : (
<div className="flex items-center justify-between gap-2">
<div className="flex items-center justify-start space-x-1">
{receiverData.loadingForReceiver && (
<Tooltip
content={
<b className="text-xs">
Inbound transactions received from another address are
still being fetched...
</b>
}
>
<Loader size="small" color="white" />
</Tooltip>
)}
<FailedChainPairsTooltip failedChainPairs={failedChainPairs} />
<span className="text-xs">
Showing {transactions.length}{' '}
Expand All @@ -230,7 +245,9 @@ export const TransactionHistoryTable = (
</span>
</div>

{!completed && <LoadMoreButton onClick={resume} />}
{!senderData.completedForSender && (
<LoadMoreButton onClick={resume} />
)}
</div>
)}
<div>{pendingTokenDepositsCount > 0 && <PendingDepositWarning />}</div>
Expand Down
Loading

0 comments on commit dbb6910

Please sign in to comment.