4364-feat(front): Display tags in multi-select picker (#4419)
* feat: add tags in multi select picker * feat: display MenuItemLeftContent if no color passed --------- Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
This commit is contained in:
@ -108,6 +108,7 @@ export const ObjectFilterDropdownOptionSelect = () => {
|
|||||||
handleMultipleOptionSelectChange(option, selected)
|
handleMultipleOptionSelectChange(option, selected)
|
||||||
}
|
}
|
||||||
text={option.label}
|
text={option.label}
|
||||||
|
color={option.color}
|
||||||
className=""
|
className=""
|
||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
|
|||||||
@ -1,9 +1,11 @@
|
|||||||
import styled from '@emotion/styled';
|
import styled from '@emotion/styled';
|
||||||
|
import { Tag } from 'tsup.ui.index';
|
||||||
|
|
||||||
import { IconComponent } from '@/ui/display/icon/types/IconComponent';
|
import { IconComponent } from '@/ui/display/icon/types/IconComponent';
|
||||||
import { Checkbox } from '@/ui/input/components/Checkbox';
|
import { Checkbox } from '@/ui/input/components/Checkbox';
|
||||||
|
import { MenuItemLeftContent } from '@/ui/navigation/menu-item/internals/components/MenuItemLeftContent';
|
||||||
|
import { ThemeColor } from '@/ui/theme/constants/MainColorNames';
|
||||||
|
|
||||||
import { MenuItemLeftContent } from '../internals/components/MenuItemLeftContent';
|
|
||||||
import { StyledMenuItemBase } from '../internals/components/StyledMenuItemBase';
|
import { StyledMenuItemBase } from '../internals/components/StyledMenuItemBase';
|
||||||
|
|
||||||
const StyledLeftContentWithCheckboxContainer = styled.div`
|
const StyledLeftContentWithCheckboxContainer = styled.div`
|
||||||
@ -14,6 +16,7 @@ const StyledLeftContentWithCheckboxContainer = styled.div`
|
|||||||
`;
|
`;
|
||||||
|
|
||||||
type MenuItemMultiSelectProps = {
|
type MenuItemMultiSelectProps = {
|
||||||
|
color?: ThemeColor;
|
||||||
LeftIcon?: IconComponent;
|
LeftIcon?: IconComponent;
|
||||||
selected: boolean;
|
selected: boolean;
|
||||||
text: string;
|
text: string;
|
||||||
@ -22,6 +25,7 @@ type MenuItemMultiSelectProps = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const MenuItemMultiSelect = ({
|
export const MenuItemMultiSelect = ({
|
||||||
|
color,
|
||||||
LeftIcon,
|
LeftIcon,
|
||||||
text,
|
text,
|
||||||
selected,
|
selected,
|
||||||
@ -36,7 +40,11 @@ export const MenuItemMultiSelect = ({
|
|||||||
<StyledMenuItemBase className={className} onClick={handleOnClick}>
|
<StyledMenuItemBase className={className} onClick={handleOnClick}>
|
||||||
<StyledLeftContentWithCheckboxContainer>
|
<StyledLeftContentWithCheckboxContainer>
|
||||||
<Checkbox checked={selected} />
|
<Checkbox checked={selected} />
|
||||||
<MenuItemLeftContent LeftIcon={LeftIcon} text={text} />
|
{color ? (
|
||||||
|
<Tag color={color} text={text} Icon={LeftIcon} />
|
||||||
|
) : (
|
||||||
|
<MenuItemLeftContent LeftIcon={LeftIcon} text={text} />
|
||||||
|
)}
|
||||||
</StyledLeftContentWithCheckboxContainer>
|
</StyledLeftContentWithCheckboxContainer>
|
||||||
</StyledMenuItemBase>
|
</StyledMenuItemBase>
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user