|
|
|
@ -1,11 +1,10 @@
|
|
|
|
|
import { useCallback, useContext, useEffect, useState } from "react";
|
|
|
|
|
import appContext from "../stores/appContext";
|
|
|
|
|
import useLoading from "../hooks/useLoading";
|
|
|
|
|
import { globalStateService, locationService, memoService, shortcutService } from "../services";
|
|
|
|
|
import { locationService, memoService, shortcutService } from "../services";
|
|
|
|
|
import { IMAGE_URL_REG, LINK_REG, MEMO_LINK_REG, TAG_REG } from "../helpers/consts";
|
|
|
|
|
import utils from "../helpers/utils";
|
|
|
|
|
import { checkShouldShowMemoWithFilters } from "../helpers/filter";
|
|
|
|
|
import Only from "../components/common/OnlyWhen";
|
|
|
|
|
import toastHelper from "../components/Toast";
|
|
|
|
|
import DeletedMemo from "../components/DeletedMemo";
|
|
|
|
|
import MemoFilter from "../components/MemoFilter";
|
|
|
|
@ -16,7 +15,6 @@ interface Props {}
|
|
|
|
|
const MemoTrash: React.FC<Props> = () => {
|
|
|
|
|
const {
|
|
|
|
|
locationState: { query },
|
|
|
|
|
globalState: { isMobileView },
|
|
|
|
|
} = useContext(appContext);
|
|
|
|
|
const loadingState = useLoading();
|
|
|
|
|
const [deletedMemos, setDeletedMemos] = useState<Model.Memo[]>([]);
|
|
|
|
@ -101,19 +99,10 @@ const MemoTrash: React.FC<Props> = () => {
|
|
|
|
|
setDeletedMemos((deletedMemos) => deletedMemos.filter((memo) => memo.id !== memoId));
|
|
|
|
|
}, []);
|
|
|
|
|
|
|
|
|
|
const handleShowSidebarBtnClick = useCallback(() => {
|
|
|
|
|
globalStateService.setShowSiderbarInMobileView(true);
|
|
|
|
|
}, []);
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<div className="memo-trash-wrapper">
|
|
|
|
|
<div className="section-header-container">
|
|
|
|
|
<div className="title-text">
|
|
|
|
|
<Only when={isMobileView}>
|
|
|
|
|
<button className="action-btn" onClick={handleShowSidebarBtnClick}>
|
|
|
|
|
<img className="icon-img" src="/icons/menu.svg" alt="menu" />
|
|
|
|
|
</button>
|
|
|
|
|
</Only>
|
|
|
|
|
<span className="normal-text">Recycle Bin</span>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|