react-icons/bi#BiFilterAlt TypeScript Examples
The following examples show how to use
react-icons/bi#BiFilterAlt.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: MobileFilters.tsx From po8klasie with GNU General Public License v3.0 | 6 votes |
MobileFilters: FC<MobileFiltersProps> = ({ onFiltersChange, filtersValues}) => {
let [isOpen, setIsOpen] = useState(false)
const { searchView } = useProjectConfig();
const { filters: filtersConfig } = searchView as SearchViewConfig;
return (
<>
<button
className="rounded-xl border border-light px-3 py-1 mx-2 flex items-center md:hidden"
onClick={() => setIsOpen(!isOpen)}>
<BiFilterAlt className="mr-2" />
Filtry
</button>
<Dialog open={isOpen} onClose={() => setIsOpen(false)}>
<Dialog.Panel className="top-0 left-0 h-full w-full fixed z-40 bg-appBg pt-navbarHeight">
<div className="flex items-center justify-end">
<button className="p-2" onClick={() => setIsOpen(false)}>
<FiX className="text-xl" />
</button>
</div>
{filtersConfig.map(({ options, key, component, displayInRowOnMobile }) => {
const FilterComponent = mobileFiltersComponents[component as keyof typeof mobileFiltersComponents];
if (displayInRowOnMobile) return null;
return (
<FilterComponent
options={options}
onChange={onFiltersChange(key)}
value={filtersValues[key]}
/>
);
})}
</Dialog.Panel>
</Dialog>
</>
)
}