-
Notifications
You must be signed in to change notification settings - Fork 0
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
Showing
22 changed files
with
8,228 additions
and
229 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
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 @@ | ||
export function HouseFacadeFilter() {} |
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
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,61 @@ | ||
import { useEffect } from 'react'; | ||
import { useMap } from 'react-map-gl'; | ||
import { useSelector } from 'react-redux'; | ||
import { activeFilterSelector } from 'state/features/selectors'; | ||
import { FilterType } from 'types/Filters.types'; | ||
import { BUILDING_LAYER_ID } from 'constants/map'; | ||
import { DEFAULT_BULDING_COLOR_NORMAL } from 'constants/colors'; | ||
import useMapObjectState from '../providers/useMapObjectState'; | ||
import { getLayerStyle } from '../helpers/getFeatureState'; | ||
import facades from '../../../public/ekb-facades.json'; | ||
|
||
const FACADES_IDS = Object.keys(facades); | ||
|
||
function FacadeStyles() { | ||
const ekbMap = useMap(); | ||
|
||
useEffect(() => { | ||
const map = ekbMap?.current?.getMap?.(); | ||
|
||
map.setStyle({ | ||
...map?.getStyle(), | ||
layers: map?.getStyle().layers.map((layer) => { | ||
if (layer.id === BUILDING_LAYER_ID) { | ||
return { | ||
...layer, | ||
paint: { | ||
// @ts-ignore | ||
...layer.paint, | ||
'fill-extrusion-color': [ | ||
'match', | ||
['get', 'osm:id'], | ||
['literal'].concat(FACADES_IDS), | ||
getLayerStyle<string>({ | ||
initial: 'rgba(129, 255, 0, 0.75)', | ||
hover: 'rgba(129, 255, 0, 0.90)', | ||
active: 'rgba(129, 255, 0, 1)', | ||
}), | ||
DEFAULT_BULDING_COLOR_NORMAL, | ||
], | ||
}, | ||
}; | ||
} | ||
return layer; | ||
}), | ||
}); | ||
}, [ekbMap]); | ||
|
||
useMapObjectState('building'); | ||
|
||
return null; | ||
} | ||
|
||
export function FacadeSource() { | ||
const activeFilter = useSelector(activeFilterSelector); | ||
|
||
if (activeFilter !== FilterType.HouseFacades) { | ||
return null; | ||
} | ||
|
||
return <FacadeStyles />; | ||
} |
39 changes: 39 additions & 0 deletions
39
components/UI/Card/components/DownloadButton/DownloadButton.module.css
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,39 @@ | ||
.download_button { | ||
height: 34px; | ||
width: 100%; | ||
display: flex; | ||
align-items: center; | ||
border-radius: 8px; | ||
padding: 8px 12px; | ||
transition: all 0.15 ease; | ||
} | ||
.primary { | ||
color: #81ff00; | ||
background-color: rgba(129, 255, 0, 0.16); | ||
} | ||
.primary:hover { | ||
background-color: rgba(129, 255, 0, 0.24); | ||
} | ||
.primary:active { | ||
background-color: rgba(129, 255, 0, 0.32); | ||
} | ||
.secondary { | ||
color: #c8a563; | ||
background-color: rgba(200, 165, 99, 0.16); | ||
} | ||
.secondary:hover { | ||
background-color: rgba(200, 165, 99, 0.24); | ||
} | ||
.secondary:active { | ||
background-color: rgba(200, 165, 99, 0.32); | ||
} | ||
.file_name { | ||
display: flex; | ||
align-items: center; | ||
font-size: 14px; | ||
gap: 4px; | ||
} | ||
/* .file_size { | ||
font-size: 12px; | ||
line-height: 14px; | ||
} */ |
30 changes: 30 additions & 0 deletions
30
components/UI/Card/components/DownloadButton/DownloadButton.tsx
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,30 @@ | ||
import classNames from 'classnames'; | ||
import DownloadIcon from '../../../Icons/DownloadIcon'; | ||
import styles from './DownloadButton.module.css'; | ||
|
||
type Props = { | ||
type: 'primary' | 'secondary'; | ||
name: string; | ||
link: string; | ||
}; | ||
|
||
const COLORS = { | ||
primary: '#81FF00', | ||
secondary: '#C8A563', | ||
} as const; | ||
|
||
export default function DownloadButton({ type, name, link }: Props) { | ||
return ( | ||
<a | ||
href={link} | ||
className={classNames(styles.download_button, styles[type])} | ||
target="_blank" | ||
rel="noreferrer" | ||
> | ||
<div className={styles.file_name}> | ||
<DownloadIcon color={COLORS[type]} /> | ||
<p>{name}</p> | ||
</div> | ||
</a> | ||
); | ||
} |
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,12 @@ | ||
.facade { | ||
display: flex; | ||
gap: 8px; | ||
flex-direction: column; | ||
} | ||
|
||
.facade_title { | ||
font-size: 16px; | ||
line-height: 1.3; | ||
font-weight: 400; | ||
margin: 0; | ||
} |
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,18 @@ | ||
import DownloadButton from '../DownloadButton/DownloadButton'; | ||
import styles from './Facade.module.css'; | ||
|
||
type Props = { | ||
facade: { | ||
name: string; | ||
link: string; | ||
}; | ||
}; | ||
|
||
export default function Facade({ facade }: Props) { | ||
return ( | ||
<div className={styles.facade}> | ||
<h3 className={styles.facade_title}>Дизайн-код фасада</h3> | ||
<DownloadButton type="primary" name={facade.name} link={facade.link} /> | ||
</div> | ||
); | ||
} |
Oops, something went wrong.
da1d0c7
There was a problem hiding this comment.
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-mbztf83nx-ekbdev.vercel.app
https://ekbdev-map-facades.vercel.app
Built with commit da1d0c7.
This pull request is being automatically deployed with vercel-action