From 15fa5d13403762993319410d71819408da92ea1a Mon Sep 17 00:00:00 2001 From: Anton Akhatov Date: Mon, 30 Oct 2023 19:23:45 +0000 Subject: [PATCH] add facades section --- .../Layers/Houses/CardContent/CardContent.tsx | 15 ++++- components/Layers/Houses/houseBase.ts | 1 + public/ekb-facades.json | 62 +++++++++++++++++++ 3 files changed, 75 insertions(+), 3 deletions(-) create mode 100644 public/ekb-facades.json diff --git a/components/Layers/Houses/CardContent/CardContent.tsx b/components/Layers/Houses/CardContent/CardContent.tsx index 5d29825a..075c02c8 100644 --- a/components/Layers/Houses/CardContent/CardContent.tsx +++ b/components/Layers/Houses/CardContent/CardContent.tsx @@ -1,8 +1,5 @@ -'use client'; - import { useContext, useEffect, useMemo, useState } from 'react'; import { useMap } from 'react-map-gl'; - import { HouseObject } from 'components/Layers/Houses/houseBase'; import { MapContext } from 'components/Map/providers/MapProvider'; import { usePopup } from 'components/Map/providers/usePopup'; @@ -17,7 +14,9 @@ import { FilterLoader } from 'components/UI/Filters/components/Loader/FilterLoad import { getLatLngFromHash } from 'helpers/hash'; import HealthProgress from '../HealthProgress/HealthProgress'; +import facades from '../../../../public/ekb-facades.json'; import styles from './CardContent.module.css'; +import { Link } from 'components/UI/Card/components/Link/Link'; export function HousesCardContent() { const { popupId } = usePopup(); @@ -45,6 +44,7 @@ export function HousesCardContent() { setPlacemark({ id: popupId, attributes: { + osmId: house['osm:id'] || null, Address: [house['addr:street'], house['addr:housenumber']] .filter(Boolean) .join(', '), @@ -126,12 +126,21 @@ export function HousesCardContent() { }); } + const facade = facades[placemark?.attributes?.osmId]; + if (facade) { + result.push({ + name: 'Фасад', + text: , + }); + } + return result; }, [ placemark?.attributes?.Management_company, placemark?.attributes?.WearAndTear, placemark?.attributes?.Series, placemark?.attributes?.Floors, + placemark?.attributes?.osmId, isEmergency, ]); diff --git a/components/Layers/Houses/houseBase.ts b/components/Layers/Houses/houseBase.ts index 96a55558..4a154f79 100644 --- a/components/Layers/Houses/houseBase.ts +++ b/components/Layers/Houses/houseBase.ts @@ -46,6 +46,7 @@ export interface HouseObject { } export interface HouseAttributes { + osmId: number | null; Address: string; Management_company: string; Series: string; diff --git a/public/ekb-facades.json b/public/ekb-facades.json new file mode 100644 index 00000000..a298fa37 --- /dev/null +++ b/public/ekb-facades.json @@ -0,0 +1,62 @@ +{ + "w38607184": { + "name": "Проспект Ленина, 27", + "link": "https://ekaterinburg.design/code/houses/Ленина, 27.pdf" + }, + "w240238471": { + "name": "Проспект Ленина, 31 / Ул. 8 Марта, 8", + "link": "https://ekaterinburg.design/code/houses/8 марта, 8 Ленина, 31.pdf" + }, + "w52170651": { + "name": "Улица 8 Марта, 2", + "link": "https://ekaterinburg.design/code/houses/8 Марта, 2.pdf" + }, + "w52170653": { + "name": "Улица 8 Марта, 5 / Переулок Химиков, 3", + "link": "https://ekaterinburg.design/code/houses/8 Марта, 5 Химиков, 3.pdf" + }, + "w52170627": { + "name": "Улица 8 Марта, 1", + "link": "https://ekaterinburg.design/code/houses/8 Марта, 1.pdf" + }, + "w52170645": { + "name": "Проспект Ленина, 29", + "link": "https://ekaterinburg.design/code/houses/Ленина, 29.pdf" + }, + "w38464427": { + "name": "Проспект Ленина, 25", + "link": "https://ekaterinburg.design/code/houses/Ленина, 25.pdf" + }, + "w52170655": { + "name": "Улица 8 Марта, 3", + "link": "https://ekaterinburg.design/code/houses/8 Марта, 3.pdf" + }, + "w52170624": { + "name": "Октябрьская площадь, 3", + "link": "https://ekaterinburg.design/code/houses/Октябрьская площадь, 3.pdf" + }, + "w52170643": { + "name": "Улица 8 Марта, 4", + "link": "https://ekaterinburg.design/code/houses/8 Марта, 4.pdf" + }, + "w52170599": { + "name": "Улица 8 Марта, 7", + "link": "https://ekaterinburg.design/code/houses/8 Марта, 7.pdf" + }, + "w52170654": { + "name": "Переулок Химиков, 4", + "link": "https://ekaterinburg.design/code/houses/Химиков, 4.pdf" + }, + "w168085496": { + "name": "Улица 8 Марта, 6", + "link": "https://ekaterinburg.design/code/houses/8 Марта, 6.pdf" + }, + "w52170642": { + "name": "Улица 8 Марта, 6", + "link": "https://ekaterinburg.design/code/houses/8 Марта, 6.pdf" + }, + "w266706707": { + "name": "Проспект Ленина, 33", + "link": "https://ekaterinburg.design/code/houses/Ленина, 33.pdf" + } +}