Sha256: 9ee6062b4c318c94b3fbe03bd45041591d4ab2012d2e379f025841ac73aa9fe1
Contents?: true
Size: 1.83 KB
Versions: 80
Compression:
Stored size: 1.83 KB
Contents
import React from 'react' import { isEmpty, map, omitBy } from 'lodash' import Body from '../../pb_body/_body' import Caption from '../../pb_caption/_caption' import Title from '../../pb_title/_title' export type FilterDescription = { [key: string]: string | null | boolean, } export type CurrentFiltersProps = { dark: boolean, filters: FilterDescription, } const hiddenFilters = (value: any) => isEmpty(value) && value !== true const CurrentFilters = ({ dark, filters }: CurrentFiltersProps): React.ReactElement => { const displayableFilters = omitBy(filters, hiddenFilters) return ( <div className="maskContainer"> { isEmpty(filters) && <div className="filters"> <Body color="light" paddingLeft="xs" size={4} tag="h4" text="No Filter Selected" /> </div> } { !isEmpty(filters) && <div className="filters"> <div className="left_gradient" /> {map(displayableFilters, (value, name) => ( <div className="filter" key={`filter-${name}`} > { value === true ? <Title dark={dark} size={4} tag="h4" text={name} /> : <div> <Caption dark={dark} text={name} /> <Title dark={dark} size={4} tag="h4" text={value} /> </div> } </div> ))} <div className="right_gradient" /> </div> } </div> ) } export default CurrentFilters
Version data entries
80 entries across 80 versions & 1 rubygems