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:
parent
8e40cf9885
commit
7e20975cb1
7 changed files with 149 additions and 112 deletions
|
@ -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 (
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue