diff --git a/src/App.tsx b/src/App.tsx index fe7ebe3..87c602a 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -11,10 +11,22 @@ type Offer = { rating: number; type: string; isPremium: boolean; - previewImage: string; + isFavorite: boolean; NumberOfPlaces: number; - latitude: number; - longitude:number; + previewImage: string; + city: { + name: string; + location: { + latitude: number; + longitude: number; + zoom: number; + }; + }; + location: { + latitude: number; + longitude: number; + zoom: number; + }; }; type AppProps = { diff --git a/src/components/Favorites/Favorite.tsx b/src/components/Favorites/Favorite.tsx index b7525f0..c8d4033 100644 --- a/src/components/Favorites/Favorite.tsx +++ b/src/components/Favorites/Favorite.tsx @@ -6,8 +6,22 @@ type Offer = { rating: number; type: string; isPremium: boolean; - previewImage: string; + isFavorite: boolean; NumberOfPlaces: number; + previewImage: string; + city: { + name: string; + location: { + latitude: number; + longitude: number; + zoom: number; + }; + }; + location: { + latitude: number; + longitude: number; + zoom: number; + }; }; type FavoriteProps = { offers: Offer[]; diff --git a/src/components/MainPage/MainPage.tsx b/src/components/MainPage/MainPage.tsx index 4cd30d9..90845e8 100644 --- a/src/components/MainPage/MainPage.tsx +++ b/src/components/MainPage/MainPage.tsx @@ -8,10 +8,22 @@ type Offer = { rating: number; type: string; isPremium: boolean; - previewImage: string; + isFavorite: boolean; NumberOfPlaces: number; - latitude: number; - longitude:number; + previewImage: string; + city: { + name: string; + location: { + latitude: number; + longitude: number; + zoom: number; + }; + }; + location: { + latitude: number; + longitude: number; + zoom: number; + }; }; type MainPageProps = { offers: Offer[]; diff --git a/src/components/Map/Map.tsx b/src/components/Map/Map.tsx index 6ce1321..631251f 100644 --- a/src/components/Map/Map.tsx +++ b/src/components/Map/Map.tsx @@ -9,10 +9,22 @@ type Offer = { rating: number; type: string; isPremium: boolean; - previewImage: string; + isFavorite: boolean; NumberOfPlaces: number; - latitude: number; - longitude:number; + previewImage: string; + city: { + name: string; + location: { + latitude: number; + longitude: number; + zoom: number; + }; + }; + location: { + latitude: number; + longitude: number; + zoom: number; + }; }; const defaultCustomIcon = new Icon({ iconUrl: 'https://assets.htmlacademy.ru/content/intensive/javascript-1/demo/interactive-map/pin.svg', @@ -41,8 +53,8 @@ function Map(props: MainPageProps): JSX.Element { const markerLayer = layerGroup().addTo(map); offers.forEach((offer) => { const marker = new Marker({ - lat: offer.latitude, - lng: offer.longitude + lat: offer.location.latitude, + lng: offer.location.longitude }); marker .setIcon( diff --git a/src/components/Offer/Offer.tsx b/src/components/Offer/Offer.tsx index 6c9511b..9d5bd83 100644 --- a/src/components/Offer/Offer.tsx +++ b/src/components/Offer/Offer.tsx @@ -207,116 +207,7 @@ export default function Offer () {
- -
- - - - - - - - - - - - - - -
-