1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-04-25 04:46:40 +07:00

show like button to guests

This commit is contained in:
Fedor Katurov 2023-10-30 17:37:31 +06:00
parent 8e40cf9885
commit 7e20975cb1
7 changed files with 149 additions and 112 deletions

View file

@ -20,19 +20,19 @@ export interface Props {
const NodeCommentForm: FC<Props> = observer(({ saveComment }) => {
const { user, isUser } = useAuth();
const showLoginDialog = useShowModal(Dialog.Login);
const showRegisterDialog = useShowModal(Dialog.Register);
const uploader = useUploader(UploadSubject.Comment, UploadTarget.Comments);
const onCommentSave = useCallback(
async (comment: IComment) => {
if (!isUser) {
showLoginDialog({});
showRegisterDialog({});
return;
}
return saveComment(comment);
},
[isUser, showLoginDialog, saveComment],
[isUser, showRegisterDialog, saveComment],
);
return (