From db071362cbdeef3629f5a1631bf07c50918f2166 Mon Sep 17 00:00:00 2001 From: b1ek Date: Fri, 12 May 2023 19:51:23 +1000 Subject: [PATCH] fix index page WSOD on select --- .../src/components/UI/Pagination/index.jsx | 15 +++++++++++---- .../src/pages/IndexPage/index.jsx | 6 +++--- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/pairent_frontend_react/src/components/UI/Pagination/index.jsx b/pairent_frontend_react/src/components/UI/Pagination/index.jsx index 7223825..9c8f7c4 100644 --- a/pairent_frontend_react/src/components/UI/Pagination/index.jsx +++ b/pairent_frontend_react/src/components/UI/Pagination/index.jsx @@ -1,7 +1,14 @@ import React from 'react'; +import styled from 'styled-components'; + import {getPagesArray, getPreviousAndNextPage} from "../../../utils/Pages"; -const Pagination = ({totalPages, page, changePage, onChange, viewAll, showAll}) => { +const PageButtonContainer = styled.div` + margin-top: 24px; + display: inline-block; +`; + +const Pagination = ({totalPages, page, changePage, onChange, viewAll, showAllEnabled}) => { let pagesArray = getPagesArray(totalPages); let [previousPage, nextPage] = getPreviousAndNextPage(totalPages, page); @@ -16,9 +23,9 @@ const Pagination = ({totalPages, page, changePage, onChange, viewAll, showAll}) } return ( -
+ { - showAll ? + showAllEnabled ? : null }
@@ -36,7 +43,7 @@ const Pagination = ({totalPages, page, changePage, onChange, viewAll, showAll})
-
+ ); }; diff --git a/pairent_frontend_react/src/pages/IndexPage/index.jsx b/pairent_frontend_react/src/pages/IndexPage/index.jsx index 9a3ac21..8929230 100644 --- a/pairent_frontend_react/src/pages/IndexPage/index.jsx +++ b/pairent_frontend_react/src/pages/IndexPage/index.jsx @@ -176,7 +176,7 @@ const FiltersForm = (props) => { address: '', - rooms: { value: -1, label: 'Выберите' }, + rooms: apart_sizes[5], form_err: false }; @@ -260,7 +260,7 @@ const FiltersForm = (props) => {