From 479c43eef2dafe31cc20d0605a088af60bc1a47c Mon Sep 17 00:00:00 2001 From: "zaid.arain" Date: Mon, 22 Jul 2024 12:58:17 +1000 Subject: [PATCH] fix build errors --- .../wallets-with-nextjs/.eslintrc.json | 7 ++++++- .../app/connect-with-etherjs/page.tsx | 2 +- .../passport/wallets-with-nextjs/app/page.tsx | 19 ------------------- .../wallets-with-nextjs/app/redirect/page.tsx | 2 +- .../passport/wallets-with-nextjs/passport.ts | 19 +++++++++++++++++++ .../wallets-with-nextjs/tsconfig.json | 5 +---- 6 files changed, 28 insertions(+), 26 deletions(-) create mode 100644 examples/passport/wallets-with-nextjs/passport.ts diff --git a/examples/passport/wallets-with-nextjs/.eslintrc.json b/examples/passport/wallets-with-nextjs/.eslintrc.json index 6cb73ba8c6..a7c3d56320 100644 --- a/examples/passport/wallets-with-nextjs/.eslintrc.json +++ b/examples/passport/wallets-with-nextjs/.eslintrc.json @@ -1,3 +1,8 @@ { - "extends": ["next/core-web-vitals", "next"] + "extends": ["next/core-web-vitals", "next"], + "settings": { + "next": { + "rootDir": "examples/passport/wallets-with-nextjs" + } + } } diff --git a/examples/passport/wallets-with-nextjs/app/connect-with-etherjs/page.tsx b/examples/passport/wallets-with-nextjs/app/connect-with-etherjs/page.tsx index 3e79acc2d8..c28dcfebf9 100644 --- a/examples/passport/wallets-with-nextjs/app/connect-with-etherjs/page.tsx +++ b/examples/passport/wallets-with-nextjs/app/connect-with-etherjs/page.tsx @@ -5,7 +5,7 @@ import { config, passport } from '@imtbl/sdk'; import { useCallback, useEffect, useState } from 'react'; import { ethers } from 'ethers'; import { ProviderEvent } from '@imtbl/sdk/passport'; -import { passportInstance } from '../page'; +import { passportInstance } from '../../passport'; export default function Connect() { diff --git a/examples/passport/wallets-with-nextjs/app/page.tsx b/examples/passport/wallets-with-nextjs/app/page.tsx index 87239967f0..9468f45ec3 100644 --- a/examples/passport/wallets-with-nextjs/app/page.tsx +++ b/examples/passport/wallets-with-nextjs/app/page.tsx @@ -1,24 +1,5 @@ 'use client'; -import { config, passport } from '@imtbl/sdk'; - -// create the Passport instance and export it so it can be used in the examples -export const passportInstance = new passport.Passport({ - baseConfig: { - environment: config.Environment.SANDBOX, - publishableKey: process.env.NEXT_PUBLIC_PUBLISHABLE_KEY ?? "", // replace with your publishable API key from Hub - }, - clientId: process.env.NEXT_PUBLIC_CLIENT_ID ?? "", // replace with your client ID from Hub - redirectUri: 'http://localhost:3000/redirect', // replace with one of your redirect URIs from Hub - logoutRedirectUri: 'http://localhost:3000/logout', // replace with one of your logout URIs from Hub - audience: 'platform_api', - scope: 'openid offline_access email transact', - popupOverlayOptions: { - disableGenericPopupOverlay: false, // Set to true to disable the generic pop-up overlay - disableBlockedPopupOverlay: false, // Set to true to disable the blocked pop-up overlay - } -}); - export default function Home() { return (<> diff --git a/examples/passport/wallets-with-nextjs/app/redirect/page.tsx b/examples/passport/wallets-with-nextjs/app/redirect/page.tsx index 2d023db698..51c959b792 100644 --- a/examples/passport/wallets-with-nextjs/app/redirect/page.tsx +++ b/examples/passport/wallets-with-nextjs/app/redirect/page.tsx @@ -1,6 +1,6 @@ 'use client'; -import { passportInstance } from '../page'; +import { passportInstance } from "../../passport"; export default function Redirect() { diff --git a/examples/passport/wallets-with-nextjs/passport.ts b/examples/passport/wallets-with-nextjs/passport.ts new file mode 100644 index 0000000000..b9a4c81802 --- /dev/null +++ b/examples/passport/wallets-with-nextjs/passport.ts @@ -0,0 +1,19 @@ + +import { config, passport } from '@imtbl/sdk'; + +// create the Passport instance and export it so it can be used in the examples +export const passportInstance = new passport.Passport({ + baseConfig: { + environment: config.Environment.SANDBOX, + publishableKey: process.env.NEXT_PUBLIC_PUBLISHABLE_KEY ?? "", // replace with your publishable API key from Hub + }, + clientId: process.env.NEXT_PUBLIC_CLIENT_ID ?? "CLIENT_ID", // replace with your client ID from Hub + redirectUri: 'http://localhost:3000/redirect', // replace with one of your redirect URIs from Hub + logoutRedirectUri: 'http://localhost:3000/logout', // replace with one of your logout URIs from Hub + audience: 'platform_api', + scope: 'openid offline_access email transact', + popupOverlayOptions: { + disableGenericPopupOverlay: false, // Set to true to disable the generic pop-up overlay + disableBlockedPopupOverlay: false, // Set to true to disable the blocked pop-up overlay + } +}); \ No newline at end of file diff --git a/examples/passport/wallets-with-nextjs/tsconfig.json b/examples/passport/wallets-with-nextjs/tsconfig.json index e7ff90fd27..bb5584ed1a 100644 --- a/examples/passport/wallets-with-nextjs/tsconfig.json +++ b/examples/passport/wallets-with-nextjs/tsconfig.json @@ -16,10 +16,7 @@ { "name": "next" } - ], - "paths": { - "@/*": ["./*"] - } + ] }, "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"], "exclude": ["node_modules"]