From 4891721cc061aae2e84f58395f4cb232f0f14486 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sat, 30 Aug 2025 17:06:21 +0300 Subject: [PATCH] chore(react): fix editorconfig --- .editorconfig | 2 +- apps/client/src/widgets/collections/Pagination.tsx | 11 ++++++----- .../src/widgets/view_widgets/list_or_grid_view.ts | 10 ---------- 3 files changed, 7 insertions(+), 16 deletions(-) diff --git a/.editorconfig b/.editorconfig index cd301498e..cebb2ba58 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,6 +1,6 @@ root = true -[*.{js,ts,.tsx}] +[*.{js,ts,tsx}] charset = utf-8 end_of_line = lf indent_size = 4 diff --git a/apps/client/src/widgets/collections/Pagination.tsx b/apps/client/src/widgets/collections/Pagination.tsx index 9d4782da4..435f9049b 100644 --- a/apps/client/src/widgets/collections/Pagination.tsx +++ b/apps/client/src/widgets/collections/Pagination.tsx @@ -33,10 +33,10 @@ export function Pager({ page, pageSize, setPage, pageCount, totalNotes }: Omit

setPage(i)} > - {i} + {i} )) - } else { + } else { // Current page children.push({i}) } @@ -52,6 +52,7 @@ export function Pager({ page, pageSize, setPage, pageCount, totalNotes }: Omit

{children} + // no need to distinguish "note" vs "notes" since in case of one result, there's no paging at all ({t("pagination.total_notes", { count: totalNotes })}) ) @@ -59,7 +60,7 @@ export function Pager({ page, pageSize, setPage, pageCount, totalNotes }: Omit

(); + const [ pageNotes, setPageNotes ] = useState(); // Parse page size. const [ pageSize ] = useNoteLabel(note, "pageSize"); @@ -72,7 +73,7 @@ export function usePagination(note: FNote, noteIds: string[]): PaginationContext const pageCount = Math.ceil(noteIds.length / normalizedPageSize); // Obtain notes within the range. - const pageNoteIds = noteIds.slice(startIdx, Math.min(endIdx, noteIds.length)); + const pageNoteIds = noteIds.slice(startIdx, Math.min(endIdx, noteIds.length)); useEffect(() => { froca.getNotes(pageNoteIds).then(setPageNotes); @@ -83,4 +84,4 @@ export function usePagination(note: FNote, noteIds: string[]): PaginationContext pageSize: normalizedPageSize, totalNotes: noteIds.length }; -} \ No newline at end of file +} diff --git a/apps/client/src/widgets/view_widgets/list_or_grid_view.ts b/apps/client/src/widgets/view_widgets/list_or_grid_view.ts index 8e88ebdcf..0b1d6b579 100644 --- a/apps/client/src/widgets/view_widgets/list_or_grid_view.ts +++ b/apps/client/src/widgets/view_widgets/list_or_grid_view.ts @@ -39,19 +39,9 @@ class ListOrGridView extends ViewMode<{}> { this.$noteList.show(); - this.renderPager(); - return this.$noteList; } - renderPager() { - - - - // no need to distinguish "note" vs "notes" since in case of one result, there's no paging at all - $pager.append(``); - } - async renderNote(note: FNote, expand: boolean = false) { const { $renderedAttributes } = await attributeRenderer.renderNormalAttributes(note);