Skip to content

Commit

Permalink
Update Transaction History UI & Improve Status Time Estimate
Browse files Browse the repository at this point in the history
  • Loading branch information
zzq0826 committed Sep 24, 2024
1 parent 0e23cc9 commit 04b8c21
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 14 deletions.
4 changes: 2 additions & 2 deletions src/pages/bridge/Send/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,8 @@ const Send = () => {
{txResult?.code === 1 && (
<Alert severity="success">
<>
Submitted successfully! <br />
{txType === "Deposit" ? "Funds take up to 20 mins to be ready" : "Funds take up to 1h to be claimable"}
Submitted successfully!
{/* <br />{txType === "Deposit" ? "Funds take up to 20 mins to be ready" : "Funds take up to 1h to be claimable"} */}
<br />
<TextButton underline="always" sx={{ color: "inherit" }} onClick={handleOpenHistory}>
View transaction history
Expand Down
19 changes: 10 additions & 9 deletions src/pages/bridge/components/TxTable/TxStatusButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,15 @@ const TxStatus = props => {
}

const renderCountDown = ({ total, hours, minutes, seconds, completed }) => {
if (completed) {
return <>Pending</>
}
return (
<>
{tx.isL1 ? "Ready" : "Claimable"} in ~{minutes ? `${minutes}m` : `${seconds}s`}
</>
)
return <>Pending</>
// if (completed) {
// return <>Pending</>
// }
// return (
// <>
// {tx.isL1 ? "Ready" : "Claimable"} in ~{minutes ? `${minutes}m` : `${seconds}s`}
// </>
// )
}

if (tx.txStatus === TX_STATUS.Sent) {
Expand All @@ -101,7 +102,7 @@ const TxStatus = props => {
return (
<Tooltip
placement="top"
title="Scroll provers are still finalizing your transaction, this can take up to 1 hour. Once done, you'll be able to claim it here for use on the target network."
title="Withdrawals are claimable only after the transaction has been included in a finalized bundle. This will depend on the Scroll SDK chain's configuration and transaction volume, but may take up to 10 hours. Once done, you'll be able to claim it here for use on the target network."
>
<ButtonBase className={cx(classes.chip, classes.waitingClaimChip)}>
{renderEstimatedWaitingTime(tx.initiatedAt ? dayjs.unix(tx.initiatedAt).add(1, "h").valueOf() : null)}
Expand Down
6 changes: 3 additions & 3 deletions src/pages/bridge/components/TxTable/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {
} from "@mui/material"

import Link from "@/components/Link"
import { NETWORKS, TX_STATUS } from "@/constants"
import { L1_NAME, L2_NAME, NETWORKS, TX_STATUS } from "@/constants"
import useTokenInfo from "@/hooks/useTokenInfo"
import useTxStore from "@/stores/txStore"
import { formatDate, generateExploreLink, toTokenDisplay, truncateHash } from "@/utils"
Expand Down Expand Up @@ -241,13 +241,13 @@ const TxRow = props => {
if (tx.isL1) {
return (
<>
Deposit <span style={{ whiteSpace: "nowrap" }}>to Scroll</span>
Deposit <span style={{ whiteSpace: "nowrap" }}>to {L2_NAME}</span>
</>
)
} else {
return (
<>
Withdraw <span style={{ whiteSpace: "nowrap" }}>to Ethereum</span>
Withdraw <span style={{ whiteSpace: "nowrap" }}>to {L1_NAME}</span>
</>
)
}
Expand Down

0 comments on commit 04b8c21

Please sign in to comment.