-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
88d241f
commit d7ad574
Showing
8 changed files
with
191 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
import styled from "styled-components"; | ||
|
||
// const getImage = (props) => props.$bgImage; | ||
|
||
export const CarItem = styled.li` | ||
display: flex; | ||
gap: 24px; | ||
width: 888px; | ||
height: 358px; | ||
padding: 24px; | ||
border: 1px solid ${(p) => p.theme.colors.borderColor}; | ||
border-radius: 20px; | ||
`; | ||
|
||
export const CarImage = styled.div` | ||
width: 100%; | ||
height: 310px; | ||
border-radius: 10px; | ||
background-image: url(${(props) => props.$bgImage}); | ||
background-size: auto 100%; | ||
background-repeat: no-repeat; | ||
background-position: center; | ||
overflow: hidden; | ||
`; | ||
|
||
export const HeadInfocontainer = styled.div` | ||
display: flex; | ||
justify-content: space-between; | ||
`; | ||
|
||
export const PriceContainer = styled.div` | ||
display: flex; | ||
gap: 10px; | ||
`; | ||
export const HeadInfo = styled.p` | ||
font-size: 24px; | ||
line-height: 30px; | ||
font-weight: 600; | ||
`; | ||
|
||
export const LocationAndRating = styled.div` | ||
display: flex; | ||
gap: 16px; | ||
`; | ||
|
||
export const Desctiption = styled.p` | ||
width: 525px; | ||
white-space: nowrap; | ||
overflow: hidden; | ||
text-overflow: ellipsis; | ||
color: ${(p) => p.theme.colors.grey}; | ||
`; | ||
|
||
export const TagsContainer = styled.div` | ||
display: flex; | ||
flex-wrap: wrap; | ||
gap: 8px; | ||
height: 96px; | ||
overflow: hidden; | ||
margin-top: 32px; | ||
margin-bottom: 32px; | ||
`; | ||
|
||
export const TagContainer = styled.div` | ||
padding: 12px 18px; | ||
background-color: ${(p) => p.theme.colors.mainWhite}; | ||
border-radius: 100px; | ||
`; | ||
|
||
export const TagText = styled.p` | ||
line-height: 20px; | ||
background-color: ${(p) => p.theme.colors.mainWhite}; | ||
`; | ||
|
||
export const ShowMoreBtn = styled.button` | ||
width: 166px; | ||
height: 56px; | ||
background-color: ${(p) => p.theme.colors.red}; | ||
border-radius: 200px; | ||
border: none; | ||
color: ${(p) => p.theme.colors.buttonText}; | ||
transition: background-color ${(p) => p.theme.transition.transitionDurAndFunc}; | ||
&:hover { | ||
background-color: ${(p) => p.theme.colors.hoverColor}; | ||
} | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,19 @@ | ||
import { useSelector } from "react-redux"; | ||
import { selectCars } from "../../redux/cars/carsSelectors"; | ||
import { Car } from "../Car/Car"; | ||
import { CarList, ListContainer, LoadMore } from "./CarsList.styled"; | ||
|
||
export const CarsList = () => { | ||
const cars = useSelector(selectCars); | ||
|
||
return ( | ||
<div> | ||
<ul> | ||
<ListContainer> | ||
<CarList> | ||
{cars.map((car) => { | ||
return <Car key={car.id} car={car.car} />; | ||
})} | ||
</ul> | ||
</div> | ||
</CarList> | ||
<LoadMore>Load more</LoadMore> | ||
</ListContainer> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import styled from "styled-components"; | ||
|
||
export const ListContainer = styled.div` | ||
display: flex; | ||
flex-direction: column; | ||
gap: 50px; | ||
`; | ||
|
||
export const CarList = styled.ul` | ||
display: flex; | ||
flex-direction: column; | ||
gap: 32px; | ||
`; | ||
|
||
export const LoadMore = styled.button` | ||
width: 145px; | ||
height: 56px; | ||
margin: 0 auto; | ||
background-color: transparent; | ||
border: 1px solid ${(p) => p.theme.colors.loadMoreBorderColor}; | ||
border-radius: 200px; | ||
transition: border ${(p) => p.theme.transition.transitionDurAndFunc}; | ||
&:hover { | ||
border: 1px solid ${(p) => p.theme.colors.red}; | ||
} | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -90,5 +90,9 @@ button { | |
margin: 0 auto; | ||
padding: 100px 64px; | ||
max-width: 1440px; | ||
display: flex; | ||
gap: 64px; | ||
} | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters