From 4f2f6b0461f3ebf8c53a42ec5387054b6a28b5cd Mon Sep 17 00:00:00 2001 From: yuliferna Date: Mon, 2 Oct 2023 14:57:08 -0400 Subject: [PATCH 1/5] feature --- src/components/ShowTx.tsx | 69 +++++++++++++++++++++++++++++---------- src/muiTheme.js | 4 +++ src/utils/consts.ts | 5 +++ 3 files changed, 61 insertions(+), 17 deletions(-) diff --git a/src/components/ShowTx.tsx b/src/components/ShowTx.tsx index e6424a986..67b72772f 100644 --- a/src/components/ShowTx.tsx +++ b/src/components/ShowTx.tsx @@ -26,15 +26,31 @@ import { CHAIN_ID_BASE, } from "@certusone/wormhole-sdk"; import { CHAIN_ID_NEAR } from "@certusone/wormhole-sdk/lib/esm"; -import { Button, makeStyles, Typography } from "@material-ui/core"; +import { Button, makeStyles, Typography, Chip } from "@material-ui/core"; import { Transaction } from "../store/transferSlice"; -import { CLUSTER, getExplorerName } from "../utils/consts"; +import { CLUSTER, getExplorerName, getWormholescanLink } from "../utils/consts"; const useStyles = makeStyles((theme) => ({ tx: { marginTop: theme.spacing(1), textAlign: "center", }, + txButtons: { + display: "flex", + justifyContent: "center", + gap: theme.spacing(3), + marginTop: 20, + }, + wormscanButton: { + position: "relative" + }, + newTag: { + position: "absolute", + backgroundColor: theme.palette.warning.main, + color: theme.palette.background.default, + fontSize: 12, + fontWeight: 500, + }, viewButton: { marginTop: theme.spacing(1), }, @@ -177,21 +193,40 @@ export default function ShowTx({ return (
- - {tx.id} - - {showExplorerLink && explorerAddress ? ( - - ) : null} +
+ + {tx.id} + +
+
+ {showExplorerLink && explorerAddress ? ( + + ) : null} + {showExplorerLink && tx.id + && (
+ + +
+ )} +
); } diff --git a/src/muiTheme.js b/src/muiTheme.js index 2262d22dc..854be632a 100644 --- a/src/muiTheme.js +++ b/src/muiTheme.js @@ -16,6 +16,7 @@ export const COLORS = { darkRed: "#810612", white: "#FFFFFF", whiteWithTransparency: "rgba(255,255,255,.07)", + orange: "#F0932A", }; const suisse = { @@ -49,6 +50,9 @@ export const theme = responsiveFontSizes( error: { main: COLORS.red, }, + warning: { + main: COLORS.orange, + } }, typography: { diff --git a/src/utils/consts.ts b/src/utils/consts.ts index 9b0d01895..3192bc2b9 100644 --- a/src/utils/consts.ts +++ b/src/utils/consts.ts @@ -2049,3 +2049,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'}` +} \ No newline at end of file From a30a5a052d4d4ebc010610855fb569b022bd8d50 Mon Sep 17 00:00:00 2001 From: yuliferna Date: Tue, 3 Oct 2023 10:39:12 -0400 Subject: [PATCH 2/5] add new prop --- src/components/Attest/CreatePreview.tsx | 2 +- src/components/Migration/EvmQuickMigrate.tsx | 2 +- src/components/Migration/EvmWorkflow.tsx | 2 +- src/components/NFT/RedeemPreview.tsx | 2 +- src/components/ShowTx.tsx | 4 +++- src/components/Transfer/RedeemPreview.tsx | 2 +- 6 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/components/Attest/CreatePreview.tsx b/src/components/Attest/CreatePreview.tsx index 1273d855f..28b5ea5dc 100644 --- a/src/components/Attest/CreatePreview.tsx +++ b/src/components/Attest/CreatePreview.tsx @@ -48,7 +48,7 @@ export default function CreatePreview() { > {explainerString} - {createTx ? : null} + {createTx ? : null} {howToAddToTokenListUrl ? ( Remember to add the token to the{" "} diff --git a/src/components/Migration/EvmQuickMigrate.tsx b/src/components/Migration/EvmQuickMigrate.tsx index 1dc40ae53..23e57d197 100644 --- a/src/components/Migration/EvmQuickMigrate.tsx +++ b/src/components/Migration/EvmQuickMigrate.tsx @@ -177,7 +177,7 @@ function EvmMigrationLineItem({ Successfully migrated your tokens. They will become available once this transaction confirms. - + ); diff --git a/src/components/Migration/EvmWorkflow.tsx b/src/components/Migration/EvmWorkflow.tsx index 6f6682d12..9d12edb81 100644 --- a/src/components/Migration/EvmWorkflow.tsx +++ b/src/components/Migration/EvmWorkflow.tsx @@ -223,7 +223,7 @@ export default function EvmWorkflow({ Successfully migrated your tokens! They will be available once this transaction confirms. - + ) : null} diff --git a/src/components/NFT/RedeemPreview.tsx b/src/components/NFT/RedeemPreview.tsx index 08b983f04..a17d4becf 100644 --- a/src/components/NFT/RedeemPreview.tsx +++ b/src/components/NFT/RedeemPreview.tsx @@ -33,7 +33,7 @@ export default function RedeemPreview() { > {explainerString} - {redeemTx ? : null} + {redeemTx ? : null} Transfer Another NFT! diff --git a/src/components/ShowTx.tsx b/src/components/ShowTx.tsx index 67b72772f..87f0c44e1 100644 --- a/src/components/ShowTx.tsx +++ b/src/components/ShowTx.tsx @@ -59,9 +59,11 @@ const useStyles = makeStyles((theme) => ({ export default function ShowTx({ chainId, tx, + showWormscanLink = true }: { chainId: ChainId; tx: Transaction; + showWormscanLink?: boolean; }) { const classes = useStyles(); const showExplorerLink = @@ -211,7 +213,7 @@ export default function ShowTx({ View on {explorerName} ) : null} - {showExplorerLink && tx.id + {showExplorerLink && showWormscanLink && tx.id && (
); diff --git a/src/components/Migration/EvmWorkflow.tsx b/src/components/Migration/EvmWorkflow.tsx index 9d12edb81..2172cda19 100644 --- a/src/components/Migration/EvmWorkflow.tsx +++ b/src/components/Migration/EvmWorkflow.tsx @@ -223,7 +223,11 @@ export default function EvmWorkflow({ Successfully migrated your tokens! They will be available once this transaction confirms. - + ) : null} diff --git a/src/components/NFT/RedeemPreview.tsx b/src/components/NFT/RedeemPreview.tsx index a17d4becf..bab515f4e 100644 --- a/src/components/NFT/RedeemPreview.tsx +++ b/src/components/NFT/RedeemPreview.tsx @@ -33,7 +33,9 @@ export default function RedeemPreview() { > {explainerString} - {redeemTx ? : null} + {redeemTx ? ( + + ) : null} Transfer Another NFT! diff --git a/src/components/ShowTx.tsx b/src/components/ShowTx.tsx index 87f0c44e1..4d9233711 100644 --- a/src/components/ShowTx.tsx +++ b/src/components/ShowTx.tsx @@ -42,7 +42,7 @@ const useStyles = makeStyles((theme) => ({ marginTop: 20, }, wormscanButton: { - position: "relative" + position: "relative", }, newTag: { position: "absolute", @@ -59,7 +59,7 @@ const useStyles = makeStyles((theme) => ({ export default function ShowTx({ chainId, tx, - showWormscanLink = true + showWormscanLink = true, }: { chainId: ChainId; tx: Transaction; @@ -213,8 +213,8 @@ export default function ShowTx({ View on {explorerName} ) : null} - {showExplorerLink && showWormscanLink && tx.id - && (
+ {showExplorerLink && showWormscanLink && tx.id && ( +
- )} + )}
); diff --git a/src/components/Transfer/RedeemPreview.tsx b/src/components/Transfer/RedeemPreview.tsx index 3c7b74f43..4e84185c6 100644 --- a/src/components/Transfer/RedeemPreview.tsx +++ b/src/components/Transfer/RedeemPreview.tsx @@ -44,7 +44,9 @@ export default function RedeemPreview({ > {explainerString} - {redeemTx ? : null} + {redeemTx ? ( + + ) : null} diff --git a/src/utils/consts.ts b/src/utils/consts.ts index 3192bc2b9..9da3c2e37 100644 --- a/src/utils/consts.ts +++ b/src/utils/consts.ts @@ -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'}` -} \ No newline at end of file + return `https://wormholescan.io/#/tx/${tx}?network=${ + process.env.REACT_APP_CLUSTER === "mainnet" ? "MAINNET" : "TESTNET" + }`; +}; From 90481c9fa060abf3587578ec28f820d6b2507a5c Mon Sep 17 00:00:00 2001 From: yuliferna Date: Tue, 3 Oct 2023 10:54:53 -0400 Subject: [PATCH 4/5] fix format --- src/muiTheme.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/muiTheme.js b/src/muiTheme.js index 854be632a..021bfe803 100644 --- a/src/muiTheme.js +++ b/src/muiTheme.js @@ -52,7 +52,7 @@ export const theme = responsiveFontSizes( }, warning: { main: COLORS.orange, - } + }, }, typography: { From 1a32322e8c83f67223bf6724b1f91db8cf0731cc Mon Sep 17 00:00:00 2001 From: yuliferna Date: Tue, 3 Oct 2023 12:58:14 -0400 Subject: [PATCH 5/5] [skip ci] bump version --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 23afa9ed6..6c7a01531 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@xlabs/portal-bridge-ui", - "version": "0.1.84", + "version": "0.1.85", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@xlabs/portal-bridge-ui", - "version": "0.1.84", + "version": "0.1.85", "hasInstallScript": true, "dependencies": { "@certusone/wormhole-sdk": "^0.10.4", diff --git a/package.json b/package.json index 6a887d2d2..75bcc7a23 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@xlabs/portal-bridge-ui", - "version": "0.1.84", + "version": "0.1.85", "private": true, "dependencies": { "@certusone/wormhole-sdk": "^0.10.4",