fix: display image menu
This commit is contained in:
@@ -16,6 +16,9 @@ const DropDownActions: React.FC<DropDownProps> = (props) => {
|
||||
const items = useMemo(() => {
|
||||
return menu?.items?.map((item: any) => ({
|
||||
..._.omit(item, 'locale'),
|
||||
icon: item.icon
|
||||
? React.cloneElement(item.icon, { style: { fontSize: 14 } })
|
||||
: null,
|
||||
label: item.locale ? intl.formatMessage({ id: item.label }) : item.label
|
||||
}));
|
||||
}, [menu?.items, intl]);
|
||||
|
||||
@@ -86,8 +86,8 @@ export const FilterBar: React.FC<FilterBarProps> = (props) => {
|
||||
handleInputChange,
|
||||
handleSelectChange,
|
||||
handleSearch,
|
||||
handleDeleteByBatch,
|
||||
handleClickPrimary,
|
||||
handleDeleteByBatch = null,
|
||||
handleClickPrimary = null,
|
||||
rowSelection,
|
||||
actionItems = [],
|
||||
selectOptions,
|
||||
@@ -99,8 +99,6 @@ export const FilterBar: React.FC<FilterBarProps> = (props) => {
|
||||
marginTop = 10,
|
||||
inputHolder,
|
||||
selectHolder,
|
||||
showPrimaryButton = true,
|
||||
showDeleteButton = true,
|
||||
right,
|
||||
left,
|
||||
width
|
||||
@@ -108,12 +106,12 @@ export const FilterBar: React.FC<FilterBarProps> = (props) => {
|
||||
const intl = useIntl();
|
||||
|
||||
const renderRight = useMemo(() => {
|
||||
if (!showPrimaryButton && !showDeleteButton) {
|
||||
if (!handleClickPrimary && !handleDeleteByBatch) {
|
||||
return null;
|
||||
}
|
||||
return (
|
||||
<Space size={20}>
|
||||
{showPrimaryButton ? (
|
||||
{handleClickPrimary ? (
|
||||
actionType === 'dropdown' ? (
|
||||
<DropDownActions
|
||||
menu={{
|
||||
@@ -139,7 +137,7 @@ export const FilterBar: React.FC<FilterBarProps> = (props) => {
|
||||
</Button>
|
||||
)
|
||||
) : null}
|
||||
{showDeleteButton && (
|
||||
{handleDeleteByBatch && (
|
||||
<Button
|
||||
icon={<DeleteOutlined />}
|
||||
danger
|
||||
|
||||
Reference in New Issue
Block a user