Fix: Minimise sidebar on nav item click on Mobile

This commit is contained in:
shatanikmahanty
2024-10-06 11:56:26 +05:30
parent 5b01664d53
commit 989d6eee0f
2 changed files with 42 additions and 18 deletions

View File

@@ -11,6 +11,7 @@ type Props = {
isDocsListOpen: boolean;
setIsDocsListOpen: React.Dispatch<React.SetStateAction<boolean>>;
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);
}}
>
<span