Skip to content

Commit

Permalink
add facades section
Browse files Browse the repository at this point in the history
  • Loading branch information
gcor committed Oct 30, 2023
1 parent c7a9a0c commit 15fa5d1
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 3 deletions.
15 changes: 12 additions & 3 deletions components/Layers/Houses/CardContent/CardContent.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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();
Expand Down Expand Up @@ -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(', '),
Expand Down Expand Up @@ -126,12 +126,21 @@ export function HousesCardContent() {
});
}

const facade = facades[placemark?.attributes?.osmId];
if (facade) {
result.push({
name: 'Фасад',
text: <Link href={facade.link} text="Скачать макет" />,
});
}

return result;
}, [
placemark?.attributes?.Management_company,
placemark?.attributes?.WearAndTear,
placemark?.attributes?.Series,
placemark?.attributes?.Floors,
placemark?.attributes?.osmId,
isEmergency,
]);

Expand Down
1 change: 1 addition & 0 deletions components/Layers/Houses/houseBase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export interface HouseObject {
}

export interface HouseAttributes {
osmId: number | null;
Address: string;
Management_company: string;
Series: string;
Expand Down
62 changes: 62 additions & 0 deletions public/ekb-facades.json
Original file line number Diff line number Diff line change
@@ -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"
}
}

0 comments on commit 15fa5d1

Please sign in to comment.