mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 21:06:42 +07:00
comments highlight
This commit is contained in:
parent
e825db6d63
commit
caeb464bb2
13 changed files with 239 additions and 115 deletions
|
@ -67,6 +67,7 @@ export const NODE_COMPONENTS: INodeComponents = {
|
|||
};
|
||||
|
||||
export const EMPTY_COMMENT: IComment = {
|
||||
id: null,
|
||||
text: '',
|
||||
files: [],
|
||||
temp_ids: [],
|
||||
|
|
|
@ -100,7 +100,7 @@ function* onPostComment({ id }: ReturnType<typeof nodePostComment>) {
|
|||
if (current_node && current_node.id === current.id) {
|
||||
// if user still browsing that node
|
||||
const { comments } = yield select(selectNode);
|
||||
yield put(nodeSetComments([comment, ...comments]));
|
||||
yield put(nodeSetComments([...comments, comment]));
|
||||
yield put(nodeSetCommentData(0, { ...EMPTY_COMMENT }));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -133,6 +133,7 @@ export interface INode {
|
|||
}
|
||||
|
||||
export interface IComment {
|
||||
id: number;
|
||||
text: string;
|
||||
temp_ids?: string[];
|
||||
files: IFile[];
|
||||
|
@ -143,6 +144,12 @@ export interface IComment {
|
|||
update_at?: string;
|
||||
}
|
||||
|
||||
export interface ICommentGroup {
|
||||
user: IUser;
|
||||
comments: IComment[];
|
||||
ids: IComment['id'][];
|
||||
}
|
||||
|
||||
export type IUploadProgressHandler = (progress: ProgressEvent) => void;
|
||||
export type IError = ValueOf<typeof ERRORS>;
|
||||
export type IValidationErrors = Record<string, IError>;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue