Skip to content

Commit 30e78e6

Browse files
formatting
1 parent 011ee4a commit 30e78e6

3 files changed

Lines changed: 32 additions & 25 deletions

File tree

src/components/editor/plugins/devtools-plugin.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,14 @@ export default function DevtoolsPlugin({
5454
<button
5555
aria-expanded={open}
5656
aria-label={open ? "Close Lexical tree view" : "Open Lexical tree view"}
57-
className="flex size-9 items-center justify-center rounded-full border border-border bg-background/95 text-foreground shadow-lg backdrop-blur-sm transition-colors hover:bg-accent hover:text-accent-foreground"
57+
className="border-border bg-background/95 text-foreground hover:bg-accent hover:text-accent-foreground flex size-9 items-center justify-center rounded-full border shadow-lg backdrop-blur-sm transition-colors"
5858
onClick={() => setOpen((value) => !value)}
5959
type="button"
6060
>
6161
<Bug className="size-4" />
6262
</button>
6363
{open ? (
64-
<div className="mt-2 w-96 max-w-[calc(100vw-2rem)] overflow-hidden rounded-xl border border-border bg-background/95 shadow-xl backdrop-blur-sm">
64+
<div className="border-border bg-background/95 mt-2 w-96 max-w-[calc(100vw-2rem)] overflow-hidden rounded-xl border shadow-xl backdrop-blur-sm">
6565
<div className="border-divider border-b px-3 py-2 text-sm font-medium">
6666
Lexical Tree
6767
</div>

src/features/shell/editor-pane.tsx

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -110,28 +110,31 @@ export function EditorPane({
110110
const [showHeaderBorder, setShowHeaderBorder] = useState(false);
111111
const [showHeaderTitle, setShowHeaderTitle] = useState(false);
112112
const noteTitle = firstLineH1Title(markdown);
113-
const updateHeaderState = useCallback((scrollContainer: HTMLDivElement | null) => {
114-
const scrolled = (scrollContainer?.scrollTop ?? 0) > 0;
115-
setShowHeaderBorder(scrolled);
113+
const updateHeaderState = useCallback(
114+
(scrollContainer: HTMLDivElement | null) => {
115+
const scrolled = (scrollContainer?.scrollTop ?? 0) > 0;
116+
setShowHeaderBorder(scrolled);
116117

117-
if (!scrollContainer || !noteId) {
118-
setShowHeaderTitle(false);
119-
return;
120-
}
118+
if (!scrollContainer || !noteId) {
119+
setShowHeaderTitle(false);
120+
return;
121+
}
121122

122-
const firstLine = scrollContainer.querySelector(
123-
"[data-lexical-editor] > :first-child",
124-
) as HTMLElement | null;
123+
const firstLine = scrollContainer.querySelector(
124+
"[data-lexical-editor] > :first-child",
125+
) as HTMLElement | null;
125126

126-
if (!firstLine) {
127-
setShowHeaderTitle(false);
128-
return;
129-
}
127+
if (!firstLine) {
128+
setShowHeaderTitle(false);
129+
return;
130+
}
130131

131-
const scrollRect = scrollContainer.getBoundingClientRect();
132-
const firstLineRect = firstLine.getBoundingClientRect();
133-
setShowHeaderTitle(firstLineRect.bottom <= scrollRect.top);
134-
}, [noteId]);
132+
const scrollRect = scrollContainer.getBoundingClientRect();
133+
const firstLineRect = firstLine.getBoundingClientRect();
134+
setShowHeaderTitle(firstLineRect.bottom <= scrollRect.top);
135+
},
136+
[noteId],
137+
);
135138

136139
useEffect(() => {
137140
const scrollContainer = scrollContainerRef.current;
@@ -306,7 +309,7 @@ export function EditorPane({
306309
<div className="relative min-h-0 flex-1">
307310
<div
308311
className={cn(
309-
"min-h-0 h-full overflow-y-scroll overscroll-y-contain",
312+
"h-full min-h-0 overflow-y-scroll overscroll-y-contain",
310313
!isReadOnly && "cursor-text",
311314
)}
312315
data-editor-scroll-container

src/features/shell/use-shell-controller.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,16 @@ export function useShellController() {
9494
setPublishDialogOpen,
9595
setPublishShortNoteDialogOpen,
9696
} = publish;
97-
const { isPending: isDeletePublishedNotePending, mutate: mutateDeletePublishedNote } =
98-
deletePublishedNoteMutation;
97+
const {
98+
isPending: isDeletePublishedNotePending,
99+
mutate: mutateDeletePublishedNote,
100+
} = deletePublishedNoteMutation;
99101
const { isPending: isPublishNotePending, mutate: mutatePublishNote } =
100102
publishNoteMutation;
101-
const { isPending: isPublishShortNotePending, mutate: mutatePublishShortNote } =
102-
publishShortNoteMutation;
103+
const {
104+
isPending: isPublishShortNotePending,
105+
mutate: mutatePublishShortNote,
106+
} = publishShortNoteMutation;
103107
const pendingSaveTimeoutRef = useRef<number | null>(null);
104108
const isSavingRef = useRef(false);
105109

0 commit comments

Comments
 (0)