udpate to headers (#1864)

This commit is contained in:
pablodanswer 2024-07-19 08:38:54 -07:00 committed by GitHub
parent 5d98421ae8
commit 27d5f69427
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 27 additions and 25 deletions

View File

@ -9,7 +9,7 @@ import { Folder } from "@/app/chat/folders/interfaces";
import { User } from "@/lib/types";
import { Persona } from "@/app/admin/assistants/interfaces";
import Cookies from "js-cookie";
import { SIDEBAR_TOGGLED_COOKIE_NAME } from "@/components/resizable/contants";
import { SIDEBAR_TOGGLED_COOKIE_NAME } from "@/components/resizable/constants";
import { ReactNode, useEffect, useRef, useState } from "react";
import { useSidebarVisibility } from "@/components/chat_search/hooks";
import FunctionalHeader from "@/components/chat_search/Header";

View File

@ -72,7 +72,7 @@ import { ChatBanner } from "./ChatBanner";
import FunctionalHeader from "@/components/chat_search/Header";
import { useSidebarVisibility } from "@/components/chat_search/hooks";
import { SIDEBAR_TOGGLED_COOKIE_NAME } from "@/components/resizable/contants";
import { SIDEBAR_TOGGLED_COOKIE_NAME } from "@/components/resizable/constants";
import FixedLogo from "./shared_chat_search/FixedLogo";
const TEMP_USER_MESSAGE_ID = -1;

View File

@ -30,7 +30,7 @@ import {
} from "@/lib/assistants/fetchAssistantsSS";
import FunctionalWrapper from "../chat/shared_chat_search/FunctionalWrapper";
import { ChatSession } from "../chat/interfaces";
import { SIDEBAR_TOGGLED_COOKIE_NAME } from "@/components/resizable/contants";
import { SIDEBAR_TOGGLED_COOKIE_NAME } from "@/components/resizable/constants";
import ToggleSearch from "./WrappedSearch";
import {
AGENTIC_SEARCH_TYPE_COOKIE_NAME,

View File

@ -329,17 +329,10 @@ export async function Layout({ children }: { children: React.ReactNode }) {
/>
</div>
<div className="pb-8 relative h-full overflow-y-auto w-full">
<div className="fixed bg-background left-0 border-b gap-x-4 mb-8 px-4 py-2 w-full items-center flex justify-end">
<a
href="/chat"
className="transition-all duration-150 cursor-pointer p-1 text-sm items-center flex gap-x-1 px-2 py-1 rounded-lg hover:shadow-sm hover:ring-1 hover:ring-ingio-900/40 hover:bg-opacity-90 text-neutral-100 bg-accent"
>
<BackIcon size={20} className="text-neutral" />
Back to Danswer
</a>
<div className="fixed bg-background left-0 gap-x-4 mb-8 px-4 py-2 w-full items-center flex justify-end">
<UserDropdown user={user} />
</div>
<div className="pt-20 flex overflow-y-auto h-full px-4 md:px-12">
<div className="pt-12 flex overflow-y-auto h-full px-4 md:px-12">
{children}
</div>
</div>

View File

@ -6,6 +6,7 @@ import { Logo } from "@/components/Logo";
import { NEXT_PUBLIC_DO_NOT_USE_TOGGLE_OFF_DANSWER_POWERED } from "@/lib/constants";
import { HeaderTitle } from "@/components/header/Header";
import { SettingsContext } from "@/components/settings/SettingsProvider";
import { BackIcon } from "@/components/icons/icons";
interface Item {
name: string | JSX.Element;
@ -62,6 +63,12 @@ export function AdminSidebar({ collections }: { collections: Collection[] }) {
</Link>
</div>
</div>
<Link href={"/chat"}>
<button className="text-sm block w-48 py-2.5 flex px-2 text-left bg-background-200 hover:bg-background-200/80 cursor-pointer rounded">
<BackIcon size={20} className="text-neutral" />
<p className="ml-1">Back to Danswer</p>
</button>
</Link>
{collections.map((collection, collectionInd) => (
<div key={collectionInd}>
<h2 className="text-xs text-strong font-bold pb-2">
@ -70,7 +77,7 @@ export function AdminSidebar({ collections }: { collections: Collection[] }) {
{collection.items.map((item) => (
<Link key={item.link} href={item.link}>
<button className="text-sm block w-48 py-2.5 px-2 text-left hover:bg-hover rounded">
<div className="">{item.name}</div>
{item.name}
</button>
</Link>
))}

View File

@ -2,7 +2,7 @@
import React, { useEffect, useState } from "react";
import Cookies from "js-cookie";
import { DOCUMENT_SIDEBAR_WIDTH_COOKIE_NAME } from "./contants";
import { DOCUMENT_SIDEBAR_WIDTH_COOKIE_NAME } from "./constants";
function applyMinAndMax(
width: number,

View File

@ -29,7 +29,7 @@ import { HistorySidebar } from "@/app/chat/sessionSidebar/HistorySidebar";
import { ChatSession, SearchSession } from "@/app/chat/interfaces";
import FunctionalHeader from "../chat_search/Header";
import { useSidebarVisibility } from "../chat_search/hooks";
import { SIDEBAR_TOGGLED_COOKIE_NAME } from "../resizable/contants";
import { SIDEBAR_TOGGLED_COOKIE_NAME } from "../resizable/constants";
import { AGENTIC_SEARCH_TYPE_COOKIE_NAME } from "@/lib/constants";
import Cookies from "js-cookie";
import FixedLogo from "@/app/chat/shared_chat_search/FixedLogo";
@ -110,9 +110,9 @@ export const SearchSection = ({
SIDEBAR_TOGGLED_COOKIE_NAME,
String(!toggledSidebar).toLocaleLowerCase()
),
{
path: "/",
};
{
path: "/",
};
toggle();
};
@ -494,9 +494,10 @@ export const SearchSection = ({
bg-opacity-80
duration-300
ease-in-out
${showDocSidebar || toggledSidebar
? "opacity-100 w-[300px] translate-x-0"
: "opacity-0 w-[200px] pointer-events-none -translate-x-10"
${
showDocSidebar || toggledSidebar
? "opacity-100 w-[300px] translate-x-0"
: "opacity-0 w-[200px] pointer-events-none -translate-x-10"
}
`}
>
@ -550,9 +551,10 @@ export const SearchSection = ({
<div className="max-w-searchbar-max w-[90%] mx-auto">
<div
className={`transition-all duration-500 ease-in-out overflow-hidden
${firstSearch
? "opacity-100 max-h-[500px]"
: "opacity-0 max-h-0"
${
firstSearch
? "opacity-100 max-h-[500px]"
: "opacity-0 max-h-0"
}`}
onTransitionEnd={handleTransitionEnd}
>

View File

@ -23,7 +23,7 @@ import { cookies } from "next/headers";
import {
SIDEBAR_TOGGLED_COOKIE_NAME,
DOCUMENT_SIDEBAR_WIDTH_COOKIE_NAME,
} from "@/components/resizable/contants";
} from "@/components/resizable/constants";
import { hasCompletedWelcomeFlowSS } from "@/components/initialSetup/welcome/WelcomeModalWrapper";
import { fetchAssistantsSS } from "../assistants/fetchAssistantsSS";