Skip to content

Commit

Permalink
fixed fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
farzaank committed Oct 25, 2023
1 parent f243749 commit 02f3ec4
Show file tree
Hide file tree
Showing 5 changed files with 392 additions and 392 deletions.
32 changes: 16 additions & 16 deletions src/helm-frontend/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,20 @@ import Runs from "@/routes/Runs";
import Run from "@/routes/Run";
import LegacyLanding from "@/routes/LegacyLanding";
export default function App() {
return (
<Router>
<Routes>
<Route element={<Layout />}>
<Route path={"/"} element={<Home />} />
<Route path="/models" element={<Models />} />
<Route path="/landing" element={<LegacyLanding />} />
<Route path="/scenarios" element={<Scenarios />} />
<Route path="/groups" element={<Groups />} />
<Route path="/groups/:groupName" element={<Group />} />
<Route path="/runs" element={<Runs />} />
<Route path="/runs/:runName" element={<Run />} />
</Route>
</Routes>
</Router>
);
return (
<Router>
<Routes>
<Route element={<Layout />}>
<Route path={"/"} element={<Home />} />
<Route path="/models" element={<Models />} />
<Route path="/landing" element={<LegacyLanding />} />
<Route path="/scenarios" element={<Scenarios />} />
<Route path="/groups" element={<Groups />} />
<Route path="/groups/:groupName" element={<Group />} />
<Route path="/runs" element={<Runs />} />
<Route path="/runs/:runName" element={<Run />} />
</Route>
</Routes>
</Router>
);
}
110 changes: 55 additions & 55 deletions src/helm-frontend/src/components/NavBar/NavBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,59 +5,59 @@ import crfmLogo from "@/assets/crfm-logo.png";
import NavDropdown from "@/components/NavDropdown";

export default function NavBar() {
return (
<nav className="navbar h-24 px-8 md:px-12 bg-base-100 max-w[1500]px">
<div>
<div className="dropdown md:hidden mr-4">
<label
tabIndex={0}
className="btn btn-ghost hover:bg-transparent btn-lg px-0"
>
<Bars3Icon className="w-16 h-16" />
</label>
<ul
tabIndex={0}
className="menu menu-lg dropdown-content mt-3 z-[1] p-2 bg-base-100 shadow"
>
<li>
<Link to="models">Models</Link>
</li>
<li>
<Link to="scenarios">Scenarios</Link>
</li>
<li>
<Link to="groups">Results</Link>
</li>
<li>
<Link to="runs" className="whitespace-nowrap">
Raw Runs
</Link>
</li>
</ul>
</div>
</div>
<div className="flex-1 items-center">
<Link to="https://crfm.stanford.edu/" className="w-24">
<img src={crfmLogo} className="object-contain" />
</Link>
<NavDropdown></NavDropdown>
</div>
<div className="flex-none hidden md:block">
<ul className="flex flex-row gap-6 px-1">
<li>
<Link to="models">Models</Link>
</li>
<li>
<Link to="scenarios">Scenarios</Link>
</li>
<li>
<Link to="groups">Results</Link>
</li>
<li>
<Link to="runs">Raw Runs</Link>
</li>
</ul>
</div>
</nav>
);
return (
<nav className="navbar h-24 px-8 md:px-12 bg-base-100 max-w[1500]px">
<div>
<div className="dropdown md:hidden mr-4">
<label
tabIndex={0}
className="btn btn-ghost hover:bg-transparent btn-lg px-0"
>
<Bars3Icon className="w-16 h-16" />
</label>
<ul
tabIndex={0}
className="menu menu-lg dropdown-content mt-3 z-[1] p-2 bg-base-100 shadow"
>
<li>
<Link to="models">Models</Link>
</li>
<li>
<Link to="scenarios">Scenarios</Link>
</li>
<li>
<Link to="groups">Results</Link>
</li>
<li>
<Link to="runs" className="whitespace-nowrap">
Raw Runs
</Link>
</li>
</ul>
</div>
</div>
<div className="flex-1 items-center">
<Link to="https://crfm.stanford.edu/" className="w-24">
<img src={crfmLogo} className="object-contain" />
</Link>
<NavDropdown></NavDropdown>
</div>
<div className="flex-none hidden md:block">
<ul className="flex flex-row gap-6 px-1">
<li>
<Link to="models">Models</Link>
</li>
<li>
<Link to="scenarios">Scenarios</Link>
</li>
<li>
<Link to="groups">Results</Link>
</li>
<li>
<Link to="runs">Raw Runs</Link>
</li>
</ul>
</div>
</nav>
);
}
138 changes: 69 additions & 69 deletions src/helm-frontend/src/components/NavDropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,78 +2,78 @@ import { useState } from "react";
import { Link } from "react-router-dom";

function NavDropdown() {
const [dropdownOpen, setDropdownOpen] = useState(false);
const [dropdownOpen, setDropdownOpen] = useState(false);

return (
<div className="relative inline-block text-left p-2">
<div className="inline-flex items-center p-2">
<Link to="/">
<img
src="https://crfm.stanford.edu/helm/v0.3.0/images/helm-logo-simple.png"
alt="Image 1"
className="w-full h-10 object-cover"
/>
</Link>
return (
<div className="relative inline-block text-left p-2">
<div className="inline-flex items-center p-2">
<Link to="/">
<img
src="https://crfm.stanford.edu/helm/v0.3.0/images/helm-logo-simple.png"
alt="Image 1"
className="w-full h-10 object-cover"
/>
</Link>

{/* Chevron Button */}
<button
onClick={() => setDropdownOpen(!dropdownOpen)}
className="inline-flex items-center justify-center focus:outline-none focus-visible:ring-2 focus-visible:ring-white focus-visible:ring-opacity-75"
>
<svg
xmlns="http://www.w3.org/2000/svg"
className="h-6 w-6 ml-2"
fill="none"
viewBox="0 0 24 24"
stroke="currentColor"
>
<path
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth={2}
d="M19 9l-7 7-7-7"
/>
</svg>
</button>
</div>
{/* Chevron Button */}
<button
onClick={() => setDropdownOpen(!dropdownOpen)}
className="inline-flex items-center justify-center focus:outline-none focus-visible:ring-2 focus-visible:ring-white focus-visible:ring-opacity-75"
>
<svg
xmlns="http://www.w3.org/2000/svg"
className="h-6 w-6 ml-2"
fill="none"
viewBox="0 0 24 24"
stroke="currentColor"
>
<path
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth={2}
d="M19 9l-7 7-7-7"
/>
</svg>
</button>
</div>

{dropdownOpen && (
<div className="absolute right-0 mt-2 w-56 rounded-md shadow-lg bg-white ring-1 ring-black ring-opacity-5">
<div
className="py-1"
role="menu"
aria-orientation="vertical"
aria-labelledby="options-menu"
>
<div
className="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 hover:text-gray-900"
role="menuitem"
>
<Link to="/">
<img
src="https://crfm.stanford.edu/helm/v0.3.0/images/helm-logo-simple.png"
alt="Image 1"
className="w-full h-12 object-cover"
/>
</Link>
</div>
<div
className="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 hover:text-gray-900"
role="menuitem"
>
<Link to="https://crfm.stanford.edu/heim/latest/?">
<img
src="https://crfm.stanford.edu/heim/latest/images/heim-logo.png"
alt="Image 2"
className="w-full h-12 object-cover"
/>
</Link>
</div>
</div>
</div>
)}
</div>
);
{dropdownOpen && (
<div className="absolute right-0 mt-2 w-56 rounded-md shadow-lg bg-white ring-1 ring-black ring-opacity-5">
<div
className="py-1"
role="menu"
aria-orientation="vertical"
aria-labelledby="options-menu"
>
<div
className="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 hover:text-gray-900"
role="menuitem"
>
<Link to="/">
<img
src="https://crfm.stanford.edu/helm/v0.3.0/images/helm-logo-simple.png"
alt="Image 1"
className="w-full h-12 object-cover"
/>
</Link>
</div>
<div
className="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 hover:text-gray-900"
role="menuitem"
>
<Link to="https://crfm.stanford.edu/heim/latest/?">
<img
src="https://crfm.stanford.edu/heim/latest/images/heim-logo.png"
alt="Image 2"
className="w-full h-12 object-cover"
/>
</Link>
</div>
</div>
</div>
)}
</div>
);
}

export default NavDropdown;
Loading

0 comments on commit 02f3ec4

Please sign in to comment.