pl-fe: this might work

Signed-off-by: mkljczk <git@mkljczk.pl>
This commit is contained in:
mkljczk
2025-01-07 19:57:26 +01:00
parent 1cc92937a7
commit 475e819b5b
2 changed files with 14 additions and 9 deletions

View File

@ -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({

View File

@ -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],