mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 04:46:40 +07:00
added comment to redux
This commit is contained in:
parent
56f62950d2
commit
b4d7bd2c8a
2 changed files with 10 additions and 6 deletions
|
@ -1,14 +1,13 @@
|
||||||
import uuid from 'uuid4';
|
|
||||||
import { createReducer } from '~/utils/reducer';
|
import { createReducer } from '~/utils/reducer';
|
||||||
import { INode } from '../types';
|
import { INode, IComment } from '../types';
|
||||||
import { EMPTY_BLOCK, EMPTY_NODE } from './constants';
|
import { EMPTY_NODE } from './constants';
|
||||||
import { NODE_HANDLERS } from './handlers';
|
import { NODE_HANDLERS } from './handlers';
|
||||||
import { EMPTY_FILE } from '../uploads/constants';
|
|
||||||
|
|
||||||
export type INodeState = Readonly<{
|
export type INodeState = Readonly<{
|
||||||
is_loading: boolean;
|
is_loading: boolean;
|
||||||
editor: INode;
|
editor: INode;
|
||||||
current: INode;
|
current: Partial<INode>;
|
||||||
|
comments: IComment[];
|
||||||
error: string;
|
error: string;
|
||||||
errors: Record<string, string>;
|
errors: Record<string, string>;
|
||||||
}>;
|
}>;
|
||||||
|
@ -20,7 +19,8 @@ const INITIAL_STATE: INodeState = {
|
||||||
blocks: [],
|
blocks: [],
|
||||||
files: [],
|
files: [],
|
||||||
},
|
},
|
||||||
current: null,
|
current: {},
|
||||||
|
comments: [],
|
||||||
is_loading: false,
|
is_loading: false,
|
||||||
error: null,
|
error: null,
|
||||||
errors: {},
|
errors: {},
|
||||||
|
|
|
@ -113,6 +113,10 @@ export interface INode {
|
||||||
updatedAt?: string;
|
updatedAt?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface IComment {
|
||||||
|
text: string;
|
||||||
|
}
|
||||||
|
|
||||||
export type IUploadProgressHandler = (progress: ProgressEvent) => void;
|
export type IUploadProgressHandler = (progress: ProgressEvent) => void;
|
||||||
export type IError = ValueOf<typeof ERRORS>;
|
export type IError = ValueOf<typeof ERRORS>;
|
||||||
export type IValidationErrors = Record<string, IError>;
|
export type IValidationErrors = Record<string, IError>;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue