diff --git a/torchci/components/benchmark_v3/pages/BenchmarkListPage.tsx b/torchci/components/benchmark_v3/pages/BenchmarkListPage.tsx
index 83a07e5752..7b7fcb7c4e 100644
--- a/torchci/components/benchmark_v3/pages/BenchmarkListPage.tsx
+++ b/torchci/components/benchmark_v3/pages/BenchmarkListPage.tsx
@@ -23,22 +23,26 @@ export function getBenchmarkMainRouteById(id: string): string | undefined {
export function benchmarkCategoryCardToNavGroup(
categories: BenchmarkCategoryGroup[]
): (NavCategory | NavItem | NavDivider)[] {
- const items: (NavCategory | NavItem)[] = categories
+ const items = categories
.map((c: BenchmarkCategoryGroup) => {
if (c.items.length === 1) {
- const item: NavItem = {
+ const item = {
label: c.items[0].name,
route: c.items[0].route,
- type: "item",
+ type: "item" as const,
};
return item;
}
- const group: NavCategory = {
+ const group = {
label: c.title,
items: c.items
.sort((a, b) => a.name.localeCompare(b.name))
- .map((i) => ({ label: i.name, route: i.route, type: "item" })),
- type: "group",
+ .map((i) => ({
+ label: i.name,
+ route: i.route,
+ type: "item" as const,
+ })),
+ type: "group" as const,
};
return group;
})
@@ -53,10 +57,10 @@ export function benchmarkCategoryCardToNavGroup(
return [
...items,
- { type: "divider" },
+ { type: "divider" as const },
{
label: "View All Benchmarks",
- type: "item",
+ type: "item" as const,
route: "/benchmark/benchmark_list",
},
];
diff --git a/torchci/components/layout/LoginSection.tsx b/torchci/components/layout/LoginSection.tsx
index 8d914394c0..16487d9d36 100644
--- a/torchci/components/layout/LoginSection.tsx
+++ b/torchci/components/layout/LoginSection.tsx
@@ -1,10 +1,10 @@
import QuestionMarkIcon from "@mui/icons-material/QuestionMark";
import SyncIcon from "@mui/icons-material/Sync";
-import { Button as _Button, Menu, MenuItem } from "@mui/material";
+import { Button as _Button, Link } from "@mui/material";
+import { Box } from "@mui/system";
import { signIn, signOut, useSession } from "next-auth/react";
-import Link from "next/link";
-import React from "react";
import styles from "./LoginSection.module.css";
+import { NavBarGroupDropdown, NavItem } from "./NavBarGroupDropdown";
const Button = (props: any) => {
// Make button as small as possible
@@ -13,64 +13,78 @@ const Button = (props: any) => {
export default function LoginSection() {
const { data: session, status } = useSession();
- const [anchorEl, setAnchorEl] = React.useState(null);
- const onClick = (event: any) => {
- setAnchorEl(event.currentTarget);
- };
- const onClose = () => {
- setAnchorEl(null);
- };
- return (
- <>
- {status == "loading" && (
- // Shows up very briefly while api responds
-
- )}
- {status != "loading" && !session?.user && (
-
+
+ ) : (
+ // Hopefully shouldn't get here
+