Skip to content

Commit

Permalink
add error
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeldking committed Sep 4, 2024
1 parent a883cd7 commit 276ec2d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
4 changes: 4 additions & 0 deletions app/src/components/nav/Navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ const navLinkCSS = css`
color 0.2s ease-in-out,
background-color 0.2s ease-in-out;
text-decoration: none;
&.active {
color: var(--ac-global-color-grey-1200);
background-color: var(--ac-global-color-primary-300);
Expand All @@ -65,6 +66,9 @@ const navLinkCSS = css`
padding: var(--ac-global-dimension-size-50);
display: inline-block;
}
.ac-text {
white-space: nowrap;
}
`;

const brandCSS = (theme: Theme) => css`
Expand Down
8 changes: 7 additions & 1 deletion app/src/pages/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
ThemeToggle,
TopNavbar,
} from "@phoenix/components/nav";
import { useNotifyError } from "@phoenix/contexts";
import { useFunctionality } from "@phoenix/contexts/FunctionalityContext";

const layoutCSS = css`
Expand Down Expand Up @@ -78,6 +79,7 @@ function SideNav() {
const hasInferences = useMemo(() => {
return window.Config.hasInferences;
}, []);
const notifyError = useNotifyError();
const { authenticationEnabled } = useFunctionality();
const navigate = useNavigate();
const onLogout = useCallback(async () => {
Expand All @@ -87,7 +89,11 @@ function SideNav() {
if (response.ok) {
navigate("/login");
}
}, [navigate]);
notifyError({
title: "Logout Failed",
message: "Failed to log out: " + response.statusText,
});
}, [navigate, notifyError]);
return (
<SideNavbar>
<Brand />
Expand Down

0 comments on commit 276ec2d

Please sign in to comment.