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

Function LoginButton

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 3

useLogContextFunction · 0.90
useAuthContextFunction · 0.90
onClickFunction · 0.70

Tested by

no test coverage detected