From 2cd7cba1b199e1c25f72bb3d37cc85ad2827bd3c Mon Sep 17 00:00:00 2001 From: Srujan Gurram Date: Mon, 2 Sep 2024 12:03:00 +0530 Subject: [PATCH] updated use client exports --- src/components/CustomAvatar.tsx | 2 - src/components/Login.tsx | 54 ++++++++++----------- src/components/RainbowKitClientProvider.tsx | 6 +-- src/components/SignTokenButton.tsx | 2 - src/index.ts | 16 +++--- 5 files changed, 36 insertions(+), 44 deletions(-) diff --git a/src/components/CustomAvatar.tsx b/src/components/CustomAvatar.tsx index 819b304..77e7428 100644 --- a/src/components/CustomAvatar.tsx +++ b/src/components/CustomAvatar.tsx @@ -1,5 +1,3 @@ -'use client' - import BoringAvatar from 'boring-avatars' import type { AvatarComponent } from '@rainbow-me/rainbowkit' diff --git a/src/components/Login.tsx b/src/components/Login.tsx index a4967a3..3907265 100644 --- a/src/components/Login.tsx +++ b/src/components/Login.tsx @@ -1,33 +1,31 @@ -'use client' - -import { ConnectButton } from '@rainbow-me/rainbowkit' -import { SignTokenButton } from './SignTokenButton' +import { ConnectButton } from "@rainbow-me/rainbowkit"; +import { SignTokenButton } from "./SignTokenButton"; interface LoginProps { - title: string - description: string - handleRedirect: () => void + title: string; + description: string; + handleRedirect?: () => void; } export const Login = ({ title, description, handleRedirect }: LoginProps) => { - return ( -
-
-

{title}

-

- {description} -

-
-
-

Step 1: Connect your wallet

- -
-
-

Step 2: Authenticate your wallet

- -
-
-
-
- ) -} + return ( +
+
+

{title}

+

+ {description} +

+
+
+

Step 1: Connect your wallet

+ +
+
+

Step 2: Authenticate your wallet

+ handleRedirect?.()} /> +
+
+
+
+ ); +}; diff --git a/src/components/RainbowKitClientProvider.tsx b/src/components/RainbowKitClientProvider.tsx index dcb07eb..0b955f4 100644 --- a/src/components/RainbowKitClientProvider.tsx +++ b/src/components/RainbowKitClientProvider.tsx @@ -1,5 +1,3 @@ -'use client' - import type React from 'react' import { iqTestnet } from '../lib/data/iqTestnet' import { iqWikiTheme } from '../lib/data/rainbowKitTheme' @@ -55,9 +53,7 @@ export function RainbowKitClientProvider({ return ( - - {children} - + {children} ) diff --git a/src/components/SignTokenButton.tsx b/src/components/SignTokenButton.tsx index 1da9040..d878ee4 100644 --- a/src/components/SignTokenButton.tsx +++ b/src/components/SignTokenButton.tsx @@ -1,5 +1,3 @@ -'use client' - import { useAccount } from 'wagmi' import { useEffect } from 'react' import { useAuth } from '../lib/hooks/useAuth' diff --git a/src/index.ts b/src/index.ts index 3dc81f5..718e882 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,12 +1,14 @@ +'use client' + // Components -export * from './components/CustomAvatar' -export * from './components/RainbowKitClientProvider' -export * from './components/Login' -export * from './components/SignTokenButton' +export { CustomAvatar } from './components/CustomAvatar' +export { RainbowKitClientProvider } from './components/RainbowKitClientProvider' +export { Login } from './components/Login' +export { SignTokenButton } from './components/SignTokenButton' // Data -export * from './lib/data/iqTestnet' -export * from './lib/data/rainbowKitTheme' +export { iqTestnet } from './lib/data/iqTestnet' +export { iqWikiTheme } from './lib/data/rainbowKitTheme' // Integrations -export * from './lib/integrations/web3-auth-connector' +export { rainbowWeb3AuthConnector } from './lib/integrations/web3-auth-connector'