Files
artcraft/app/modules/TopBar/AuthButtons.tsx
T
BFlat 3c28b375ef many small changes (#298)
changes from trello board:
- AI stylize in side tab primary colored + icon change to draw attention
- AI stylize tab subtext "This helps you test and re-test your scene"
- AI stylize tab prompt textarea row reduction to fit as much content as
possible without going under the fold on smaller screens
- Logout button changed to secondary color from primary so it's not
attracting.
- Git SHA in help panel text changes
- fixes to topbar stylings and spacing
2024-05-02 11:06:50 -04:00

39 lines
1.0 KiB
TypeScript

import { useContext } from "react";
import { useSignals } from "@preact/signals-react/runtime";
import { AUTH_STATUS, AuthenticationContext } from "~/contexts/Authentication";
import { Button, ButtonLink } from "~/components";
import { DialogueInference } from "../DialogueInference";
import { faRightFromBracket } from "@fortawesome/pro-solid-svg-icons";
export const AuthButtons = () => {
useSignals();
const { authState, logout } = useContext(AuthenticationContext);
const handleLogout = () => {
if (logout) logout();
};
if (authState && authState.authStatus === AUTH_STATUS.LOGGED_IN) {
return (
<>
<DialogueInference />
<Button
onClick={handleLogout}
variant="secondary"
icon={faRightFromBracket}>
Logout
</Button>
</>
);
} else {
return (
<>
<ButtonLink variant="secondary" to="/login">
Login
</ButtonLink>
<ButtonLink to="/signup">Sign Up</ButtonLink>
</>
);
}
};