a tool for shared writing and social publishing
1"use client";
2import { useIdentityData } from "./IdentityProvider";
3import { Popover } from "./Popover";
4import LoginForm from "app/login/LoginForm";
5import { ButtonPrimary } from "./Buttons";
6import { ActionButton } from "./ActionBar/ActionButton";
7import { AccountSmall } from "./Icons/AccountSmall";
8
9export function LoginButton() {
10 let identityData = useIdentityData();
11 if (identityData.identity) return null;
12 return (
13 <Popover
14 asChild
15 trigger={
16 <ButtonPrimary className="place-self-start text-sm">
17 Log In!
18 </ButtonPrimary>
19 }
20 >
21 <LoginForm text="Save your Leaflets and access them on multiple devices!" />
22 </Popover>
23 );
24}
25
26export function LoginActionButton() {
27 let identityData = useIdentityData();
28 if (identityData.identity) return null;
29 return (
30 <Popover
31 asChild
32 align="start"
33 side="right"
34 trigger={
35 <ActionButton secondary icon={<AccountSmall />} label="Sign In" />
36 }
37 >
38 <LoginForm text="Save your Leaflets and access them on multiple devices!" />
39 </Popover>
40 );
41}