Sha256: 01bd8c745466e71f990043d5722df8b773aa443b605c64862aa55a5c55fd869b

Contents?: true

Size: 1.87 KB

Versions: 105

Compression:

Stored size: 1.87 KB

Contents

/* @flow */

import React from 'react'

import CurrentFilters, { FilterDescription } from './CurrentFilters'
import FilterBackground, { FilterBackgroundProps } from './FilterBackground'
import FiltersPopover from './FiltersPopover'
import ResultsCount from './ResultsCount'
import SortMenu, {
  SortingChangeCallback,
  SortOptions,
  SortValue,
} from './SortMenu'

import Caption from '../../pb_caption/_caption'
import Flex from '../../pb_flex/_flex'
import SectionSeparator from '../../pb_section_separator/_section_separator'
export type FilterDoubleProps = {
  children: Node,
  filters?: FilterDescription,
  onSortChange: SortingChangeCallback,
  results?: number,
  sortOptions: SortOptions,
  sortValue?: SortValue,
} & FilterBackgroundProps

const FilterDouble = ({
  onSortChange,
  sortOptions,
  sortValue,
  filters,
  results,
  children,
  dark,
  minWidth,
  ...bgProps
}: FilterDoubleProps) => (
  <FilterBackground
      dark={dark}
      {...bgProps}
  >
    <Flex
        orientation="row"
        vertical="center"
    >
      <FiltersPopover
          dark={dark}
          minWidth={minWidth}
      >
        {children}
      </FiltersPopover>
      <CurrentFilters
          dark={dark}
          filters={filters}
      />
    </Flex>
    <SectionSeparator dark={dark} />
    <Flex
        className="filter-bottom"
        orientation="row"
        spacing="between"
        vertical="center"
    >
      <ResultsCount
          dark={dark}
          results={results}
          title
      />
      <Flex
          orientation="row"
          vertical="center"
      >
        <Caption
            dark={dark}
            text="sort by:"
        />
        <SortMenu
            dark={dark}
            onChange={onSortChange}
            options={sortOptions}
            value={sortValue}
        />
      </Flex>
    </Flex>
  </FilterBackground>
)

export default FilterDouble

Version data entries

105 entries across 105 versions & 1 rubygems

Version Path
playbook_ui-10.19.0 app/pb_kits/playbook/pb_filter/Filter/FilterDouble.jsx
playbook_ui-10.19.0.pre.lightbox app/pb_kits/playbook/pb_filter/Filter/FilterDouble.jsx
playbook_ui-10.18.2 app/pb_kits/playbook/pb_filter/Filter/FilterDouble.jsx
playbook_ui-10.19.0.pre.popover.alpha1 app/pb_kits/playbook/pb_filter/Filter/FilterDouble.jsx
playbook_ui-10.18.1 app/pb_kits/playbook/pb_filter/Filter/FilterDouble.jsx
playbook_ui-10.18.0 app/pb_kits/playbook/pb_filter/Filter/FilterDouble.jsx
playbook_ui-10.17.0 app/pb_kits/playbook/pb_filter/Filter/FilterDouble.jsx
playbook_ui-10.16.0 app/pb_kits/playbook/pb_filter/Filter/FilterDouble.jsx
playbook_ui-10.15.1 app/pb_kits/playbook/pb_filter/Filter/FilterDouble.jsx
playbook_ui-10.15.1.pre.alpha.rubocop.deps app/pb_kits/playbook/pb_filter/Filter/FilterDouble.jsx
playbook_ui-10.15.0 app/pb_kits/playbook/pb_filter/Filter/FilterDouble.jsx
playbook_ui-10.14.1.pre.alpha2 app/pb_kits/playbook/pb_filter/Filter/FilterDouble.jsx
playbook_ui-10.14.1.pre.alpha1 app/pb_kits/playbook/pb_filter/Filter/FilterDouble.jsx
playbook_ui-10.14.0 app/pb_kits/playbook/pb_filter/Filter/FilterDouble.jsx
playbook_ui-10.13.1 app/pb_kits/playbook/pb_filter/Filter/FilterDouble.jsx
playbook_ui-10.13.0 app/pb_kits/playbook/pb_filter/Filter/FilterDouble.jsx
playbook_ui-10.13.0.pre.node.update app/pb_kits/playbook/pb_filter/Filter/FilterDouble.jsx
playbook_ui-10.12.0 app/pb_kits/playbook/pb_filter/Filter/FilterDouble.jsx
playbook_ui-10.11.0 app/pb_kits/playbook/pb_filter/Filter/FilterDouble.jsx
playbook_ui-10.10.0 app/pb_kits/playbook/pb_filter/Filter/FilterDouble.jsx