|
|
@@ -8,18 +8,6 @@ import { toastSuccess, toastError } from '~/client/util/toastr';
|
|
|
|
|
|
import { withUnstatedContainers } from '../../UnstatedUtils';
|
|
|
|
|
|
-const GiveReadOnlyAlert = React.memo((): JSX.Element => {
|
|
|
- const { t } = useTranslation('admin');
|
|
|
-
|
|
|
- return (
|
|
|
- <div className="px-4">
|
|
|
- <i className="icon-fw icon-user-unfollow mb-2"></i>{t('user_management.user_table.remove_read_only_access')}
|
|
|
- <p className="alert alert-danger">{t('user_management.user_table.cannot_give_read_only')}</p>
|
|
|
- </div>
|
|
|
- );
|
|
|
-});
|
|
|
-GiveReadOnlyAlert.displayName = 'GiveReadOnlyAlert';
|
|
|
-
|
|
|
const GiveReadOnlyButton: React.FC<{
|
|
|
adminUsersContainer: AdminUsersContainer,
|
|
|
user: IUserHasId,
|
|
|
@@ -36,13 +24,11 @@ const GiveReadOnlyButton: React.FC<{
|
|
|
}
|
|
|
}, [adminUsersContainer, t, user._id]);
|
|
|
|
|
|
- return user.admin
|
|
|
- ? <GiveReadOnlyAlert />
|
|
|
- : (
|
|
|
- <button className="dropdown-item" type="button" onClick={onClickGiveReadOnlyBtnHandler}>
|
|
|
- <i className="icon-fw icon-user-following"></i> {t('user_management.user_table.give_read_only_access')}
|
|
|
- </button>
|
|
|
- );
|
|
|
+ return (
|
|
|
+ <button className="dropdown-item" type="button" onClick={onClickGiveReadOnlyBtnHandler}>
|
|
|
+ <i className="icon-fw icon-user-following"></i> {t('user_management.user_table.give_read_only_access')}
|
|
|
+ </button>
|
|
|
+ );
|
|
|
};
|
|
|
|
|
|
/**
|