-
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
74 changed files
with
1,841 additions
and
2,772 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
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 was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,51 +1,63 @@ | ||
import React from 'react'; | ||
import styled from 'styled-components'; | ||
import { Accordion, AccordionItem, Link, LinkSize } from 'ekb'; | ||
import { FilterConfigItem, FilterType } from 'types/Filters.types'; | ||
import { Toggle } from 'components/Filters/components/Toggle/Toggle'; | ||
import { Filter } from 'components/Filters/components/Filter/Filter'; | ||
import styles from './Filters.module.css'; | ||
|
||
interface Props { | ||
filters: Record<FilterType, FilterConfigItem>; | ||
activeFilter: FilterType; | ||
onToggleClick: (type: FilterType) => void; | ||
} | ||
|
||
const Notice = styled.div` | ||
margin-top: 12px; | ||
padding: 12px 16px; | ||
background: #3a4155; | ||
color: #9c9ea8; | ||
font-size: 14px; | ||
border-radius: 4px; | ||
`; | ||
|
||
export function Filters({ filters, activeFilter, onToggleClick }: Props) { | ||
return ( | ||
<div className={styles.filters__body}> | ||
<Accordion> | ||
{(Object.entries(filters) as [FilterType, FilterConfigItem][]).map( | ||
([type, { component, title, isVerified }], idx) => { | ||
const id = `id:${type}-${idx}`; | ||
const isActive = type === activeFilter; | ||
const toggle = () => onToggleClick(type); | ||
|
||
return ( | ||
<div key={id} className={styles.filters__item}> | ||
<Toggle | ||
id={id} | ||
isActive={isActive} | ||
onClick={onToggleClick} | ||
type={type} | ||
label={title} | ||
/> | ||
<AccordionItem | ||
key={id} | ||
title={title} | ||
isSelected={isActive} | ||
toggle={toggle} | ||
horizontalGap={16} | ||
verticalGap={16} | ||
> | ||
{component && ( | ||
<Filter isActive={isActive}> | ||
<> | ||
{isActive ? component : null} | ||
{!isVerified && ( | ||
<div className={styles.filters__notice}> | ||
<Notice> | ||
Данные берутся из публичных источников | ||
и содержат неточности.{' '} | ||
<a href="https://tally.so#tally-open=wLzxEG&tally-width=650&tally-overlay=1&tally-emoji-animation=none"> | ||
<Link | ||
size={LinkSize.SMALL} | ||
href="https://tally.so#tally-open=wLzxEG&tally-width=650&tally-overlay=1&tally-emoji-animation=none" | ||
> | ||
Оставьте фидбек | ||
</a> | ||
</Link> | ||
— помогите улучшить карту. | ||
</div> | ||
</Notice> | ||
)} | ||
</Filter> | ||
</> | ||
)} | ||
</div> | ||
</AccordionItem> | ||
); | ||
}, | ||
)} | ||
</div> | ||
</Accordion> | ||
); | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
4b2621f
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-z1qoqp52j-ekbdev.vercel.app
https://ekbdev-map-refactor3.vercel.app
Built with commit 4b2621f.
This pull request is being automatically deployed with vercel-action