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

login component to use shadcn theme #59

Merged
merged 1 commit into from
Sep 20, 2024
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/light-items-trade.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@everipedia/iq-login": minor
---

Updates login component to use shadcn
40 changes: 22 additions & 18 deletions src/components/Login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,32 @@ import { ConnectButton } from "@rainbow-me/rainbowkit";
import { SignTokenButton } from "./SignTokenButton";

interface LoginProps {
title: string;
description: string;
title?: string;
description?: string;
connectText?: string;
signTokenText?: string;
handleRedirect?: () => void;
}

export const Login = ({ title, description, handleRedirect }: 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",
handleRedirect,
}: LoginProps) => {
return (
<div className="grid min-h-[calc(100vh-250px)] place-items-center py-4 md:p-4">
<div className="max-w-xl w-full text-center">
<h1 className="mb-4 text-4xl font-bold">{title}</h1>
<p className="mb-8 text-lg text-gray-500 dark:text-alpha-900">
{description}
</p>
<div className="mt-8 rounded-md border bg-gray-100 dark:border-gray-500 dark:bg-gray-700">
<div className="flex flex-col items-center p-4">
<h2 className="mb-4 text-xl">Step 1: Connect your wallet</h2>
<ConnectButton showBalance />
</div>
<div className="flex flex-col items-center border-t p-4 dark:border-gray-500">
<h2 className="mb-4 text-xl">Step 2: Authenticate your wallet</h2>
<SignTokenButton handleRedirect={() => handleRedirect?.()} />
</div>
<div className="max-w-xl w-full text-center">
<h1 className="mb-4 text-4xl font-bold">{title}</h1>
<p className="mb-8 text-lg text-muted-foreground">{description}</p>
<div className="mt-8 rounded-md border bg-card text-card-foreground">
<div className="flex flex-col items-center p-4">
<h2 className="mb-4 text-xl">{connectText}</h2>
<ConnectButton showBalance />
</div>
<div className="flex flex-col items-center border-t p-4">
<h2 className="mb-4 text-xl">{signTokenText}</h2>
<SignTokenButton handleRedirect={() => handleRedirect?.()} />
</div>
</div>
</div>
Expand Down
Loading