-
Notifications
You must be signed in to change notification settings - Fork 318
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(playground): update in-app wallet auth options and components (#…
- Loading branch information
1 parent
5293fba
commit b85fe2a
Showing
3 changed files
with
58 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 20 additions & 24 deletions
44
apps/playground-web/src/components/in-app-wallet/connect-button.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,32 @@ | ||
"use client"; | ||
|
||
import { THIRDWEB_CLIENT } from "@/lib/client"; | ||
import { useTheme } from "next-themes"; | ||
import { ConnectButton } from "thirdweb/react"; | ||
import type { ConnectButtonProps } from "thirdweb/react"; | ||
import {} from "thirdweb/react"; | ||
import { inAppWallet } from "thirdweb/wallets/in-app"; | ||
import { chain } from "./constants"; | ||
|
||
export function InAppConnectButton( | ||
props?: Omit<ConnectButtonProps, "client" | "theme">, | ||
) { | ||
const { theme } = useTheme(); | ||
import { StyledConnectEmbed } from "../styled-connect-embed"; | ||
|
||
export function InAppConnectEmbed() { | ||
return ( | ||
<ConnectButton | ||
client={THIRDWEB_CLIENT} | ||
theme={theme === "light" ? "light" : "dark"} | ||
connectButton={{ | ||
label: "Sign in", | ||
}} | ||
supportedNFTs={{ | ||
"84532": ["0x638263e3eAa3917a53630e61B1fBa685308024fa"], | ||
}} | ||
<StyledConnectEmbed | ||
wallets={[ | ||
inAppWallet({ | ||
smartAccount: { | ||
chain, | ||
sponsorGas: true, | ||
auth: { | ||
options: [ | ||
"google", | ||
"x", | ||
"apple", | ||
"discord", | ||
"facebook", | ||
"farcaster", | ||
"telegram", | ||
"coinbase", | ||
"line", | ||
"email", | ||
"phone", | ||
"passkey", | ||
"guest", | ||
], | ||
}, | ||
}), | ||
]} | ||
{...props} | ||
/> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters