diff --git a/src/components/ChainSelector.tsx b/src/components/ChainSelector.tsx
new file mode 100644
index 0000000..07525e9
--- /dev/null
+++ b/src/components/ChainSelector.tsx
@@ -0,0 +1,80 @@
+import { Dropdown } from "@brillionfi/quill-core";
+import { SUPPORTED_CHAINS } from "@brillionfi/wallet-infra-sdk/dist/models";
+
+export const ChainSelector = () => {
+ /* const handleChainChange = (id: SUPPORTED_CHAIN_IDS) => {
+ handleChangeChainId(id, {
+ onSuccess: (data) => {
+ if (!!notification?.show) {
+ const chainName = getChainById(
+ data?.chainId ?? DEFAULT_CHAIN.id,
+ ).name;
+ notification.show({
+ severity: "success",
+ summary: tCommon("success"),
+ detail: t("notifications.success", { chainName }),
+ });
+ }
+ if (onChange) onChange(data?.chainId);
+ },
+ onError: () => {
+ if (!!notification?.show) {
+ notification.show({
+ severity: "error",
+ summary: tCommon("error"),
+ detail: t("notifications.error"),
+ });
+ }
+ },
+ });
+ setSelectedChain(id);
+ };
+
+ const chainOptionTemplate = (id: SUPPORTED_CHAIN_IDS) => {
+ const icon = getChainIcon(id);
+ const { name } = getChainById(id);
+ const iconSize = size === "normal" ? "h-4 w-4" : "";
+ const iconSizeLarge = size !== "normal" ? size : undefined;
+ return (
+
+
+ {name}
+
+ );
+ };
+
+ const finalSizeClassName = useMemo(() => {
+ switch (size) {
+ case "normal":
+ return "h-10";
+ case "large":
+ return "h-16";
+ case "xlarge":
+ return "h-20";
+ default:
+ return "h-10";
+ }
+ }, [size]);
+
+ const finalFullWidthClassName = useMemo(() => {
+ return fullWidth ? "w-full" : "w-full md:w-60";
+ }, [fullWidth]);
+
+ const finalChainSelectorClassName = useMemo(() => {
+ return twMerge([finalSizeClassName, finalFullWidthClassName]);
+ }, [finalSizeClassName, finalFullWidthClassName]); */
+
+ return (
+
+ );
+};
diff --git a/src/components/LoginForm.tsx b/src/components/LoginForm.tsx
index 2f04639..345b595 100644
--- a/src/components/LoginForm.tsx
+++ b/src/components/LoginForm.tsx
@@ -1,17 +1,25 @@
-import { AuthProvider } from "@brillionfi/wallet-infra-sdk";
-import { useUser } from "hooks";
-import { LoginMethods, TLoginOptions } from "interfaces";
-import GoogleLogo from "@/components/icons/google-logo";
-import TwitterLogo from "@/components/icons/twitter-logo";
+import { useState } from "react";
import DiscordLogo from "@/components/icons/discord-logo";
+import EmailLogo from "@/components/icons/email-logo";
+import GoogleLogo from "@/components/icons/google-logo";
import MetamaskLogo from "@/components/icons/metamask-logo";
+import TwitterLogo from "@/components/icons/twitter-logo";
import WalletConnectLogo from "@/components/icons/walletconnect-logo";
-import EmailLogo from "@/components/icons/email-logo";
-import { useState } from "react";
-import QRCodeModal from "@walletconnect/qrcode-modal";
import { defaultStyles, TCustomProps } from "@/components/LoginFormStyles";
+import { AuthProvider } from "@brillionfi/wallet-infra-sdk";
+import QRCodeModal from "@walletconnect/qrcode-modal";
+import { useUser } from "hooks";
+import { LoginMethods, TLoginOptions } from "interfaces";
-export const LoginForm = ({loginMethods, redirectUrl, customProps}: {loginMethods: LoginMethods[], redirectUrl: string, customProps?: TCustomProps}) => {
+export const LoginForm = ({
+ loginMethods,
+ redirectUrl,
+ customProps,
+}: {
+ loginMethods: LoginMethods[];
+ redirectUrl: string;
+ customProps?: TCustomProps;
+}) => {
const { login } = useUser();
const [showEmail, setShowEmail] = useState(false);
@@ -32,7 +40,7 @@ export const LoginForm = ({loginMethods, redirectUrl, customProps}: {loginMethod
},
{
label: LoginMethods.Discord,
- icon: ,
+ icon: ,
disabled: false,
onClick: async () => {
const url = await login(AuthProvider.DISCORD, redirectUrl);
@@ -43,7 +51,7 @@ export const LoginForm = ({loginMethods, redirectUrl, customProps}: {loginMethod
},
{
label: LoginMethods.Twitter,
- icon: ,
+ icon: ,
disabled: false,
onClick: async () => {
const url = await login(AuthProvider.TWITTER, redirectUrl);
@@ -69,8 +77,8 @@ export const LoginForm = ({loginMethods, redirectUrl, customProps}: {loginMethod
disabled: false,
onClick: async () => {
const url = await login(AuthProvider.WALLET_CONNECT, redirectUrl);
- if(!url) return;
-
+ if (!url) return;
+
QRCodeModal.open(url, () => {});
},
},
@@ -89,7 +97,7 @@ export const LoginForm = ({loginMethods, redirectUrl, customProps}: {loginMethod
},
},
];
- if(showEmail) {
+ if (showEmail) {
options.push({
label: LoginMethods.Email,
html: (
@@ -121,17 +129,17 @@ export const LoginForm = ({loginMethods, redirectUrl, customProps}: {loginMethod
}}
>
setEmail(e.target.value)}
id="email"
- placeholder='Email'
+ placeholder="Email"
value={email}
style={{
- minHeight: '45px',
- borderRadius: '5px',
- background: 'black',
- padding: '8px',
+ minHeight: "45px",
+ borderRadius: "5px",
+ background: "black",
+ padding: "8px",
}}
/>