Skip to content

Commit

Permalink
Remove Mint NFT button from Deposit Row now that onchainsummer has en…
Browse files Browse the repository at this point in the history
…ded (#36)

* Remove Mint NFT button from Deposit Row now that onchainsummer has ended

* Fix prettier config with eslint

* Remove unused vars in DepositRow

* Remove unused import
  • Loading branch information
zencephalon authored Oct 3, 2023
1 parent 6e778ea commit b89006d
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 26 deletions.
7 changes: 6 additions & 1 deletion apps/bridge/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
module.exports = {
extends: ['next', 'plugin:react/recommended', 'plugin:react/jsx-runtime'],
extends: [
'next',
'plugin:react/recommended',
'plugin:react/jsx-runtime',
'eslint-config-prettier',
],
settings: {
next: {
rootDir: __dirname,
Expand Down
34 changes: 10 additions & 24 deletions apps/bridge/src/components/Transactions/DepositRow/DepositRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { TransactionIcon } from 'apps/bridge/src/components/TransactionIcon/Tran
import { depositPhaseStatusText, depositPhaseText } from 'apps/bridge/src/constants/phaseText';
import { BridgeTransaction } from 'apps/bridge/src/types/BridgeTransaction';
import { usdFormatter } from 'apps/bridge/src/utils/formatter/balance';
import { useChainEnv } from 'apps/bridge/src/utils/hooks/useChainEnv';
import { useConversionRate } from 'apps/bridge/src/utils/hooks/useConversionRate';
import { truncateMiddle } from 'apps/bridge/src/utils/string/truncateMiddle';
import type { DepositPhase } from 'apps/bridge/src/utils/transactions/phase';
Expand All @@ -22,25 +21,23 @@ type DepositRowProps = {
};

export const DepositRow = memo(function WithdrawalRow({ transaction }: DepositRowProps) {
const chainEnv = useChainEnv();
const isMainnet = chainEnv === 'mainnet';
const date = transaction.blockTimestamp
? new Date(Number(transaction.blockTimestamp) * 1000).toLocaleDateString('en-US', {
year: 'numeric',
month: 'short',
day: 'numeric',
})
year: 'numeric',
month: 'short',
day: 'numeric',
})
: undefined;
const dateMonthDayOnly = transaction.blockTimestamp
? new Date(Number(transaction.blockTimestamp) * 1000).toLocaleDateString('en-US', {
month: 'short',
day: 'numeric',
})
month: 'short',
day: 'numeric',
})
: undefined;
const time = transaction.blockTimestamp
? new Date(Number(transaction.blockTimestamp) * 1000).toLocaleTimeString('en-US', {
timeStyle: 'short',
})
timeStyle: 'short',
})
: undefined;
const depositAmount = utils.formatUnits(
transaction.amount,
Expand Down Expand Up @@ -90,21 +87,10 @@ export const DepositRow = memo(function WithdrawalRow({ transaction }: DepositRo
</button>
);

const mintButton = (
<a
href="https://nft.coinbase.com/mint/bridgetobase"
target="_blank"
rel="noreferrer noopener"
className="bg-white px-4 py-2 font-sans text-sm text-black"
>
Mint NFT
</a>
);

const PHASE_TO_STATUS = {
DEPOSIT_TX_PENDING: pendingButton,
DEPOSIT_TX_FAILURE: depositPhaseStatusText.DEPOSIT_TX_FAILURE,
FUNDS_DEPOSITED: isMainnet ? mintButton : mintButton,
FUNDS_DEPOSITED: depositPhaseStatusText.FUNDS_DEPOSITED,
};

let depositStatus: DepositPhase;
Expand Down
7 changes: 6 additions & 1 deletion apps/web/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
module.exports = {
extends: ['next', 'plugin:react/recommended', 'plugin:react/jsx-runtime'],
extends: [
'next',
'plugin:react/recommended',
'plugin:react/jsx-runtime',
'eslint-config-prettier',
],
settings: {
next: {
rootDir: __dirname,
Expand Down

0 comments on commit b89006d

Please sign in to comment.