adds upload modal visibility

This commit is contained in:
ajaythapliyal
2023-03-17 13:25:21 +05:30
parent dbaa116fe0
commit 6dd13c6845
2 changed files with 36 additions and 5 deletions

View File

@@ -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<ActiveState>(isSelectedDocsSet ? 'INACTIVE' : 'ACTIVE');
const [uploadModalState, setUploadModalState] =
useState<ActiveState>('INACTIVE');
const navRef = useRef(null);
useOutsideAlerter(
navRef,
@@ -128,7 +132,11 @@ export default function Navigation({
} mr-3 w-3 transition-all`}
/>
</div>
<img className="hover:cursor-pointer" src={UploadIcon}></img>
<img
className="hover:cursor-pointer"
src={UploadIcon}
onClick={() => setUploadModalState('ACTIVE')}
></img>
{isDocsListOpen && (
<div className="absolute top-12 left-0 right-6 ml-2 mr-4 max-h-52 overflow-y-scroll bg-white shadow-lg">
{docs ? (
@@ -224,7 +232,10 @@ export default function Navigation({
setModalState={setApiKeyModalState}
isCancellable={isApiKeySet}
/>
{/* <Upload></Upload> */}
<Upload
modalState={uploadModalState}
setModalState={setUploadModalState}
></Upload>
</>
);
}