|
|
@@ -16,20 +16,13 @@ export const NotAvailableForGuest = ({ children }: NotAvailableForGuestProps): J
|
|
|
const { data: isGuestUser } = useIsGuestUser();
|
|
|
const isDisabled = !!isGuestUser;
|
|
|
|
|
|
- const id = children.props.id || `grw-not-available-for-guest-${Math.random().toString(32).substring(2)}`;
|
|
|
-
|
|
|
- // clone and add className
|
|
|
- const clonedChild = React.cloneElement(children, {
|
|
|
- id,
|
|
|
- className: `${children.props.className} grw-not-available-for-guest`,
|
|
|
- });
|
|
|
-
|
|
|
+ const id = `grw-not-available-for-guest-${Math.random().toString(32).substring(2)}`;
|
|
|
|
|
|
return (
|
|
|
<>
|
|
|
<div id={id}>
|
|
|
<Disable disabled={isDisabled}>
|
|
|
- { clonedChild }
|
|
|
+ { children }
|
|
|
</Disable>
|
|
|
</div>
|
|
|
<UncontrolledTooltip placement="top" target={id}>{t('Not available for guest')}</UncontrolledTooltip>
|