diff --git a/frontend/public/fonts/Inter-Variable.ttf b/frontend/public/fonts/Inter-Variable.ttf new file mode 100644 index 0000000..e724708 Binary files /dev/null and b/frontend/public/fonts/Inter-Variable.ttf differ diff --git a/frontend/src/Navigation.tsx b/frontend/src/Navigation.tsx index 39fb5f0..2e58b3a 100644 --- a/frontend/src/Navigation.tsx +++ b/frontend/src/Navigation.tsx @@ -20,7 +20,7 @@ import Add from './assets/add.svg'; import UploadIcon from './assets/upload.svg'; import { ActiveState } from './models/misc'; import APIKeyModal from './preferences/APIKeyModal'; -import DeleteConvModal from './preferences/DeleteConvModal'; +import DeleteConvModal from './modals/DeleteConvModal'; import { selectApiKeyStatus, @@ -275,10 +275,10 @@ export default function Navigation({ navOpen, setNavOpen }: NavigationProps) {

- {conversations && ( + {conversations && conversations.length > 0 ? (
-

Chats

+

Chats

{conversations?.map((conversation) => ( @@ -294,12 +294,14 @@ export default function Navigation({ navOpen, setNavOpen }: NavigationProps) { ))}
+ ) : ( + <> )}
-
+
setUploadModalState('ACTIVE')} >
-

Source Docs

+

Source Docs

- `my-auto mx-4 flex h-9 cursor-pointer gap-4 rounded-3xl hover:bg-gray-100 dark:hover:bg-purple-taupe ${ + `my-auto mx-4 flex h-9 cursor-pointer gap-4 rounded-3xl hover:bg-gray-100 dark:hover:bg-[#28292E] ${ isActive ? 'bg-gray-3000 dark:bg-transparent' : '' }` } @@ -335,8 +337,8 @@ export default function Navigation({ navOpen, setNavOpen }: NavigationProps) { - `my-auto mx-4 flex h-9 cursor-pointer gap-4 rounded-3xl hover:bg-gray-100 dark:hover:bg-purple-taupe ${ - isActive ? 'bg-gray-3000 dark:bg-purple-taupe' : '' + `my-auto mx-4 flex h-9 cursor-pointer gap-4 rounded-3xl hover:bg-gray-100 dark:hover:bg-[#28292E] ${ + isActive ? 'bg-gray-3000 dark:bg-[#28292E]' : '' }` } > @@ -348,7 +350,7 @@ export default function Navigation({ navOpen, setNavOpen }: NavigationProps) { href="https://docs.docsgpt.cloud/" target="_blank" rel="noreferrer" - className="my-auto mx-4 flex h-9 cursor-pointer gap-4 rounded-3xl hover:bg-gray-100 dark:hover:bg-purple-taupe" + className="my-auto mx-4 flex h-9 cursor-pointer gap-4 rounded-3xl hover:bg-gray-100 dark:hover:bg-[#28292E]" >

Documentation

@@ -357,7 +359,7 @@ export default function Navigation({ navOpen, setNavOpen }: NavigationProps) { href="https://discord.gg/WHJdfbQDR4" target="_blank" rel="noreferrer" - className="my-auto mx-4 flex h-9 cursor-pointer gap-4 rounded-3xl hover:bg-gray-100 dark:hover:bg-purple-taupe" + className="my-auto mx-4 flex h-9 cursor-pointer gap-4 rounded-3xl hover:bg-gray-100 dark:hover:bg-[#28292E]" > {/* discord-link */} @@ -368,7 +370,7 @@ export default function Navigation({ navOpen, setNavOpen }: NavigationProps) { href="https://github.com/arc53/DocsGPT" target="_blank" rel="noreferrer" - className="mx-4 mt-auto flex h-9 cursor-pointer gap-4 rounded-3xl hover:bg-gray-100 dark:hover:bg-purple-taupe" + className="mx-4 mt-auto flex h-9 cursor-pointer gap-4 rounded-3xl hover:bg-gray-100 dark:hover:bg-[#28292E]" >

Visit our Github

diff --git a/frontend/src/components/Dropdown.tsx b/frontend/src/components/Dropdown.tsx index b08bbd1..670a2d6 100644 --- a/frontend/src/components/Dropdown.tsx +++ b/frontend/src/components/Dropdown.tsx @@ -9,6 +9,8 @@ function Dropdown({ onSelect, size = 'w-32', rounded = 'xl', + border = 'border-2', + borderColor = 'silver', showEdit, onEdit, showDelete, @@ -26,6 +28,8 @@ function Dropdown({ | ((value: { label: string; value: string }) => void); size?: string; rounded?: 'xl' | '3xl'; + border?: 'border' | 'border-2'; + borderColor?: string; showEdit?: boolean; onEdit?: (value: { name: string; id: string; type: string }) => void; showDelete?: boolean; @@ -33,6 +37,8 @@ function Dropdown({ placeholder?: string; }) { const [isOpen, setIsOpen] = React.useState(false); + const borderRadius = rounded === 'xl' ? 'rounded-xl' : 'rounded-3xl'; + const borderTopRadius = rounded === 'xl' ? 'rounded-t-xl' : 'rounded-t-3xl'; return (
{isOpen && ( -
+
{options.map((option: any, index) => (
{isDocsListOpen && ( -
+
{options ? ( options.map((option: any, index: number) => { if (option.model === embeddingsName) { @@ -95,16 +97,14 @@ function SourceDropdown({ } }) ) : ( -
-

No default documentation.

-
+ <> )}
- Empty + None
diff --git a/frontend/src/conversation/ConversationTile.tsx b/frontend/src/conversation/ConversationTile.tsx index 4b037a8..b9d2301 100644 --- a/frontend/src/conversation/ConversationTile.tsx +++ b/frontend/src/conversation/ConversationTile.tsx @@ -32,15 +32,6 @@ export default function ConversationTile({ const [isDarkTheme] = useDarkTheme(); const [isEdit, setIsEdit] = useState(false); const [conversationName, setConversationsName] = useState(''); - // useOutsideAlerter( - // tileRef, - // () => - // handleSaveConversation({ - // id: conversationId || conversation.id, - // name: conversationName, - // }), - // [conversationName], - // ); useEffect(() => { setConversationsName(conversation.name); @@ -69,9 +60,9 @@ export default function ConversationTile({ onClick={() => { selectConversation(conversation.id); }} - className={`my-auto mx-4 mt-4 flex h-9 cursor-pointer items-center justify-between gap-4 rounded-3xl hover:bg-gray-100 dark:hover:bg-purple-taupe ${ + className={`my-auto mx-4 mt-4 flex h-9 cursor-pointer items-center justify-between gap-4 rounded-3xl hover:bg-gray-100 dark:hover:bg-[#28292E] ${ conversationId === conversation.id - ? 'bg-gray-100 dark:bg-purple-taupe' + ? 'bg-gray-100 dark:bg-[#28292E]' : '' }`} > diff --git a/frontend/src/index.css b/frontend/src/index.css index b35385b..c47b442 100644 --- a/frontend/src/index.css +++ b/frontend/src/index.css @@ -398,3 +398,13 @@ template { padding: 16px; } } + +@font-face { + font-family: 'Inter'; + font-weight: 100 200 300 400 500 600 700 800 900; + src: url('/fonts/Inter-Variable.ttf'); +} + +::-webkit-scrollbar { + width: 0; +} diff --git a/frontend/src/modals/ConfirmationModal.tsx b/frontend/src/modals/ConfirmationModal.tsx new file mode 100644 index 0000000..c5b4cf4 --- /dev/null +++ b/frontend/src/modals/ConfirmationModal.tsx @@ -0,0 +1,68 @@ +import Exit from '../assets/exit.svg'; +import { ActiveState } from '../models/misc'; + +function ConfirmationModal({ + message, + modalState, + setModalState, + submitLabel, + handleSubmit, + cancelLabel, + handleCancel, +}: { + message: string; + modalState: ActiveState; + setModalState: (state: ActiveState) => void; + submitLabel: string; + handleSubmit: () => void; + cancelLabel?: string; + handleCancel?: () => void; +}) { + return ( +
+
+
+ +
+

+ {message} +

+
+
+ + +
+
+
+
+
+
+ ); +} + +export default ConfirmationModal; diff --git a/frontend/src/preferences/DeleteConvModal.tsx b/frontend/src/modals/DeleteConvModal.tsx similarity index 57% rename from frontend/src/preferences/DeleteConvModal.tsx rename to frontend/src/modals/DeleteConvModal.tsx index ba7ed06..4371fc1 100644 --- a/frontend/src/preferences/DeleteConvModal.tsx +++ b/frontend/src/modals/DeleteConvModal.tsx @@ -1,8 +1,9 @@ -import { useRef } from 'react'; -import { ActiveState } from '../models/misc'; -import { useMediaQuery, useOutsideAlerter } from './../hooks'; -import Modal from '../Modal'; +import React from 'react'; import { useDispatch } from 'react-redux'; +import { ActiveState } from '../models/misc'; +import { useMediaQuery, useOutsideAlerter } from '../hooks'; +import ConfirmationModal from './ConfirmationModal'; + import { Action } from '@reduxjs/toolkit'; export default function DeleteConvModal({ @@ -14,8 +15,8 @@ export default function DeleteConvModal({ setModalState: (val: ActiveState) => Action; handleDeleteAllConv: () => void; }) { + const modalRef = React.useRef(null); const dispatch = useDispatch(); - const modalRef = useRef(null); const { isMobile } = useMediaQuery(); useOutsideAlerter( @@ -38,25 +39,13 @@ export default function DeleteConvModal({ } return ( - { - return ( -
-

- Are you sure you want to delete all the conversations? -

-
- ); - }} + handleCancel={handleCancel} /> ); } diff --git a/frontend/src/Modal/index.tsx b/frontend/src/modals/index.tsx similarity index 100% rename from frontend/src/Modal/index.tsx rename to frontend/src/modals/index.tsx diff --git a/frontend/src/preferences/APIKeyModal.tsx b/frontend/src/preferences/APIKeyModal.tsx index 7aeeadb..dd7a1b8 100644 --- a/frontend/src/preferences/APIKeyModal.tsx +++ b/frontend/src/preferences/APIKeyModal.tsx @@ -3,7 +3,7 @@ import { useDispatch, useSelector } from 'react-redux'; import { ActiveState } from '../models/misc'; import { selectApiKey, setApiKey } from './preferenceSlice'; import { useMediaQuery, useOutsideAlerter } from './../hooks'; -import Modal from '../Modal'; +import Modal from '../modals'; export default function APIKeyModal({ modalState, diff --git a/frontend/src/preferences/PromptsModal.tsx b/frontend/src/preferences/PromptsModal.tsx index da95dc0..c16ddd2 100644 --- a/frontend/src/preferences/PromptsModal.tsx +++ b/frontend/src/preferences/PromptsModal.tsx @@ -37,7 +37,7 @@ function AddPrompt({ setNewPromptName(e.target.value)} > @@ -52,7 +52,7 @@ function AddPrompt({
@@ -108,7 +108,7 @@ function EditPrompt({ setEditPromptName(e.target.value)} > @@ -123,7 +123,7 @@ function EditPrompt({
diff --git a/frontend/src/preferences/SelectDocsModal.tsx b/frontend/src/preferences/SelectDocsModal.tsx index c8c8ef7..edb2714 100644 --- a/frontend/src/preferences/SelectDocsModal.tsx +++ b/frontend/src/preferences/SelectDocsModal.tsx @@ -1,7 +1,7 @@ import { useEffect, useState } from 'react'; import { useDispatch, useSelector } from 'react-redux'; import { ActiveState } from '../models/misc'; -import Modal from '../Modal'; +import Modal from '../modals'; import { setSelectedDocs, setSourceDocs, diff --git a/frontend/src/settings/APIKeys.tsx b/frontend/src/settings/APIKeys.tsx index 7803ff4..b7a98c8 100644 --- a/frontend/src/settings/APIKeys.tsx +++ b/frontend/src/settings/APIKeys.tsx @@ -95,7 +95,7 @@ const APIKeys: React.FC = () => {
@@ -234,7 +234,7 @@ const CreateAPIKeyModal: React.FC = ({ setAPIKeyName(e.target.value)} /> @@ -285,7 +285,7 @@ const CreateAPIKeyModal: React.FC = ({ chunks: chunk, }) } - className="float-right mt-4 rounded-full bg-purple-30 px-4 py-3 text-white disabled:opacity-50" + className="float-right mt-4 rounded-full bg-purple-30 px-5 py-2 text-sm text-white hover:bg-[#6F3FD1] disabled:opacity-50" > Create @@ -316,7 +316,7 @@ const SaveAPIKeyModal: React.FC = ({ apiKey, close }) => { {apiKey}
diff --git a/frontend/src/settings/Prompts.tsx b/frontend/src/settings/Prompts.tsx index 6956df6..e5af189 100644 --- a/frontend/src/settings/Prompts.tsx +++ b/frontend/src/settings/Prompts.tsx @@ -156,7 +156,7 @@ const Prompts: React.FC = ({ return ( <>
-
+

Active Prompt

= ({ onSelect={handleSelectPrompt} size="w-56" rounded="3xl" + border="border" showEdit showDelete onEdit={({ @@ -186,7 +187,7 @@ const Prompts: React.FC = ({ />
+ {activeTab === 'file' ? ( + + ) : ( + + )}