Skip to content

Commit

Permalink
Merge pull request #8 from 0xsequence/15022024-nextjs-fixes
Browse files Browse the repository at this point in the history
nextjs fixes
  • Loading branch information
SamueleA authored Feb 20, 2024
2 parents 8a72507 + f946b6f commit b6de1b6
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 11 deletions.
10 changes: 8 additions & 2 deletions examples/react/src/components/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 = () => {
Expand All @@ -33,7 +35,11 @@ export const Footer = () => {
<Box
key={index}
className={sharedStyles.clickable}
onClick={() => window.open(socialLink.url)}
onClick={() => {
if (typeof window !== 'undefined') {
window.open(socialLink.url)
}
}}
>
<Image
height="3"
Expand Down
2 changes: 1 addition & 1 deletion packages/checkout/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@0xsequence/kit-checkout",
"version": "2.0.3",
"version": "2.0.4",
"description": "Checkout UI for Sequence Kit",
"repository": "https://github.com/0xsequence/kit/tree/master/packages/checkout",
"main": "dist/0xsequence-kit-checkout.cjs.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/connectors/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@0xsequence/kit-connectors",
"version": "2.0.3",
"version": "2.0.4",
"description": "Wallets for Sequence Kit",
"repository": "https://github.com/0xsequence/kit/tree/master/packages/connectors",
"main": "dist/0xsequence-kit-connectors.cjs.js",
Expand Down
2 changes: 0 additions & 2 deletions packages/connectors/src/connectors/injected/injected.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ declare global {
}
}

window.ethereum = window.ethereum || {}

export interface MoreExternalProviders {
isSequence?: boolean
}
Expand Down
2 changes: 1 addition & 1 deletion packages/kit/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@0xsequence/kit",
"version": "2.0.3",
"version": "2.0.4",
"description": "Core package for Sequence Kit",
"keywords": [
"sequence",
Expand Down
4 changes: 3 additions & 1 deletion packages/kit/src/components/KitProvider/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,9 @@ export const KitProvider = (props: KitConnectProviderProps) => {
},[analytics, address, isConnected])

const poweredBySequenceOnClick = () => {
window.open('https://sequence.xyz')
if (typeof window !== 'undefined') {
window.open('https://sequence.xyz')
}
}

useEffect(() => {
Expand Down
2 changes: 1 addition & 1 deletion packages/wallet/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
4 changes: 3 additions & 1 deletion packages/wallet/src/views/Receive.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
4 changes: 3 additions & 1 deletion packages/wallet/src/views/TransactionDetails/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit b6de1b6

Please sign in to comment.