Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

better login connector buttons #112

Merged
merged 1 commit into from
Jan 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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}`;
}
};
Loading