update sidebar with new styling
This commit is contained in:
@@ -3,6 +3,11 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<link rel="icon" type="image/png" href="/small_icon.png" />
|
<link rel="icon" type="image/png" href="/small_icon.png" />
|
||||||
|
|
||||||
|
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||||
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||||
|
<link href="https://fonts.googleapis.com/css2?family=Newsreader:wght@100;200;300;400;500;600;700&family=IBM+Plex+Sans:wght@100;200;300;400;500;600;700&family=IBM+Plex+Mono:wght@100;200;300;400;500;600;700&display=swap" rel="stylesheet">
|
||||||
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<title>The VoD System</title>
|
<title>The VoD System</title>
|
||||||
</head>
|
</head>
|
||||||
|
|||||||
@@ -8,43 +8,43 @@ type props = {
|
|||||||
className?: string
|
className?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
const Divider = () => <hr className="my-1.5 mx-2 border-gray-100" />;
|
const Divider = () => <hr className="w-full my-1.5 mx-2 border-hover" />;
|
||||||
|
|
||||||
const Sidebar = ({user, className}: props) => {
|
const Sidebar = ({user, className}: props) => {
|
||||||
return (
|
return (
|
||||||
<aside className={clsx("h-screen flex flex-col bg-white border-r border-gray-200", className)}>
|
<aside className={clsx("h-screen flex flex-col bg-sidebar border-r border-hairline p-2 items-center gap-1", className)}>
|
||||||
<div className="px-4 pt-5 pb-3">
|
<h2 className={"font-heading text-3xl"}>The VoD System</h2>
|
||||||
<img
|
|
||||||
className="w-36 mx-auto"
|
<nav className="flex flex-col flex-1 items-center w-3/4">
|
||||||
src="../../public/logo.png"
|
<Divider />
|
||||||
alt="VoD System Logo"
|
|
||||||
/>
|
<div className="flex flex-col gap-0.5 w-full">
|
||||||
</div>
|
|
||||||
<nav className="flex flex-col flex-1 px-2 pb-4">
|
|
||||||
<div className="flex flex-col gap-0.5">
|
|
||||||
<SidebarButton url="/" logo={<Home size={18}/>} label="Home" />
|
<SidebarButton url="/" logo={<Home size={18}/>} label="Home" />
|
||||||
<SidebarButton url="/create" logo={<Plus size={18}/>} label="Create Clip" />
|
<SidebarButton url="/create" logo={<Plus size={18}/>} label="Create Clip" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<Divider />
|
||||||
|
|
||||||
{user && (
|
{user && (
|
||||||
<>
|
<div className="flex flex-col gap-0.5 w-full">
|
||||||
<Divider />
|
<div>
|
||||||
<div className="flex flex-col gap-0.5">
|
<SidebarButton url="/stream" logo={<Radio size={18}/>} label="Stream" />
|
||||||
<SidebarButton url="/stream" logo={<Radio size={18}/>} label="Stream" />
|
<SidebarButton url="/my-clips" logo={<Film size={18}/>} label="Clips" />
|
||||||
<SidebarButton url="/my-clips" logo={<Film size={18}/>} label="Clips" />
|
<SidebarButton url="/my-vods" logo={<Video size={18}/>} label="VoDs" />
|
||||||
<SidebarButton url="/my-vods" logo={<Video size={18}/>} label="VoDs" />
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</>
|
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<div className="flex-1" />
|
<div className="flex-1" />
|
||||||
|
|
||||||
{user && (
|
<div className={"w-full"}>
|
||||||
<>
|
{user && (
|
||||||
<Divider />
|
<>
|
||||||
<SidebarButton url="/profile" logo={<UserIcon size={18}/>} label="Profile" />
|
<Divider />
|
||||||
</>
|
<SidebarButton url="/profile" logo={<UserIcon size={18}/>} label="Profile" />
|
||||||
)}
|
</>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
</aside>
|
</aside>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import MenuButton from "./MenuButton.tsx";
|
|
||||||
import { Link, useLocation } from "react-router-dom";
|
import { Link, useLocation } from "react-router-dom";
|
||||||
|
import React from "react";
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
url: string;
|
url: string;
|
||||||
@@ -13,11 +13,17 @@ const SidebarButton = ({url, logo, label}: Props) => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Link className="w-full" to={url}>
|
<Link className="w-full" to={url}>
|
||||||
<MenuButton className={`flex items-center gap-2.5 w-full px-3 py-2 text-sm font-medium rounded-md ${isActive ? "bg-gray-100 text-gray-900" : "text-gray-600"}`}>
|
<button className={`flex items-center gap-2.5 w-full text-sm
|
||||||
|
font-body p-2 hover:bg-hover hover:text-text-strong
|
||||||
|
rounded-md
|
||||||
|
${isActive ?
|
||||||
|
"bg-card text-text-strong font-medium shadow-sm"
|
||||||
|
:
|
||||||
|
"text-text-primary"}`}>
|
||||||
{logo}{label}
|
{logo}{label}
|
||||||
</MenuButton>
|
</button>
|
||||||
</Link>
|
</Link>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
export default SidebarButton;
|
export default SidebarButton;
|
||||||
@@ -15,6 +15,10 @@
|
|||||||
--color-text-primary: #2B2620;
|
--color-text-primary: #2B2620;
|
||||||
--color-text-strong: #35302A;
|
--color-text-strong: #35302A;
|
||||||
--color-text-body: #554D44;
|
--color-text-body: #554D44;
|
||||||
|
|
||||||
|
/* ── Lines, chips, placeholders ──────────────────────────────────────── */
|
||||||
|
--color-hairline: #F0EBE2;
|
||||||
|
--color-hover: #E7E0D2;
|
||||||
}
|
}
|
||||||
|
|
||||||
:root {
|
:root {
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ const MainLayout = () => {
|
|||||||
}, [user]);
|
}, [user]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={`transition-all duration-300 grid h-screen ${sidebarToggled ? "grid-cols-[0px_1fr]" : "grid-cols-[240px_1fr]"} grid-rows-[auto_1fr]`}>
|
<div className={`transition-all duration-300 grid h-screen ${sidebarToggled ? "grid-cols-[0px_1fr]" : "grid-cols-[252px_1fr]"} grid-rows-[auto_1fr]`}>
|
||||||
<Sidebar
|
<Sidebar
|
||||||
user={user}
|
user={user}
|
||||||
className={`row-span-2 transition-all duration-300 overflow-hidden whitespace-nowrap ${sidebarToggled ? "-translate-x-full" : "translate-x-0"}`}/>
|
className={`row-span-2 transition-all duration-300 overflow-hidden whitespace-nowrap ${sidebarToggled ? "-translate-x-full" : "translate-x-0"}`}/>
|
||||||
|
|||||||
1
frontend/src/vite-env.d.ts
vendored
Normal file
1
frontend/src/vite-env.d.ts
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
/// <reference types="vite/client" />
|
||||||
Reference in New Issue
Block a user