Skip to content

Commit

Permalink
feat: add sign in button to explorer
Browse files Browse the repository at this point in the history
  • Loading branch information
dominik-stumpf committed Nov 21, 2024
1 parent 2b19a9a commit 8d5830f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 20 deletions.
11 changes: 2 additions & 9 deletions src/app/explorer/page.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { AuthBoundary } from "@/components/AuthBoundary";
import { GuildCardSkeleton } from "@/components/GuildCard";
import { GuildCard } from "@/components/GuildCard";
import { Button } from "@/components/ui/Button";
import { SignInButton } from "@/components/SignInButton";
import { env } from "@/lib/env";
import { SignIn } from "@phosphor-icons/react/dist/ssr";
import {
HydrationBoundary,
QueryClient,
Expand Down Expand Up @@ -79,13 +78,7 @@ async function YourGuildsSection() {
Sign in to view your guilds or create new ones
</p>

<Button
colorScheme="primary"
leftIcon={<SignIn weight="bold" />}
className="ml-auto h-10"
>
Sign in
</Button>
<SignInButton className="ml-auto" />
</div>
}
>
Expand Down
27 changes: 16 additions & 11 deletions src/components/SignInButton.tsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,28 @@
"use client";

import { signInDialogOpenAtom } from "@/config/atoms";
import { cn } from "@/lib/cssUtils";
import { SignIn } from "@phosphor-icons/react/dist/ssr";
import { useSetAtom } from "jotai";
import type { ComponentProps } from "react";
import { Button } from "./ui/Button";
import { Card } from "./ui/Card";

export const SignInButton = () => {
export const SignInButton = ({
className,
...props
}: ComponentProps<typeof Button>) => {
const setSignInDialogOpen = useSetAtom(signInDialogOpenAtom);

return (
<Card className="rounded-xl">
<Button
className="h-10"
leftIcon={<SignIn weight="bold" />}
onClick={() => setSignInDialogOpen(true)}
>
Sign in
</Button>
</Card>
<Button
className={cn("h-10", className)}
variant="solid"
colorScheme="primary"
{...props}
leftIcon={<SignIn weight="bold" />}
onClick={() => setSignInDialogOpen(true)}
>
Sign in
</Button>
);
};

0 comments on commit 8d5830f

Please sign in to comment.