From ef9328f41439a87b22a24cedf26540335cc806dd Mon Sep 17 00:00:00 2001 From: Bogdan Crisan Date: Tue, 12 Nov 2024 06:20:43 +0100 Subject: [PATCH] [ECO-2383] Add pagination navigation at the top of the market grid (#337) Co-authored-by: Matt <90358481+xbtmatt@users.noreply.github.com> --- src/typescript/frontend/src/app/global.css | 22 +++ .../components/buttons-block/index.tsx | 8 +- .../home/components/emoji-table/index.tsx | 152 ++++++++++-------- 3 files changed, 111 insertions(+), 71 deletions(-) diff --git a/src/typescript/frontend/src/app/global.css b/src/typescript/frontend/src/app/global.css index 1a915191d..37edd9c90 100644 --- a/src/typescript/frontend/src/app/global.css +++ b/src/typescript/frontend/src/app/global.css @@ -61,6 +61,28 @@ width: 18px; } +.med-pixel-search-arrows { + width: 11px; +} + +@media screen and (min-width: 768px) { + .med-pixel-search-arrows { + width: 12px; + } +} + +@media screen and (min-width: 1024px) { + .med-pixel-search-arrows { + width: 14px; + } +} + +@media screen and (min-width: 1440px) { + .med-pixel-search-arrows { + width: 18px; + } +} + .med-pixel-close { width: 12px; } diff --git a/src/typescript/frontend/src/components/pages/home/components/emoji-table/components/buttons-block/index.tsx b/src/typescript/frontend/src/components/pages/home/components/emoji-table/components/buttons-block/index.tsx index e0b9313b6..7455a1beb 100644 --- a/src/typescript/frontend/src/components/pages/home/components/emoji-table/components/buttons-block/index.tsx +++ b/src/typescript/frontend/src/components/pages/home/components/emoji-table/components/buttons-block/index.tsx @@ -11,17 +11,19 @@ export type ButtonsBlockProps = { value: number; numPages: number; onChange: (page: number) => void; + className?: string; }; const ButtonsBlock: React.FC = ({ value, numPages, onChange, + className, }: ButtonsBlockProps) => { const { isMobile } = useMatchBreakpoints(); const gap = isMobile ? "12px" : "17px"; return ( - + {/* First */} onChange(1)}> @@ -49,7 +51,7 @@ const ButtonsBlock: React.FC = ({ {"{"} - + {"}"} @@ -95,7 +97,7 @@ const ButtonsBlock: React.FC = ({ {"{"} - + {"}"} diff --git a/src/typescript/frontend/src/components/pages/home/components/emoji-table/index.tsx b/src/typescript/frontend/src/components/pages/home/components/emoji-table/index.tsx index 97000d53d..48e61b471 100644 --- a/src/typescript/frontend/src/components/pages/home/components/emoji-table/index.tsx +++ b/src/typescript/frontend/src/components/pages/home/components/emoji-table/index.tsx @@ -103,74 +103,90 @@ const EmojiTable = (props: EmojiTableProps) => { }); return ( - - - - - - - - - - - - {/* Each version of the grid must wait for the other to fully exit animate out before appearing. - This provides a smooth transition from grids of varying row lengths. */} - {markets.length > 0 ? ( - <> - - - - {shouldAnimateGrid ? ( - - ) : ( - - )} - - - - - - ) : ( -
- - - Click here to launch {emojis.join("")} ! - - -
- )} -
-
-
+ <> + + + + + + + + + + + + + {/* Each version of the grid must wait for the other to fully exit animate out before appearing. + This provides a smooth transition from grids of varying row lengths. */} + {markets.length > 0 ? ( + <> + + + + {shouldAnimateGrid ? ( + + ) : ( + + )} + + + + + + ) : ( +
+ + + Click here to launch {emojis.join("")} ! + + +
+ )} +
+
+
+ ); };