mirror of
https://github.com/usememos/memos.git
synced 2025-06-05 22:09:59 +02:00
chore: update save button style (#1542)
This commit is contained in:
@ -25,6 +25,7 @@ const BaseDialog: React.FC<Props> = (props: Props) => {
|
||||
const dialogIndex = dialogStore.state.dialogStack.findIndex((item) => item === dialogName);
|
||||
|
||||
useEffect(() => {
|
||||
document.body.classList.add("overflow-hidden");
|
||||
dialogStore.pushDialogStack(dialogName);
|
||||
const handleKeyDown = (event: KeyboardEvent) => {
|
||||
if (event.code === "Escape") {
|
||||
@ -39,6 +40,9 @@ const BaseDialog: React.FC<Props> = (props: Props) => {
|
||||
return () => {
|
||||
document.body.removeEventListener("keydown", handleKeyDown);
|
||||
dialogStore.removeDialog(dialogName);
|
||||
if (dialogStore.state.dialogStack.length === 0) {
|
||||
document.body.classList.remove("overflow-hidden");
|
||||
}
|
||||
};
|
||||
}, []);
|
||||
|
||||
|
Reference in New Issue
Block a user