mirror of
https://github.com/zadam/trilium.git
synced 2026-04-12 23:17:46 +02:00
chore(client): dev server not working due to prefresh bug
See https://github.com/preactjs/prefresh/issues/610
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import type { ComponentChildren, CSSProperties, RefObject } from "preact";
|
||||
import { memo } from "preact/compat";
|
||||
import { useMemo } from "preact/hooks";
|
||||
|
||||
import { CommandNames } from "../../components/app_context";
|
||||
@@ -27,7 +26,7 @@ export interface ButtonProps {
|
||||
title?: string;
|
||||
}
|
||||
|
||||
const Button = memo(({ name, buttonRef, className, text, onClick, keyboardShortcut, icon, kind, disabled, size, style, triggerCommand, ...restProps }: ButtonProps) => {
|
||||
function Button({ name, buttonRef, className, text, onClick, keyboardShortcut, icon, kind, disabled, size, style, triggerCommand, ...restProps }: ButtonProps) {
|
||||
// Memoize classes array to prevent recreation
|
||||
const classes = useMemo(() => {
|
||||
const classList: string[] = ["btn"];
|
||||
@@ -83,7 +82,7 @@ const Button = memo(({ name, buttonRef, className, text, onClick, keyboardShortc
|
||||
{text} {shortcutElements}
|
||||
</button>
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
export function ButtonGroup({ children }: { children: ComponentChildren }) {
|
||||
return (
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { Modal as BootstrapModal } from "bootstrap";
|
||||
import clsx from "clsx";
|
||||
import { ComponentChildren, CSSProperties, RefObject } from "preact";
|
||||
import { memo } from "preact/compat";
|
||||
import { useEffect, useMemo, useRef } from "preact/hooks";
|
||||
|
||||
import { openDialog } from "../../services/dialog";
|
||||
@@ -186,7 +185,7 @@ export default function Modal({ children, className, size, title, customTitleBar
|
||||
);
|
||||
}
|
||||
|
||||
const ModalInner = memo(({ children, footer, footerAlignment, bodyStyle, footerStyle: _footerStyle }: Pick<ModalProps, "children" | "footer" | "footerAlignment" | "bodyStyle" | "footerStyle">) => {
|
||||
function ModalInner({ children, footer, footerAlignment, bodyStyle, footerStyle: _footerStyle }: Pick<ModalProps, "children" | "footer" | "footerAlignment" | "bodyStyle" | "footerStyle">) {
|
||||
// Memoize footer style
|
||||
const footerStyle = useMemo<CSSProperties>(() => {
|
||||
const style: CSSProperties = _footerStyle ?? {};
|
||||
@@ -209,4 +208,4 @@ const ModalInner = memo(({ children, footer, footerAlignment, bodyStyle, footerS
|
||||
)}
|
||||
</>
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user