Skip to content

Commit

Permalink
Merge pull request #112 from EveripediaNetwork/fix-better-login-conne…
Browse files Browse the repository at this point in the history
…ctor-buttons

better login connector buttons
  • Loading branch information
Royal-lobster authored Jan 2, 2025
2 parents 684c3bd + cd94800 commit 3a8d219
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .changeset/lovely-spoons-care.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@everipedia/iq-login": patch
---

Adds better ux copies and button styles in login element
23 changes: 18 additions & 5 deletions src/components/login-element.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ interface LoginProps {

export const Login = ({
title = "Sign In / Connect",
description = "Connect your wallet to access your account",
connectText = "Step 1: Connect your wallet",
signTokenText = "Step 2: Authenticate your wallet",
description = "Get started with your preferred login method",
connectText = "Choose your login method",
signTokenText = "Verify your wallet",
handleRedirect,
}: LoginProps) => {
const { connect, connectors } = useConnect();
Expand Down Expand Up @@ -59,9 +59,9 @@ export const Login = ({
key={connector.uid}
suppressHydrationWarning
onClick={() => connect({ connector })}
className="w-full px-4 py-2 bg-primary text-primary-foreground rounded-md hover:bg-primary/90 disabled:opacity-50 transition-colors"
className="w-full px-4 py-2 border border-primary text-primary hover:bg-primary/10 rounded-md transition-colors"
>
Connect with {connector.name}
{getConnectorLabel(connector.name)}
</button>
))
)}
Expand All @@ -82,3 +82,16 @@ export const Login = ({
</div>
);
};

const getConnectorLabel = (connectorName: string) => {
switch (connectorName) {
case "Web3Auth":
return "Login with Email / Socials";
case "Injected":
return "Login with Browser Wallet";
case "MetaMask":
return "Login with MetaMask";
default:
return `Login with ${connectorName}`;
}
};

0 comments on commit 3a8d219

Please sign in to comment.