MCPcopy Create free account
hub / github.com/dailydotdev/apps / LoginButton

Function LoginButton

packages/shared/src/components/LoginButton.tsx:35–71  ·  view source on GitHub ↗
({
  className = {},
  size,
}: LoginButtonProps)

Source from the content-addressed store, hash-verified

33});
34
35export default function LoginButton({
36 className = {},
37 size,
38}: LoginButtonProps): ReactElement {
39 const { logEvent } = useLogContext();
40 const { showLogin } = useAuthContext();
41 const onClick = (copy: ButtonCopy) => {
42 logEvent(getLogEvent(copy));
43 showLogin({
44 trigger: AuthTriggers.MainButton,
45 options: {
46 isLogin: copy === ButtonCopy.Login,
47 },
48 });
49 };
50
51 return (
52 <span className={classNames('flex flex-row', className?.container)}>
53 <Button
54 onClick={() => onClick(ButtonCopy.Login)}
55 variant={ButtonVariant.Secondary}
56 size={size}
57 className={className?.button}
58 >
59 {ButtonCopy.Login}
60 </Button>
61 <Button
62 onClick={() => onClick(ButtonCopy.Signup)}
63 variant={ButtonVariant.Primary}
64 size={size}
65 className={className?.button}
66 >
67 {ButtonCopy.Signup}
68 </Button>
69 </span>
70 );
71}

Callers

nothing calls this directly

Calls 3

useLogContextFunction · 0.90
useAuthContextFunction · 0.90
onClickFunction · 0.70

Tested by

no test coverage detected