diff --git a/frontend/src/components/DefaultChat/index.jsx b/frontend/src/components/DefaultChat/index.jsx index 8bc6c7cb7..a20e323bd 100644 --- a/frontend/src/components/DefaultChat/index.jsx +++ b/frontend/src/components/DefaultChat/index.jsx @@ -335,7 +335,7 @@ export default function DefaultChatContainer() { return (
{isMobile && } {fetchedMessages.length === 0 diff --git a/frontend/src/components/Footer/index.jsx b/frontend/src/components/Footer/index.jsx index 26b271a8c..fc51dde71 100644 --- a/frontend/src/components/Footer/index.jsx +++ b/frontend/src/components/Footer/index.jsx @@ -1,6 +1,5 @@ import System from "@/models/system"; import paths from "@/utils/paths"; -import { safeJsonParse } from "@/utils/request"; import { BookOpen, DiscordLogo, @@ -13,6 +12,8 @@ import { LinkSimple, } from "@phosphor-icons/react"; import React, { useEffect, useState } from "react"; +import SettingsButton from "../SettingsButton"; +import { isMobile } from "react-device-detect"; export const MAX_ICONS = 3; export const ICON_COMPONENTS = { @@ -44,11 +45,12 @@ export default function Footer() { if (!Array.isArray(footerData) || footerData.length === 0) { return ( -
+
@@ -56,6 +58,7 @@ export default function Footer() { @@ -63,6 +66,7 @@ export default function Footer() { + {!isMobile && }
); } return ( -
+
); diff --git a/frontend/src/components/SettingsButton/index.jsx b/frontend/src/components/SettingsButton/index.jsx new file mode 100644 index 000000000..0903862db --- /dev/null +++ b/frontend/src/components/SettingsButton/index.jsx @@ -0,0 +1,31 @@ +import useUser from "@/hooks/useUser"; +import paths from "@/utils/paths"; +import { ArrowUUpLeft, Wrench } from "@phosphor-icons/react"; +import { Link } from "react-router-dom"; +import { useMatch } from "react-router-dom"; + +export default function SettingsButton() { + const isInSettings = !!useMatch("/settings/*"); + const { user } = useUser(); + + if (user && user?.role === "default") return null; + + if (isInSettings) + return ( + + + + ); + + return ( + + + + ); +} diff --git a/frontend/src/components/SettingsSidebar/index.jsx b/frontend/src/components/SettingsSidebar/index.jsx index ea4887114..112b641bf 100644 --- a/frontend/src/components/SettingsSidebar/index.jsx +++ b/frontend/src/components/SettingsSidebar/index.jsx @@ -13,7 +13,6 @@ import { Database, Lock, House, - X, List, FileCode, Plugs, @@ -25,6 +24,7 @@ import useUser from "@/hooks/useUser"; import { USER_BACKGROUND_COLOR } from "@/utils/constants"; import { isMobile } from "react-device-detect"; import Footer from "../Footer"; +import { Link } from "react-router-dom"; export default function SettingsSidebar() { const { logo } = useLogo(); @@ -112,9 +112,7 @@ export default function SettingsSidebar() {
-
-
-
+
@@ -124,50 +122,38 @@ export default function SettingsSidebar() { } return ( - <> +
+ + Logo +
-
- {/* Header Information */} -
-
- Logo -
-
- - - -
+
+
+ Instance Settings
-
- Settings -
- {/* Primary Body */} -
+
- {/* Options */}
-
-
-
+
- +
); } @@ -195,24 +181,25 @@ const Option = ({ return ( <> -
- + {React.cloneElement(icon, { weight: isActive ? "fill" : "regular" })} -

+

{btnText}

-
+
{!!subOptions && (isActive || hasActiveChild) && (
{ async function getWorkspaces() { @@ -90,55 +91,60 @@ 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-white justify-start items-center + hover:bg-workspace-item-selected-gradient border-outline ${ 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 font-medium border-none" + : "border-[1px]" }`} >

{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 ml-auto" + > + + +
handleGearMouseEnter(workspace.id)} onMouseLeave={() => handleGearMouseLeave(workspace.id)} - className="rounded-md flex items-center justify-center text-white ml-auto" + className="rounded-md flex items-center justify-center text-[#A7A8A9] hover:text-white ml-auto" > - +
+ +
) : null} diff --git a/frontend/src/components/Sidebar/index.jsx b/frontend/src/components/Sidebar/index.jsx index d14099b2b..75c854d90 100644 --- a/frontend/src/components/Sidebar/index.jsx +++ b/frontend/src/components/Sidebar/index.jsx @@ -1,14 +1,16 @@ 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"; +import { Link } from "react-router-dom"; +import paths from "@/utils/paths"; export default function Sidebar() { const { user } = useUser(); @@ -21,40 +23,33 @@ export default function Sidebar() { } = useNewWorkspaceModal(); return ( - <> +
+ + Logo +
- {/* Header Information */} -
-
- Logo -
- {(!user || user?.role !== "default") && ( -
- -
- )} -
- - {/* Primary Body */} -
+
{(!user || user?.role !== "default") && (
{showingNewWsModal && } - +
); } @@ -149,11 +144,9 @@ export function SidebarMobileHeader() { style={{ objectFit: "contain" }} />
- {(!user || user?.role !== "default") && ( -
- -
- )} +
+ +
{/* Primary Body */} @@ -190,17 +183,3 @@ export function SidebarMobileHeader() { ); } - -function SettingsButton() { - const { user } = useUser(); - return ( - - - - ); -} diff --git a/frontend/src/components/UserMenu/UserButton/index.jsx b/frontend/src/components/UserMenu/UserButton/index.jsx index 99db94411..28730bfb0 100644 --- a/frontend/src/components/UserMenu/UserButton/index.jsx +++ b/frontend/src/components/UserMenu/UserButton/index.jsx @@ -61,7 +61,7 @@ export default function UserButton() { type="button" className="uppercase transition-all duration-300 w-[35px] h-[35px] text-base font-semibold rounded-full flex items-center bg-sidebar-button hover:bg-menu-item-selected-gradient justify-center text-white p-2 hover:border-slate-100 hover:border-opacity-50 border-transparent border" > - {mode === "multi" ? userDisplay() : } + {mode === "multi" ? : } {showMenu && ( @@ -109,7 +109,7 @@ export default function UserButton() { ); } -function userDisplay() { +function UserDisplay() { const { pfp } = usePfp(); const user = userFromStorage(); diff --git a/frontend/src/components/WorkspaceChat/ChatContainer/index.jsx b/frontend/src/components/WorkspaceChat/ChatContainer/index.jsx index 8a99a62a2..293da491f 100644 --- a/frontend/src/components/WorkspaceChat/ChatContainer/index.jsx +++ b/frontend/src/components/WorkspaceChat/ChatContainer/index.jsx @@ -108,7 +108,7 @@ export default function ChatContainer({ workspace, knownHistory = [] }) { return (
{isMobile && }
diff --git a/frontend/src/pages/Admin/Invitations/index.jsx b/frontend/src/pages/Admin/Invitations/index.jsx index a4a99e93b..31b2b7923 100644 --- a/frontend/src/pages/Admin/Invitations/index.jsx +++ b/frontend/src/pages/Admin/Invitations/index.jsx @@ -18,7 +18,7 @@ export default function AdminInvites() {
diff --git a/frontend/src/pages/Admin/Logging/index.jsx b/frontend/src/pages/Admin/Logging/index.jsx index 246cf2110..f405c9a68 100644 --- a/frontend/src/pages/Admin/Logging/index.jsx +++ b/frontend/src/pages/Admin/Logging/index.jsx @@ -30,7 +30,7 @@ export default function AdminLogs() {
diff --git a/frontend/src/pages/Admin/System/index.jsx b/frontend/src/pages/Admin/System/index.jsx index c561efd2e..9fe4c7183 100644 --- a/frontend/src/pages/Admin/System/index.jsx +++ b/frontend/src/pages/Admin/System/index.jsx @@ -43,7 +43,7 @@ export default function AdminSystem() {
diff --git a/frontend/src/pages/Admin/Workspaces/index.jsx b/frontend/src/pages/Admin/Workspaces/index.jsx index 62a28094b..fa612af12 100644 --- a/frontend/src/pages/Admin/Workspaces/index.jsx +++ b/frontend/src/pages/Admin/Workspaces/index.jsx @@ -18,7 +18,7 @@ export default function AdminWorkspaces() {
diff --git a/frontend/src/pages/GeneralSettings/ApiKeys/index.jsx b/frontend/src/pages/GeneralSettings/ApiKeys/index.jsx index 9ba3335f5..606dbf0f5 100644 --- a/frontend/src/pages/GeneralSettings/ApiKeys/index.jsx +++ b/frontend/src/pages/GeneralSettings/ApiKeys/index.jsx @@ -20,7 +20,7 @@ export default function AdminApiKeys() {
diff --git a/frontend/src/pages/GeneralSettings/Appearance/index.jsx b/frontend/src/pages/GeneralSettings/Appearance/index.jsx index 9aed853b2..c2311a2c3 100644 --- a/frontend/src/pages/GeneralSettings/Appearance/index.jsx +++ b/frontend/src/pages/GeneralSettings/Appearance/index.jsx @@ -11,7 +11,7 @@ export default function Appearance() {
diff --git a/frontend/src/pages/GeneralSettings/Chats/index.jsx b/frontend/src/pages/GeneralSettings/Chats/index.jsx index aeb341c1b..5afde115d 100644 --- a/frontend/src/pages/GeneralSettings/Chats/index.jsx +++ b/frontend/src/pages/GeneralSettings/Chats/index.jsx @@ -90,7 +90,7 @@ export default function WorkspaceChats() {
diff --git a/frontend/src/pages/GeneralSettings/EmbedChats/index.jsx b/frontend/src/pages/GeneralSettings/EmbedChats/index.jsx index 23c5bf189..d6079f391 100644 --- a/frontend/src/pages/GeneralSettings/EmbedChats/index.jsx +++ b/frontend/src/pages/GeneralSettings/EmbedChats/index.jsx @@ -14,7 +14,7 @@ export default function EmbedChats() {
diff --git a/frontend/src/pages/GeneralSettings/EmbedConfigs/index.jsx b/frontend/src/pages/GeneralSettings/EmbedConfigs/index.jsx index 4257b029f..73a2ca6db 100644 --- a/frontend/src/pages/GeneralSettings/EmbedConfigs/index.jsx +++ b/frontend/src/pages/GeneralSettings/EmbedConfigs/index.jsx @@ -17,7 +17,7 @@ export default function EmbedConfigs() {
diff --git a/frontend/src/pages/GeneralSettings/Security/index.jsx b/frontend/src/pages/GeneralSettings/Security/index.jsx index 26d408684..298a81ad7 100644 --- a/frontend/src/pages/GeneralSettings/Security/index.jsx +++ b/frontend/src/pages/GeneralSettings/Security/index.jsx @@ -13,7 +13,7 @@ export default function GeneralSecurity() {
diff --git a/frontend/src/pages/GeneralSettings/VectorDatabase/index.jsx b/frontend/src/pages/GeneralSettings/VectorDatabase/index.jsx index e5eacaea7..36242d146 100644 --- a/frontend/src/pages/GeneralSettings/VectorDatabase/index.jsx +++ b/frontend/src/pages/GeneralSettings/VectorDatabase/index.jsx @@ -165,7 +165,7 @@ export default function GeneralVectorDatabase() { {loading ? (
@@ -174,7 +174,7 @@ export default function GeneralVectorDatabase() { ) : (
}
- +