-
Notifications
You must be signed in to change notification settings - Fork 1
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
51b8064
commit 1c18580
Showing
18 changed files
with
496 additions
and
428 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,5 @@ | ||
import { createAction } from '@reduxjs/toolkit'; | ||
import { OfferObject } from './types/types'; | ||
export const changeCity = createAction<string>('ChangeCity'); | ||
|
||
export const AddOffer = createAction<OfferObject[]>('AddOffer'); |
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,38 @@ | ||
import React from 'react'; | ||
import { City } from '../../types/types'; | ||
|
||
const CITY_ACTIVE = 'tabs__item--active'; | ||
|
||
type CitiesListProps = { | ||
currentCity: string; | ||
cities: City[]; | ||
onSelect: (cityName: string) => void; | ||
} | ||
|
||
export const ListCities: React.FC<CitiesListProps> = ({ | ||
currentCity, | ||
cities, | ||
onSelect, | ||
}) => ( | ||
<ul className="locations__list tabs__list"> | ||
{cities.map((city) => ( | ||
<li | ||
className="locations__item" | ||
key={city.title} | ||
onClick={() => { | ||
onSelect(city.title); | ||
}} | ||
> | ||
<div className={` | ||
locations__item-link | ||
tabs__item | ||
${currentCity === city.title ? CITY_ACTIVE : ''} | ||
`} | ||
> | ||
<span>{city.title}</span> | ||
</div> | ||
</li> | ||
) | ||
)} | ||
</ul> | ||
); |
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
Oops, something went wrong.