Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
dohaki committed Nov 1, 2023
1 parent c8fb831 commit 2bf9441
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 14 deletions.
10 changes: 4 additions & 6 deletions src/utils/local-deposits.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,20 @@
import { Deposit } from "../hooks/useDeposits";

const LOCAL_PENDING_DEPOSITS_KEY = "local-deposits";
const LOCAL_DEPOSITS_KEY = "local-deposits";

export function addLocalDeposit(newDeposit: Deposit) {
const localPendingDeposits = getLocalDeposits();
const filteredLocalPendingDeposits = localPendingDeposits.filter(
(deposit) => deposit.depositTxHash !== newDeposit.depositTxHash
);
window.localStorage.setItem(
LOCAL_PENDING_DEPOSITS_KEY,
LOCAL_DEPOSITS_KEY,
JSON.stringify([newDeposit, ...filteredLocalPendingDeposits])
);
}

export function getLocalDeposits() {
const localPendingDeposits = window.localStorage.getItem(
LOCAL_PENDING_DEPOSITS_KEY
);
const localPendingDeposits = window.localStorage.getItem(LOCAL_DEPOSITS_KEY);
return (
localPendingDeposits ? JSON.parse(localPendingDeposits) : []
) as Deposit[];
Expand All @@ -35,7 +33,7 @@ export function removeLocalDeposits(depositTxHashes: string[]) {
(deposit) => !depositTxHashes.includes(deposit.depositTxHash)
);
window.localStorage.setItem(
LOCAL_PENDING_DEPOSITS_KEY,
LOCAL_DEPOSITS_KEY,
JSON.stringify(filteredLocalPendingDeposits)
);
}
2 changes: 0 additions & 2 deletions src/views/DepositStatus/DepositStatus.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ export default function DepositStatus() {
const destinationChainId = queryParams.get("destinationChainId");
const bridgeTokenSymbol = queryParams.get("bridgeTokenSymbol");

// TOOD: more validation here

if (
!depositTxHash ||
!originChainId ||
Expand Down
6 changes: 3 additions & 3 deletions src/views/DepositStatus/components/DepositStatusLowerCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { useHistory } from "react-router-dom";
import { SecondaryButton } from "components/Button";
import EstimatedTable from "views/Bridge/components/EstimatedTable";
import { getReceiveTokenSymbol } from "views/Bridge/utils";
import { getToken } from "utils";
import { getToken, COLORS } from "utils";
import { useIsContractAddress } from "hooks/useIsContractAddress";

import { EarnByLpAndStakingCard } from "./EarnByLpAndStakingCard";
Expand Down Expand Up @@ -71,9 +71,9 @@ export function DepositStatusLowerCard({
const Divider = styled.div`
width: 100%;
height: 1px;
background: #3e4047;
background: ${COLORS["grey-600"]};
`;

const Button = styled(SecondaryButton)<{ disabled?: boolean }>`
const Button = styled(SecondaryButton)`
width: 100%;
`;
6 changes: 3 additions & 3 deletions src/views/DepositStatus/components/DepositTimesCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { ReactComponent as LoadingIcon } from "assets/loading.svg";
import { ReactComponent as ExternalLinkIcon } from "assets/icons/external-link-16.svg";

import { Text, CardWrapper } from "components";
import { getChainInfo } from "utils";
import { getChainInfo, COLORS } from "utils";
import { useAmplitude } from "hooks";
import { ampli } from "ampli";

Expand Down Expand Up @@ -175,7 +175,7 @@ const Row = styled.div`
const Divider = styled.div`
width: 100%;
height: 1px;
background: #3e4047;
background: ${COLORS["grey-600"]};
`;

const DateWrapper = styled.div`
Expand All @@ -191,7 +191,7 @@ const TransactionsPageLinkWrapper = styled.a`
width: 100%;
align-items: center;
justify-content: space-between;
border: 1px solid #4c4e57;
border: 1px solid ${COLORS["grey-500"]};
border-radius: 0.5rem;
padding: 1rem;
text-decoration: none;
Expand Down

0 comments on commit 2bf9441

Please sign in to comment.