Skip to content

Commit

Permalink
fix format
Browse files Browse the repository at this point in the history
  • Loading branch information
yuli-ferna committed Oct 3, 2023
1 parent a30a5a0 commit 438d9ae
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 13 deletions.
4 changes: 3 additions & 1 deletion src/components/Attest/CreatePreview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ export default function CreatePreview() {
>
{explainerString}
</Typography>
{createTx ? <ShowTx chainId={targetChain} tx={createTx} showWormscanLink={false} /> : null}
{createTx ? (
<ShowTx chainId={targetChain} tx={createTx} showWormscanLink={false} />
) : null}
{howToAddToTokenListUrl ? (
<Alert severity="info" variant="outlined" className={classes.alert}>
Remember to add the token to the{" "}
Expand Down
6 changes: 5 additions & 1 deletion src/components/Migration/EvmQuickMigrate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,11 @@ function EvmMigrationLineItem({
Successfully migrated your tokens. They will become available once
this transaction confirms.
</Typography>
<ShowTx chainId={chainId} tx={{ id: transaction, block: 1 }} showWormscanLink={false} />
<ShowTx
chainId={chainId}
tx={{ id: transaction, block: 1 }}
showWormscanLink={false}
/>
</div>
</div>
);
Expand Down
6 changes: 5 additions & 1 deletion src/components/Migration/EvmWorkflow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,11 @@ export default function EvmWorkflow({
Successfully migrated your tokens! They will be available once this
transaction confirms.
</Typography>
<ShowTx tx={{ id: transaction, block: 1 }} chainId={chainId} showWormscanLink={false} />
<ShowTx
tx={{ id: transaction, block: 1 }}
chainId={chainId}
showWormscanLink={false}
/>
</>
) : null}
</>
Expand Down
4 changes: 3 additions & 1 deletion src/components/NFT/RedeemPreview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ export default function RedeemPreview() {
>
{explainerString}
</Typography>
{redeemTx ? <ShowTx chainId={targetChain} tx={redeemTx} showWormscanLink={false} /> : null}
{redeemTx ? (
<ShowTx chainId={targetChain} tx={redeemTx} showWormscanLink={false} />
) : null}
<ButtonWithLoader onClick={handleResetClick}>
Transfer Another NFT!
</ButtonWithLoader>
Expand Down
10 changes: 5 additions & 5 deletions src/components/ShowTx.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const useStyles = makeStyles((theme) => ({
marginTop: 20,
},
wormscanButton: {
position: "relative"
position: "relative",
},
newTag: {
position: "absolute",
Expand All @@ -59,7 +59,7 @@ const useStyles = makeStyles((theme) => ({
export default function ShowTx({
chainId,
tx,
showWormscanLink = true
showWormscanLink = true,
}: {
chainId: ChainId;
tx: Transaction;
Expand Down Expand Up @@ -213,8 +213,8 @@ export default function ShowTx({
View on {explorerName}
</Button>
) : null}
{showExplorerLink && showWormscanLink && tx.id
&& (<div className={classes.wormscanButton}>
{showExplorerLink && showWormscanLink && tx.id && (
<div className={classes.wormscanButton}>
<Button
href={getWormholescanLink(tx.id)}
target="_blank"
Expand All @@ -227,7 +227,7 @@ export default function ShowTx({
</Button>
<Chip className={classes.newTag} label="NEW!" size="small" />
</div>
)}
)}
</div>
</div>
);
Expand Down
4 changes: 3 additions & 1 deletion src/components/Transfer/RedeemPreview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ export default function RedeemPreview({
>
{explainerString}
</Typography>
{redeemTx ? <ShowTx chainId={targetChain} tx={redeemTx} showWormscanLink={false} /> : null}
{redeemTx ? (
<ShowTx chainId={targetChain} tx={redeemTx} showWormscanLink={false} />
) : null}
<AddToMetamask />
<FeaturedMarkets />
<ButtonWithLoader onClick={handleResetClick}>
Expand Down
7 changes: 4 additions & 3 deletions src/utils/consts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2050,7 +2050,8 @@ export const getAssetAddressNative = (
return hexToNativeAssetString(uint8ArrayToHex(address), chainId);
};


export const getWormholescanLink = (tx: string) => {
return `https://wormholescan.io/#/tx/${tx}?network=${process.env.REACT_APP_CLUSTER === "mainnet" ? 'MAINNET' : 'TESTNET'}`
}
return `https://wormholescan.io/#/tx/${tx}?network=${
process.env.REACT_APP_CLUSTER === "mainnet" ? "MAINNET" : "TESTNET"
}`;
};

0 comments on commit 438d9ae

Please sign in to comment.