Skip to content

Commit f318e30

Browse files
authored
Minor theming (#2993)
* ensure functionality * naming * ensure tailwind theme updated * add comments * nit * remove pr * enforce colors * update our tailwind config
1 parent 7384ca8 commit f318e30

File tree

12 files changed

+49
-31
lines changed

12 files changed

+49
-31
lines changed

web/src/app/assistants/SidebarWrapper.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,13 +153,15 @@ export default function SidebarWrapper<T extends object>({
153153
/>
154154

155155
<div
156-
className={`mt-4 w-full ${size == "lg" ? "max-w-4xl" : "max-w-3xl"} mx-auto`}
156+
className={`mt-4 w-full ${
157+
size == "lg" ? "max-w-4xl" : "max-w-3xl"
158+
} mx-auto`}
157159
>
158160
{children}
159161
</div>
160162
</div>
161163
</div>
162-
<FixedLogo />
164+
<FixedLogo backgroundToggled={toggledSidebar || showDocSidebar} />
163165
</div>
164166
);
165167
}

web/src/app/chat/ChatPage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2512,7 +2512,7 @@ export function ChatPage({
25122512
)}
25132513
</div>
25142514
</div>
2515-
<FixedLogo chat />
2515+
<FixedLogo backgroundToggled={toggledSidebar || showDocSidebar} />
25162516
</div>
25172517
</div>
25182518
<DocumentSidebar

web/src/app/chat/sessionSidebar/ChatSessionDisplay.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ export function ChatSessionDisplay({
122122
);
123123
}}
124124
>
125-
<BasicSelectable chat padding="extra" fullWidth selected={isSelected}>
125+
<BasicSelectable padding="extra" fullWidth selected={isSelected}>
126126
<>
127127
<div className="flex relative">
128128
{isRenamingChat ? (
@@ -144,8 +144,8 @@ export function ChatSessionDisplay({
144144
className={`absolute right-0 top-0 h-full w-8 bg-gradient-to-r from-transparent
145145
${
146146
isSelected
147-
? "to-background-chat-hover"
148-
: " to-background-chat-selected group-hover:to-background-chat-hover"
147+
? "to-background-chat-selected"
148+
: "group-hover:to-background-chat-hover"
149149
} `}
150150
/>
151151
</p>

web/src/app/chat/shared/[chatId]/SharedChatDisplay.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ function BackToDanswerButton() {
2727
Back to {enterpriseSettings?.application_name || "Danswer Chat"}
2828
</Button>
2929
</div>
30-
pr
3130
</div>
3231
);
3332
}

web/src/app/chat/shared_chat_search/FixedLogo.tsx

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,12 @@ import Link from "next/link";
88
import { useContext } from "react";
99
import { FiSidebar } from "react-icons/fi";
1010

11-
export default function FixedLogo({ chat }: { chat?: boolean }) {
11+
export default function FixedLogo({
12+
// Whether the sidebar is toggled or not
13+
backgroundToggled,
14+
}: {
15+
backgroundToggled?: boolean;
16+
}) {
1217
const combinedSettings = useContext(SettingsContext);
1318
const settings = combinedSettings?.settings;
1419
const enterpriseSettings = combinedSettings?.enterpriseSettings;
@@ -28,15 +33,17 @@ export default function FixedLogo({ chat }: { chat?: boolean }) {
2833
<div className="w-full">
2934
{enterpriseSettings && enterpriseSettings.application_name ? (
3035
<div>
31-
<HeaderTitle chat={chat}>
36+
<HeaderTitle backgroundToggled={backgroundToggled}>
3237
{enterpriseSettings.application_name}
3338
</HeaderTitle>
3439
{!NEXT_PUBLIC_DO_NOT_USE_TOGGLE_OFF_DANSWER_POWERED && (
3540
<p className="text-xs text-subtle">Powered by Danswer</p>
3641
)}
3742
</div>
3843
) : (
39-
<HeaderTitle chat={chat}>Danswer</HeaderTitle>
44+
<HeaderTitle backgroundToggled={backgroundToggled}>
45+
Danswer
46+
</HeaderTitle>
4047
)}
4148
</div>
4249
</div>

web/src/components/BasicClickable.tsx

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -81,14 +81,12 @@ export function BasicSelectable({
8181
children,
8282
selected,
8383
hasBorder,
84-
chat,
8584
fullWidth = false,
8685
padding = "normal",
8786
}: {
8887
children: string | JSX.Element;
8988
selected: boolean;
9089
hasBorder?: boolean;
91-
chat?: boolean;
9290
fullWidth?: boolean;
9391
padding?: "none" | "normal" | "extra";
9492
}) {
@@ -104,12 +102,8 @@ export function BasicSelectable({
104102
${hasBorder ? "border border-border" : ""}
105103
${
106104
selected
107-
? chat
108-
? "bg-background-chat-selected"
109-
: "bg-hover"
110-
: chat
111-
? "bg-background-chat-hover"
112-
: "hover:bg-hover"
105+
? "bg-background-chat-selected"
106+
: "hover:bg-background-chat-hover"
113107
}
114108
${fullWidth ? "w-full" : ""}`}
115109
>

web/src/components/admin/ClientLayout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export function ClientLayout({
5858
return (
5959
<div className="h-screen overflow-y-hidden">
6060
<div className="flex h-full">
61-
<div className="flex-none text-text-settings-sidebar bg-background-settings-sidebar w-[250px] z-20 pt-4 pb-8 h-full border-r border-border miniscroll overflow-auto">
61+
<div className="flex-none text-text-settings-sidebar bg-background-sidebar w-[250px] z-20 pt-4 pb-8 h-full border-r border-border miniscroll overflow-auto">
6262
<AdminSidebar
6363
collections={[
6464
{

web/src/components/admin/connectors/AdminSidebar.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export function AdminSidebar({ collections }: { collections: Collection[] }) {
5555
<div className="flex-grow min-w-0 my-auto">
5656
{enterpriseSettings && enterpriseSettings.application_name ? (
5757
<div className="w-full">
58-
<HeaderTitle>
58+
<HeaderTitle backgroundToggled={true}>
5959
{enterpriseSettings.application_name}
6060
</HeaderTitle>
6161
{!NEXT_PUBLIC_DO_NOT_USE_TOGGLE_OFF_DANSWER_POWERED && (
@@ -65,7 +65,7 @@ export function AdminSidebar({ collections }: { collections: Collection[] }) {
6565
)}
6666
</div>
6767
) : (
68-
<HeaderTitle>Danswer</HeaderTitle>
68+
<HeaderTitle backgroundToggled={true}>Danswer</HeaderTitle>
6969
)}
7070
</div>
7171
</div>
@@ -74,7 +74,7 @@ export function AdminSidebar({ collections }: { collections: Collection[] }) {
7474
</div>
7575
<div className="flex w-full justify-center">
7676
<Link href={"/chat"}>
77-
<button className="text-sm flex items-center block w-52 py-2.5 flex px-2 text-left bg-background-200 hover:bg-background-200/80 cursor-pointer rounded">
77+
<button className="text-sm flex items-center block w-52 py-2.5 flex px-2 text-left text-text-back-button bg-background-back-button hover:bg-opacity-80 cursor-pointer rounded">
7878
<BackIcon className="my-auto" size={18} />
7979
<p className="ml-1 break-words line-clamp-2 ellipsis leading-none">
8080
Back to{" "}

web/src/components/header/HeaderTitle.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,20 @@ import React from "react";
44

55
export function HeaderTitle({
66
children,
7-
chat,
7+
backgroundToggled,
88
}: {
99
children: JSX.Element | string;
10-
chat?: boolean;
10+
backgroundToggled?: boolean;
1111
}) {
1212
const isString = typeof children === "string";
1313
const textSize = isString && children.length > 10 ? "text-xl" : "text-2xl";
1414

1515
return (
1616
<h1
1717
className={`${textSize} ${
18-
chat ? "text-text-sidebar-header" : "text-text-header"
18+
backgroundToggled
19+
? "text-text-sidebar-toggled-header"
20+
: "text-text-sidebar-header"
1921
} break-words line-clamp-2 ellipsis text-strong leading-none font-bold`}
2022
>
2123
{children}

web/src/components/header/LogoType.tsx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@ export default function LogoType({
3737

3838
return (
3939
<div
40-
className={`${hideOnMobile && "mobile:hidden"} z-[100] mb-auto shrink-0 flex items-center text-xl font-bold`}
40+
className={`${
41+
hideOnMobile && "mobile:hidden"
42+
} z-[100] mb-auto shrink-0 flex items-center text-xl font-bold`}
4143
>
4244
{toggleSidebar && page == "chat" ? (
4345
<button
@@ -55,7 +57,9 @@ export default function LogoType({
5557
</div>
5658
)}
5759
<div
58-
className={`cursor-pointer ${showArrow ? "desktop:invisible" : "invisible"} break-words inline-block w-fit ml-2 text-text-700 text-xl`}
60+
className={`cursor-pointer ${
61+
showArrow ? "desktop:invisible" : "invisible"
62+
} break-words inline-block w-fit ml-2 text-text-700 text-xl`}
5963
>
6064
<div className="max-w-[175px]">
6165
{enterpriseSettings && enterpriseSettings.application_name ? (
@@ -111,9 +115,9 @@ export default function LogoType({
111115
}}
112116
>
113117
{!toggled && !combinedSettings?.isMobile ? (
114-
<RightToLineIcon />
118+
<RightToLineIcon className="text-sidebar-toggle" />
115119
) : (
116-
<LeftToLineIcon />
120+
<LeftToLineIcon className="text-sidebar-toggle" />
117121
)}
118122
</button>
119123
</Tooltip>

0 commit comments

Comments
 (0)