@ -306,6 +306,19 @@ const DropdownMenu = (props: IDropdownMenu) => {
|
||||
|
||||
}, [isOpen]);
|
||||
|
||||
const clonedChildren = useMemo(() => {
|
||||
if ((items?.length === 0 && !component) || !children) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return React.cloneElement(children, {
|
||||
disabled,
|
||||
onClick: handleClick,
|
||||
onKeyPress: handleKeyPress,
|
||||
ref: refs.setReference,
|
||||
});
|
||||
}, [children]);
|
||||
|
||||
if (items?.length === 0 && !component) {
|
||||
return null;
|
||||
}
|
||||
@ -330,14 +343,7 @@ const DropdownMenu = (props: IDropdownMenu) => {
|
||||
|
||||
return (
|
||||
<>
|
||||
{children ? (
|
||||
React.cloneElement(children, {
|
||||
disabled,
|
||||
onClick: handleClick,
|
||||
onKeyPress: handleKeyPress,
|
||||
ref: refs.setReference,
|
||||
})
|
||||
) : (
|
||||
{children ? clonedChildren : (
|
||||
<IconButton
|
||||
disabled={disabled}
|
||||
className={clsx({
|
||||
|
||||
@ -122,7 +122,6 @@ const checkFiltered = (index: string, filters: Array<Filter>) =>
|
||||
type APIStatus = { id: string; username?: string };
|
||||
|
||||
const makeGetStatus = () => {
|
||||
console.log('making get status');
|
||||
return createSelector(
|
||||
[
|
||||
(state: RootState, { id }: APIStatus) => state.statuses[id],
|
||||
|
||||
Reference in New Issue
Block a user