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) => { setState({rooms: apart_sizes[e.target.value]})} + onChange={e => setState({rooms: apart_sizes[e.target.value] ?? apart_sizes[5]})} value={state.rooms.value} > @@ -412,7 +412,7 @@ export default class IndexPage extends React.Component { totalPages={pages} page={page} onChange={(page) => this.setState({ page })} - showAll={false} + showAllEnabled={false} /> );