diff --git a/frontend/src/Navigation.tsx b/frontend/src/Navigation.tsx
index 87cbbe51..8f732515 100644
--- a/frontend/src/Navigation.tsx
+++ b/frontend/src/Navigation.tsx
@@ -199,22 +199,24 @@ export default function Navigation({ navOpen, setNavOpen }: NavigationProps) {
)}
-
+
{
+ if (isMobile) {
+ setNavOpen(!navOpen);
+ }
+ }}>
DocsGPT
@@ -227,15 +229,17 @@ export default function Navigation({ navOpen, setNavOpen }: NavigationProps) {
{
+ if (isMobile) {
+ setNavOpen(!navOpen);
+ }
dispatch(setConversation([]));
dispatch(
updateConversationId({
@@ -244,8 +248,7 @@ export default function Navigation({ navOpen, setNavOpen }: NavigationProps) {
);
}}
className={({ isActive }) =>
- `${
- isActive ? 'bg-gray-3000 dark:bg-transparent' : ''
+ `${isActive ? 'bg-gray-3000 dark:bg-transparent' : ''
} group sticky mx-4 mt-4 flex cursor-pointer gap-2.5 rounded-3xl border border-silver p-3 hover:border-rainy-gray hover:bg-gray-3000 dark:border-purple-taupe dark:text-white dark:hover:bg-transparent`
}
>
@@ -293,21 +296,35 @@ export default function Navigation({ navOpen, setNavOpen }: NavigationProps) {
isDocsListOpen={isDocsListOpen}
setIsDocsListOpen={setIsDocsListOpen}
handleDeleteClick={handleDeleteClick}
+ handlePostDocumentSelect={(doc) => {
+ if (isMobile) {
+ setNavOpen(!navOpen)
+ }
+ }}
/>
setUploadModalState('ACTIVE')}
- >
+ onClick={() => {
+ setUploadModalState('ACTIVE')
+ if (isMobile) {
+ setNavOpen(!navOpen);
+ }
+ }
+ }>
{t('sourceDocs')}
{
+ if (isMobile) {
+ setNavOpen(!navOpen);
+ }
+ }}
to="/settings"
className={({ isActive }) =>
- `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' : ''
+ `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' : ''
}`
}
>
@@ -323,10 +340,14 @@ export default function Navigation({ navOpen, setNavOpen }: NavigationProps) {
{
+ if (isMobile) {
+ setNavOpen(!navOpen);
+ }
+ }}
to="/about"
className={({ isActive }) =>
- `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]' : ''
+ `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]' : ''
}`
}
>
diff --git a/frontend/src/components/SourceDropdown.tsx b/frontend/src/components/SourceDropdown.tsx
index d5146da5..efce3467 100644
--- a/frontend/src/components/SourceDropdown.tsx
+++ b/frontend/src/components/SourceDropdown.tsx
@@ -11,6 +11,7 @@ type Props = {
isDocsListOpen: boolean;
setIsDocsListOpen: React.Dispatch>;
handleDeleteClick: any;
+ handlePostDocumentSelect: any;
};
function SourceDropdown({
@@ -20,6 +21,7 @@ function SourceDropdown({
setIsDocsListOpen,
isDocsListOpen,
handleDeleteClick,
+ handlePostDocumentSelect, // Callback function fired after a document is selected
}: Props) {
const dispatch = useDispatch();
const { t } = useTranslation();
@@ -85,6 +87,7 @@ function SourceDropdown({
onClick={() => {
dispatch(setSelectedDocs(option));
setIsDocsListOpen(false);
+ handlePostDocumentSelect(option);
}}
>