diff --git a/examples/react/src/components/Footer.tsx b/examples/react/src/components/Footer.tsx index 8367344e..7fe66cb0 100644 --- a/examples/react/src/components/Footer.tsx +++ b/examples/react/src/components/Footer.tsx @@ -10,7 +10,9 @@ export const Footer = () => { const isMobile = useMediaQuery('isMobile') const onClickLinkUrl = (url: string) => { - window.open(url) + if (typeof window !== 'undefined') { + window.open(url) + } } const Links = () => { @@ -33,7 +35,11 @@ export const Footer = () => { window.open(socialLink.url)} + onClick={() => { + if (typeof window !== 'undefined') { + window.open(socialLink.url) + } + }} > { },[analytics, address, isConnected]) const poweredBySequenceOnClick = () => { - window.open('https://sequence.xyz') + if (typeof window !== 'undefined') { + window.open('https://sequence.xyz') + } } useEffect(() => { diff --git a/packages/wallet/package.json b/packages/wallet/package.json index 25b23c27..f8686c51 100644 --- a/packages/wallet/package.json +++ b/packages/wallet/package.json @@ -1,6 +1,6 @@ { "name": "@0xsequence/kit-wallet", - "version": "2.0.3", + "version": "2.0.4", "description": "Wallet UI for Sequence Kit", "repository": "https://github.com/0xsequence/kit/tree/master/packages/wallet", "main": "dist/0xsequence-kit-wallet.cjs.js", diff --git a/packages/wallet/src/views/Receive.tsx b/packages/wallet/src/views/Receive.tsx index 2df80b5d..27aa3e9e 100644 --- a/packages/wallet/src/views/Receive.tsx +++ b/packages/wallet/src/views/Receive.tsx @@ -27,7 +27,9 @@ export const Receive = () => { } const onClickShare = () => { - window.open(`https://twitter.com/intent/tweet?text=Here%20is%20my%20address%20${address}`) + if (typeof window !== 'undefined') { + window.open(`https://twitter.com/intent/tweet?text=Here%20is%20my%20address%20${address}`) + } } return ( diff --git a/packages/wallet/src/views/TransactionDetails/index.tsx b/packages/wallet/src/views/TransactionDetails/index.tsx index d8c05119..6d8c5c2b 100644 --- a/packages/wallet/src/views/TransactionDetails/index.tsx +++ b/packages/wallet/src/views/TransactionDetails/index.tsx @@ -96,7 +96,9 @@ export const TransactionDetails = ({ const date = dayjs(transaction.timestamp).format('ddd MMM DD YYYY, h:m:s a') const onClickBlockExplorer = () => { - window.open(`${nativeTokenInfo.blockExplorerUrl}/tx/${transaction.txnHash}`, '_blank') + if (typeof window !== 'undefined') { + window.open(`${nativeTokenInfo.blockExplorerUrl}/tx/${transaction.txnHash}`, '_blank') + } } interface TransferProps {