Skip to content

Commit

Permalink
Feat(JSX) Update styles
Browse files Browse the repository at this point in the history
  • Loading branch information
ViktorSvertoka committed Oct 9, 2023
1 parent b766e48 commit 9f3e156
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
7 changes: 5 additions & 2 deletions src/components/CarItem/CarItem.styled.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ export const TitleWrap = styled.div`

export const Title = styled.h3`
color: #121417;
font-size: 16px;
font-size: 14px;
font-weight: 500;
line-height: 1.5;
`;

export const Span = styled.span`
color: #3470ff;
font-size: 16px;
font-size: 14px;
font-weight: 500;
line-height: 1.5;
`;
Expand All @@ -59,6 +59,9 @@ export const List = styled.ul`
width: fit-content;
row-gap: 4px;
margin-bottom: 28px;
width: 255px;
height: 40px;
overflow: hidden;
`;

export const Item = styled.li`
Expand Down
5 changes: 2 additions & 3 deletions src/pages/Catalog/Catalog.jsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import React, { useState, useEffect } from 'react';
import CarItem from 'components/CarItem/CarItem';
import { WrapperFilter, WrapperList, LoadMore } from './Catalog.styled'; // Добавьте импорт для кнопки LoadMore
import { WrapperFilter, WrapperList, LoadMore } from './Catalog.styled';
import Filter from 'components/Filter/Filter';

import { useGetCarsByPageQuery } from '../../redux/operations';
import { Loader } from 'components/Loader/Loader';

export default function Catalog() {
const [page, setPage] = useState(1);
const [allCars, setAllCars] = useState([]); // Стейт для хранения всех карточек
const [allCars, setAllCars] = useState([]);

const { data, error, isLoading, isFetching } = useGetCarsByPageQuery(page);

Expand All @@ -18,7 +18,6 @@ export default function Catalog() {

useEffect(() => {
if (data) {
// Обновляем стейт allCars, добавляя новые карточки
setAllCars(prevCars => [...prevCars, ...data]);
}
}, [data]);
Expand Down

0 comments on commit 9f3e156

Please sign in to comment.