diff --git a/frontend/src/Navigation.tsx b/frontend/src/Navigation.tsx index 372f64cb..562be920 100644 --- a/frontend/src/Navigation.tsx +++ b/frontend/src/Navigation.tsx @@ -20,6 +20,7 @@ import { setSelectedDocs, } from './preferences/preferenceSlice'; import { useOutsideAlerter } from './hooks'; +import Upload from './upload/Upload'; export default function Navigation({ navState, @@ -43,6 +44,9 @@ export default function Navigation({ const [selectedDocsModalState, setSelectedDocsModalState] = useState(isSelectedDocsSet ? 'INACTIVE' : 'ACTIVE'); + const [uploadModalState, setUploadModalState] = + useState('INACTIVE'); + const navRef = useRef(null); useOutsideAlerter( navRef, @@ -128,7 +132,11 @@ export default function Navigation({ } mr-3 w-3 transition-all`} /> - + setUploadModalState('ACTIVE')} + > {isDocsListOpen && (
{docs ? ( @@ -224,7 +232,10 @@ export default function Navigation({ setModalState={setApiKeyModalState} isCancellable={isApiKeySet} /> - {/* */} + ); } diff --git a/frontend/src/upload/Upload.tsx b/frontend/src/upload/Upload.tsx index 5fb1a6b2..88afa960 100644 --- a/frontend/src/upload/Upload.tsx +++ b/frontend/src/upload/Upload.tsx @@ -1,7 +1,14 @@ import { useCallback, useState } from 'react'; import { useDropzone } from 'react-dropzone'; +import { ActiveState } from '../models/misc'; -export default function Upload() { +export default function Upload({ + modalState, + setModalState, +}: { + modalState: ActiveState; + setModalState: (state: ActiveState) => void; +}) { const [docName, setDocName] = useState(''); const [files, setfiles] = useState([]); @@ -20,7 +27,11 @@ export default function Upload() { onDragLeave: doNothing, }); return ( -
+

Upload New Documentation

Train - +