From 0be503395a4d519407c5b37085c9a363a5055f84 Mon Sep 17 00:00:00 2001 From: shatfield4 Date: Mon, 26 Feb 2024 16:24:50 -0800 Subject: [PATCH] WIP main sidebar designs --- frontend/src/components/Footer/index.jsx | 7 ++ .../src/components/SettingsButton/index.jsx | 17 +++++ .../Sidebar/ActiveWorkspaces/index.jsx | 73 ++++++++++--------- frontend/src/components/Sidebar/index.jsx | 58 +++++---------- frontend/tailwind.config.js | 3 +- 5 files changed, 83 insertions(+), 75 deletions(-) create mode 100644 frontend/src/components/SettingsButton/index.jsx diff --git a/frontend/src/components/Footer/index.jsx b/frontend/src/components/Footer/index.jsx index 26b271a8..4b175405 100644 --- a/frontend/src/components/Footer/index.jsx +++ b/frontend/src/components/Footer/index.jsx @@ -13,6 +13,7 @@ import { LinkSimple, } from "@phosphor-icons/react"; import React, { useEffect, useState } from "react"; +import SettingsButton from "../SettingsButton"; export const MAX_ICONS = 3; export const ICON_COMPONENTS = { @@ -49,6 +50,7 @@ export default function Footer() { @@ -56,6 +58,7 @@ export default function Footer() { @@ -63,6 +66,7 @@ export default function Footer() { + ); @@ -83,6 +88,7 @@ export default function Footer() { key={index} href={item.url} target="_blank" + rel="noreferrer" className="transition-all duration-300 p-2 rounded-full text-white bg-sidebar-button hover:bg-menu-item-selected-gradient hover:border-slate-100 hover:border-opacity-50 border-transparent border" > {React.createElement(ICON_COMPONENTS[item.icon], { @@ -91,6 +97,7 @@ export default function Footer() { })} ))} + ); diff --git a/frontend/src/components/SettingsButton/index.jsx b/frontend/src/components/SettingsButton/index.jsx new file mode 100644 index 00000000..18c7b1a1 --- /dev/null +++ b/frontend/src/components/SettingsButton/index.jsx @@ -0,0 +1,17 @@ +import useUser from "@/hooks/useUser"; +import paths from "@/utils/paths"; +import { Wrench } from "@phosphor-icons/react"; + +export default function SettingsButton() { + const { user } = useUser(); + return ( + + + + ); +} diff --git a/frontend/src/components/Sidebar/ActiveWorkspaces/index.jsx b/frontend/src/components/Sidebar/ActiveWorkspaces/index.jsx index 9ee6a687..467c6eb2 100644 --- a/frontend/src/components/Sidebar/ActiveWorkspaces/index.jsx +++ b/frontend/src/components/Sidebar/ActiveWorkspaces/index.jsx @@ -90,55 +90,58 @@ export default function ActiveWorkspaces() { href={isActive ? null : paths.workspace.chat(workspace.slug)} className={` transition-all duration-[200ms] - flex flex-grow w-[75%] gap-x-2 py-[6px] px-[12px] rounded-lg text-slate-200 justify-start items-center - hover:bg-workspace-item-selected-gradient + flex flex-grow w-[75%] gap-x-2 py-[6px] px-[12px] rounded-[4px] text-slate-200 justify-start items-center + hover:bg-workspace-item-selected-gradient ${ isActive - ? "border-2 bg-workspace-item-selected-gradient border-white" - : "border bg-workspace-item-gradient bg-opacity-60 border-transparent hover:border-slate-100 hover:border-opacity-50" + ? "bg-workspace-item-selected-gradient" + : "border-[2px] border-outline" }`} >

{isActive || isHovered - ? truncate(workspace.name, 17) + ? truncate(workspace.name, 15) : truncate(workspace.name, 20)}

{(isActive || isHovered || gearHover[workspace.id]) && user?.role !== "default" ? ( -
- + onMouseLeave={() => + handleUploadMouseLeave(workspace.id) + } + className="rounded-md flex items-center justify-center text-white ml-auto" + > + + +
handleGearMouseLeave(workspace.id)} className="rounded-md flex items-center justify-center text-white ml-auto" > - +
+ +
) : null} diff --git a/frontend/src/components/Sidebar/index.jsx b/frontend/src/components/Sidebar/index.jsx index d14099b2..0c38eb77 100644 --- a/frontend/src/components/Sidebar/index.jsx +++ b/frontend/src/components/Sidebar/index.jsx @@ -1,14 +1,14 @@ import React, { useEffect, useRef, useState } from "react"; -import { Wrench, Plus, List } from "@phosphor-icons/react"; +import { Plus, List } from "@phosphor-icons/react"; import NewWorkspaceModal, { useNewWorkspaceModal, } from "../Modals/NewWorkspace"; import ActiveWorkspaces from "./ActiveWorkspaces"; -import paths from "@/utils/paths"; import { USER_BACKGROUND_COLOR } from "@/utils/constants"; import useLogo from "@/hooks/useLogo"; import useUser from "@/hooks/useUser"; import Footer from "../Footer"; +import SettingsButton from "../SettingsButton"; export default function Sidebar() { const { user } = useUser(); @@ -21,40 +21,30 @@ export default function Sidebar() { } = useNewWorkspaceModal(); return ( - <> +
+
+ Logo +
- {/* Header Information */} -
-
- Logo -
- {(!user || user?.role !== "default") && ( -
- -
- )} -
- - {/* Primary Body */} -
+
{(!user || user?.role !== "default") && (
{showingNewWsModal && } - +
); } @@ -190,17 +180,3 @@ export function SidebarMobileHeader() { ); } - -function SettingsButton() { - const { user } = useUser(); - return ( - - - - ); -} diff --git a/frontend/tailwind.config.js b/frontend/tailwind.config.js index f3f8aaca..8add5a69 100644 --- a/frontend/tailwind.config.js +++ b/frontend/tailwind.config.js @@ -24,7 +24,8 @@ export default { "sidebar-button": "#31353A", sidebar: "#25272C", "historical-msg-system": "rgba(255, 255, 255, 0.05);", - "historical-msg-user": "#2C2F35" + "historical-msg-user": "#2C2F35", + outline: "#4E5153" }, backgroundImage: { "preference-gradient":