-
Notifications
You must be signed in to change notification settings - Fork 138
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: displayed the amount of filters applied
- Loading branch information
1 parent
04c25c9
commit f4fe666
Showing
6 changed files
with
77 additions
and
29 deletions.
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
src/components/molecules/IconWithPopover/IconWithPopover.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,27 @@ | ||
import React from 'react'; | ||
import {Popover, Button} from 'antd'; | ||
|
||
import Icon from '@components/atoms/Icon'; | ||
|
||
interface IconWithPopoverProps { | ||
popoverContent: React.ReactNode | (() => React.ReactNode); | ||
popoverTrigger: string | string[]; | ||
isDisabled?: boolean; | ||
iconName?: string; | ||
buttonType?: 'default' | 'primary' | 'ghost' | 'dashed' | 'link' | 'text'; | ||
iconComponent: React.ReactNode; | ||
} | ||
|
||
const IconWithPopover: React.FC<IconWithPopoverProps> = props => { | ||
const {popoverContent, popoverTrigger, isDisabled = false, iconName, buttonType = 'link', iconComponent} = props; | ||
|
||
const iconToDisplay = iconComponent || (iconName ? <Icon name={iconName} /> : null); | ||
|
||
return ( | ||
<Popover content={popoverContent} trigger={popoverTrigger}> | ||
<Button disabled={isDisabled} type={buttonType} size="small" icon={iconToDisplay} /> | ||
</Popover> | ||
); | ||
}; | ||
|
||
export default IconWithPopover; |
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 {default} from './IconWithPopover'; |
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