From a1788ba89b1656146f2e7adcbb6eac2d22ca670d Mon Sep 17 00:00:00 2001 From: Kalle <38327916+Sendouc@users.noreply.github.com> Date: Sun, 29 Mar 2026 17:59:57 +0300 Subject: [PATCH] Add friends widget Closes #2914 --- app/components/Pagination.tsx | 57 +++++++++++-------- .../friends/FriendRepository.server.ts | 28 +++++++++ .../user-page/components/Widget.module.css | 20 +++++++ app/features/user-page/components/Widget.tsx | 57 +++++++++++++++++++ .../core/widgets/portfolio-loaders.server.ts | 4 ++ .../user-page/core/widgets/portfolio.ts | 1 + locales/da/user.json | 3 + locales/de/user.json | 3 + locales/en/user.json | 3 + locales/es-ES/user.json | 3 + locales/es-US/user.json | 3 + locales/fr-CA/user.json | 3 + locales/fr-EU/user.json | 3 + locales/he/user.json | 3 + locales/it/user.json | 3 + locales/ja/user.json | 3 + locales/ko/user.json | 3 + locales/nl/user.json | 3 + locales/pl/user.json | 3 + locales/pt-BR/user.json | 3 + locales/ru/user.json | 3 + locales/zh/user.json | 3 + 22 files changed, 191 insertions(+), 24 deletions(-) diff --git a/app/components/Pagination.tsx b/app/components/Pagination.tsx index 79463f0eb..e33c910f9 100644 --- a/app/components/Pagination.tsx +++ b/app/components/Pagination.tsx @@ -9,12 +9,15 @@ export function Pagination({ nextPage, previousPage, setPage, + compact, }: { currentPage: number; pagesCount: number; nextPage: () => void; previousPage: () => void; setPage: (page: number) => void; + /** Renders only the current page number with prev/next arrows */ + compact?: boolean; }) { const pages = getPageNumbers(currentPage, pagesCount); const [jumpToIndex, setJumpToIndex] = React.useState(null); @@ -30,30 +33,36 @@ export function Pagination({ > - {pages.map((page, index) => - page.value === "..." ? ( - setJumpToIndex(index)} - onClose={() => setJumpToIndex(null)} - onJump={(page) => { - setPage(page); - setJumpToIndex(null); - }} - /> - ) : ( - - ), + {compact ? ( + + {currentPage} + + ) : ( + pages.map((page, index) => + page.value === "..." ? ( + setJumpToIndex(index)} + onClose={() => setJumpToIndex(null)} + onJump={(page) => { + setPage(page); + setJumpToIndex(null); + }} + /> + ) : ( + + ), + ) )}