mirror of
https://github.com/usememos/memos.git
synced 2025-06-05 22:09:59 +02:00
chore: revert sidebar updates
This commit is contained in:
@ -6,7 +6,6 @@ import { TAG_REG, LINK_REG } from "../labs/marked/parser";
|
|||||||
import * as utils from "../helpers/utils";
|
import * as utils from "../helpers/utils";
|
||||||
import { checkShouldShowMemoWithFilters } from "../helpers/filter";
|
import { checkShouldShowMemoWithFilters } from "../helpers/filter";
|
||||||
import toastHelper from "./Toast";
|
import toastHelper from "./Toast";
|
||||||
import { closeSidebar } from "../helpers/utils";
|
|
||||||
import Memo from "./Memo";
|
import Memo from "./Memo";
|
||||||
import "../less/memo-list.less";
|
import "../less/memo-list.less";
|
||||||
|
|
||||||
@ -93,7 +92,7 @@ const MemoList = () => {
|
|||||||
}, [query]);
|
}, [query]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="memo-list-container" ref={wrapperElement} onClick={closeSidebar}>
|
<div className="memo-list-container" ref={wrapperElement}>
|
||||||
{sortedMemos.map((memo) => (
|
{sortedMemos.map((memo) => (
|
||||||
<Memo key={`${memo.id}-${memo.createdTs}-${memo.updatedTs}`} memo={memo} />
|
<Memo key={`${memo.id}-${memo.createdTs}-${memo.updatedTs}`} memo={memo} />
|
||||||
))}
|
))}
|
||||||
|
@ -5,7 +5,6 @@ import { useAppSelector } from "../store";
|
|||||||
import * as utils from "../helpers/utils";
|
import * as utils from "../helpers/utils";
|
||||||
import useToggle from "../hooks/useToggle";
|
import useToggle from "../hooks/useToggle";
|
||||||
import useLoading from "../hooks/useLoading";
|
import useLoading from "../hooks/useLoading";
|
||||||
import { closeSidebar } from "../helpers/utils";
|
|
||||||
import Icon from "./Icon";
|
import Icon from "./Icon";
|
||||||
import toastHelper from "./Toast";
|
import toastHelper from "./Toast";
|
||||||
import showCreateShortcutDialog from "./CreateShortcutDialog";
|
import showCreateShortcutDialog from "./CreateShortcutDialog";
|
||||||
@ -64,7 +63,6 @@ const ShortcutContainer: React.FC<ShortcutContainerProps> = (props: ShortcutCont
|
|||||||
const [showConfirmDeleteBtn, toggleConfirmDeleteBtn] = useToggle(false);
|
const [showConfirmDeleteBtn, toggleConfirmDeleteBtn] = useToggle(false);
|
||||||
|
|
||||||
const handleShortcutClick = () => {
|
const handleShortcutClick = () => {
|
||||||
closeSidebar();
|
|
||||||
if (isActive) {
|
if (isActive) {
|
||||||
locationService.setMemoShortcut(undefined);
|
locationService.setMemoShortcut(undefined);
|
||||||
} else {
|
} else {
|
||||||
|
@ -3,7 +3,6 @@ import { useTranslation } from "react-i18next";
|
|||||||
import { useAppSelector } from "../store";
|
import { useAppSelector } from "../store";
|
||||||
import { locationService, memoService, userService } from "../services";
|
import { locationService, memoService, userService } from "../services";
|
||||||
import useToggle from "../hooks/useToggle";
|
import useToggle from "../hooks/useToggle";
|
||||||
import { closeSidebar } from "../helpers/utils";
|
|
||||||
import Icon from "./Icon";
|
import Icon from "./Icon";
|
||||||
import "../less/tag-list.less";
|
import "../less/tag-list.less";
|
||||||
|
|
||||||
@ -70,7 +69,7 @@ const TagList = () => {
|
|||||||
}, [tagsText]);
|
}, [tagsText]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="tags-wrapper" onClick={closeSidebar}>
|
<div className="tags-wrapper">
|
||||||
<p className="title-text">{t("common.tags")}</p>
|
<p className="title-text">{t("common.tags")}</p>
|
||||||
<div className="tags-container">
|
<div className="tags-container">
|
||||||
{tags.map((t, idx) => (
|
{tags.map((t, idx) => (
|
||||||
|
@ -134,8 +134,3 @@ export const parseHTMLToRawText = (htmlStr: string): string => {
|
|||||||
const text = tempEl.innerText;
|
const text = tempEl.innerText;
|
||||||
return text;
|
return text;
|
||||||
};
|
};
|
||||||
|
|
||||||
export function closeSidebar() {
|
|
||||||
const sidebarEl = document.body.querySelector(".sidebar-wrapper") as HTMLDivElement;
|
|
||||||
sidebarEl.style.display = "none";
|
|
||||||
}
|
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
@apply w-full px-2 my-2 flex flex-col justify-start items-start shrink-0;
|
@apply w-full px-2 my-2 flex flex-col justify-start items-start shrink-0;
|
||||||
|
|
||||||
> .action-btn {
|
> .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 {
|
> .icon {
|
||||||
@apply mr-1;
|
@apply mr-1;
|
||||||
|
Reference in New Issue
Block a user