Skip to content

Commit

Permalink
fix: fix issue
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiorigam committed Nov 22, 2024
1 parent a89d4e8 commit f60cdc9
Show file tree
Hide file tree
Showing 3 changed files with 1,055 additions and 895 deletions.
4 changes: 3 additions & 1 deletion examples/sample-privy-next-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@
"dev": "next dev"
},
"dependencies": {
"@chakra-ui/react": "^3.2.0",
"@chakra-ui/react": "2.8.2",
"@emotion/react": "^11.13.5",
"@emotion/styled": "^11.13.5",
"@vechain/dapp-kit": "*",
"@vechain/dapp-kit-react": "*",
"@vechain/dapp-kit-react-privy": "*",
"framer-motion": "^11.11.17",
"next": "14.2.10",
"react": "^18",
"react-dom": "^18"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@

"use client";

import dynamic from 'next/dynamic';
import { ChakraProvider } from "@chakra-ui/react";

const PrivyProvider = dynamic(
async () => (await import('@vechain/dapp-kit-react-privy')).DAppKitPrivyProvider,
Expand All @@ -15,66 +16,68 @@ interface Props {

export function SocialLoginWrapper({ children }: Props) {
return (
<PrivyProvider
appId={process.env.NEXT_PUBLIC_PRIVY_APP_ID!}
clientId={process.env.NEXT_PUBLIC_PRIVY_CLIENT_ID!}
loginMethods={["google", "twitter"]}
appearance={{
theme: "light",
accentColor: "#696FFD",
loginMessage: "Select a social media profile",
logo: "https://cleanify.vet/logo/cleanify_green.png",
}}
embeddedWallets={{
createOnLogin: "all-users",
}}
smartAccountConfig={{
nodeUrl: "https://node.vechain.energy",
delegatorUrl: "https://delegator.vechain.energy",
accountFactoryAddress: "0x0000000000000000000000000000000000000000",
}}
dappKitConfig={{
nodeUrl: "https://node.vechain.energy",
genesis: {
number: 0,
id: "0x00000000851caf3cfdb6e899cf5958bfb1ac3413d346d43539627e6be7ec1b4a",
size: 170,
parentID:
"0xffffffff53616c757465202620526573706563742c20457468657265756d2100",
timestamp: 1530316800,
gasLimit: 10000000,
beneficiary: "0x0000000000000000000000000000000000000000",
gasUsed: 0,
totalScore: 0,
txsRoot:
"0x45b0cfc220ceec5b7c1c62c4d4193d38e4eba48e8815729ce75f9c0ab0e4c1c0",
txsFeatures: 0,
stateRoot:
"0x09bfdf9e24dd5cd5b63f3c1b5d58b97ff02ca0490214a021ed7d99b93867839c",
receiptsRoot:
"0x45b0cfc220ceec5b7c1c62c4d4193d38e4eba48e8815729ce75f9c0ab0e4c1c0",
signer: "0x0000000000000000000000000000000000000000",
isTrunk: true,
transactions: [],
},
colorMode: "LIGHT",
projectId: process.env.NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID!,
walletConnectOptions: {
<ChakraProvider>
<PrivyProvider
appId={process.env.NEXT_PUBLIC_PRIVY_APP_ID!}
clientId={process.env.NEXT_PUBLIC_PRIVY_CLIENT_ID!}
loginMethods={["google", "twitter"]}
appearance={{
theme: "light",
accentColor: "#696FFD",
loginMessage: "Select a social media profile",
logo: "https://cleanify.vet/logo/cleanify_green.png",
}}
embeddedWallets={{
createOnLogin: "all-users",
}}
smartAccountConfig={{
nodeUrl: "https://node.vechain.energy",
delegatorUrl: "https://delegator.vechain.energy",
accountFactoryAddress: "0x0000000000000000000000000000000000000000",
}}
dappKitConfig={{
nodeUrl: "https://node.vechain.energy",
genesis: {
number: 0,
id: "0x00000000851caf3cfdb6e899cf5958bfb1ac3413d346d43539627e6be7ec1b4a",
size: 170,
parentID:
"0xffffffff53616c757465202620526573706563742c20457468657265756d2100",
timestamp: 1530316800,
gasLimit: 10000000,
beneficiary: "0x0000000000000000000000000000000000000000",
gasUsed: 0,
totalScore: 0,
txsRoot:
"0x45b0cfc220ceec5b7c1c62c4d4193d38e4eba48e8815729ce75f9c0ab0e4c1c0",
txsFeatures: 0,
stateRoot:
"0x09bfdf9e24dd5cd5b63f3c1b5d58b97ff02ca0490214a021ed7d99b93867839c",
receiptsRoot:
"0x45b0cfc220ceec5b7c1c62c4d4193d38e4eba48e8815729ce75f9c0ab0e4c1c0",
signer: "0x0000000000000000000000000000000000000000",
isTrunk: true,
transactions: [],
},
colorMode: "LIGHT",
projectId: process.env.NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID!,
metadata: {
name: "Your App",
description: "Your app description",
url: typeof window !== "undefined" ? window.location.origin : "",
icons: [
typeof window !== "undefined"
? `${window.location.origin}/images/logo/my-dapp.png`
: "",
],
walletConnectOptions: {
projectId: process.env.NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID!,
metadata: {
name: "Your App",
description: "Your app description",
url: typeof window !== "undefined" ? window.location.origin : "",
icons: [
typeof window !== "undefined"
? `${window.location.origin}/images/logo/my-dapp.png`
: "",
],
},
},
},
}}
>
{children}
</PrivyProvider>
}}
>
{children}
</PrivyProvider>
</ChakraProvider>
);
}
Loading

0 comments on commit f60cdc9

Please sign in to comment.