use ApartmentsList for displaying apartments in favoutires page

This commit is contained in:
b1ek 2023-05-09 12:29:35 +10:00
parent 85ff547eea
commit fd731ee0e3
Signed by: blek
GPG Key ID: 14546221E3595D0C
2 changed files with 2 additions and 8 deletions

View File

@ -9,7 +9,6 @@ import CardApartment from '../CardApartament';
*/ */
export default function ApartmentsList(props) { export default function ApartmentsList(props) {
const list = props.list; const list = props.list;
console.log(list);
return ( return (
<div> <div>

View File

@ -1,9 +1,9 @@
import React, { useEffect, useState } from 'react'; import React, { useEffect, useState } from 'react';
import ApartamentService from '../../API/ApartamentService'; import ApartamentService from '../../API/ApartamentService';
import ApartmentsList from '../ApartmentsList';
import {useFetching} from '../../hooks/useFetching'; import {useFetching} from '../../hooks/useFetching';
import {getPageCount} from '../../utils/Pages'; import {getPageCount} from '../../utils/Pages';
import CardApartament from '../CardApartament';
import Pagination from '../UI/Pagination'; import Pagination from '../UI/Pagination';
const FavoritesApartamentsList = () => { const FavoritesApartamentsList = () => {
@ -51,12 +51,7 @@ const FavoritesApartamentsList = () => {
{isApartamentsLoading && {isApartamentsLoading &&
<h1 style={{textAlign: 'center'}}>Идет загрузка...</h1> <h1 style={{textAlign: 'center'}}>Идет загрузка...</h1>
} }
{apartamentsFavorites.map((apartament, index) => <ApartmentsList list={apartamentsFavorites}/>
<>
<CardApartament results={apartament}/>
<div className="separationLine"></div>
</>
)}
<Pagination page={page} changePage={changePage} viewAll={viewAll} totalPages={totalPages}/> <Pagination page={page} changePage={changePage} viewAll={viewAll} totalPages={totalPages}/>
</> </>
); );