Skip to content

Commit

Permalink
add facades section
Browse files Browse the repository at this point in the history
  • Loading branch information
gcor committed Nov 5, 2023
1 parent c0246d4 commit 30affa8
Show file tree
Hide file tree
Showing 4 changed files with 845 additions and 99 deletions.
16 changes: 12 additions & 4 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 @@ -14,9 +11,10 @@ import { Section } from 'components/UI/Card/components/Section/Section';
import { Sources } from 'components/UI/Card/components/Sources/Sources';
import { EditObjectButtonLink } from 'components/UI/EditObjectButtonLink/EditObjectButtonLink';
import { FilterLoader } from 'components/UI/Filters/components/Loader/FilterLoader';

import { Link } from 'components/UI/Card/components/Link/Link';
import { getLatLngFromHash } from 'helpers/hash';
import HealthProgress from '../HealthProgress/HealthProgress';
import facades from '../../../../public/ekb-facades.json';
import styles from './CardContent.module.css';

export function HousesCardContent() {
Expand Down Expand Up @@ -45,6 +43,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 +125,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
Loading

1 comment on commit 30affa8

@ekbdev
Copy link

@ekbdev ekbdev commented on 30affa8 Nov 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deploy preview for map ready!

✅ Preview
https://map-cgb8zzi93-ekbdev.vercel.app
https://ekbdev-map-facades.vercel.app

Built with commit 30affa8.
This pull request is being automatically deployed with vercel-action

Please sign in to comment.