chore: revert sidebar updates

This commit is contained in:
Steven 2022-10-13 08:05:59 +08:00
parent 37cd841992
commit ffe145d436
5 changed files with 3 additions and 12 deletions

View File

@ -6,7 +6,6 @@ import { TAG_REG, LINK_REG } from "../labs/marked/parser";
import * as utils from "../helpers/utils";
import { checkShouldShowMemoWithFilters } from "../helpers/filter";
import toastHelper from "./Toast";
import { closeSidebar } from "../helpers/utils";
import Memo from "./Memo";
import "../less/memo-list.less";
@ -93,7 +92,7 @@ const MemoList = () => {
}, [query]);
return (
<div className="memo-list-container" ref={wrapperElement} onClick={closeSidebar}>
<div className="memo-list-container" ref={wrapperElement}>
{sortedMemos.map((memo) => (
<Memo key={`${memo.id}-${memo.createdTs}-${memo.updatedTs}`} memo={memo} />
))}

View File

@ -5,7 +5,6 @@ import { useAppSelector } from "../store";
import * as utils from "../helpers/utils";
import useToggle from "../hooks/useToggle";
import useLoading from "../hooks/useLoading";
import { closeSidebar } from "../helpers/utils";
import Icon from "./Icon";
import toastHelper from "./Toast";
import showCreateShortcutDialog from "./CreateShortcutDialog";
@ -64,7 +63,6 @@ const ShortcutContainer: React.FC<ShortcutContainerProps> = (props: ShortcutCont
const [showConfirmDeleteBtn, toggleConfirmDeleteBtn] = useToggle(false);
const handleShortcutClick = () => {
closeSidebar();
if (isActive) {
locationService.setMemoShortcut(undefined);
} else {

View File

@ -3,7 +3,6 @@ import { useTranslation } from "react-i18next";
import { useAppSelector } from "../store";
import { locationService, memoService, userService } from "../services";
import useToggle from "../hooks/useToggle";
import { closeSidebar } from "../helpers/utils";
import Icon from "./Icon";
import "../less/tag-list.less";
@ -70,7 +69,7 @@ const TagList = () => {
}, [tagsText]);
return (
<div className="tags-wrapper" onClick={closeSidebar}>
<div className="tags-wrapper">
<p className="title-text">{t("common.tags")}</p>
<div className="tags-container">
{tags.map((t, idx) => (

View File

@ -134,8 +134,3 @@ export const parseHTMLToRawText = (htmlStr: string): string => {
const text = tempEl.innerText;
return text;
};
export function closeSidebar() {
const sidebarEl = document.body.querySelector(".sidebar-wrapper") as HTMLDivElement;
sidebarEl.style.display = "none";
}

View File

@ -16,7 +16,7 @@
@apply w-full px-2 my-2 flex flex-col justify-start items-start shrink-0;
> .action-btn {
@apply leading-10 px-4 rounded-lg text-base text-left w-full hover:bg-white;
@apply leading-10 px-4 rounded-lg text-base hover:bg-white;
> .icon {
@apply mr-1;