diff --git a/pairent_frontend_react/src/pages/IndexPage/index.jsx b/pairent_frontend_react/src/pages/IndexPage/index.jsx index eebba2a..1406508 100644 --- a/pairent_frontend_react/src/pages/IndexPage/index.jsx +++ b/pairent_frontend_react/src/pages/IndexPage/index.jsx @@ -96,6 +96,11 @@ const SubmitBtn = styled.button` padding: 10px; border-radius: 8px; color: #f9f9f9; + width: 180px; + + &:disabled { + background: #3a5dc8; + } `; const SearchBarFilter = styled.div` @@ -312,9 +317,18 @@ const FiltersForm = (props) => { - - - Показать варианты + + { + props.loading ? + <> + + Загрузка данных... + : + <> + + Показать варианты + + } ); @@ -331,7 +345,8 @@ export default class IndexPage extends React.Component { pageSize: 10, page: 0, data_loaded: false, - load_err: false + load_err: false, + loading_filters: false }; ApartamentService.getAll(100).then(data => { @@ -348,6 +363,8 @@ export default class IndexPage extends React.Component { * @param {Filters} filters */ async filterData(filters) { + + this.setState({loading_filters: true}); const filtered_raw = await fetch(API_ROOT + '/api/apartaments/filters/', { method: 'POST', @@ -395,9 +412,10 @@ export default class IndexPage extends React.Component { Владивостоке - + + + - { !this.state.data_loaded ? <>