mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-26 05:16:41 +07:00
sagas for node creation dialog
This commit is contained in:
parent
265b075ddc
commit
1b6a81d27c
11 changed files with 119 additions and 22 deletions
|
@ -1,6 +1,8 @@
|
|||
import { ValueOf } from '~/redux/types';
|
||||
import { EditorDialogImage } from '~/containers/editors/EditorDialogImage';
|
||||
import { LoginDialog } from '~/containers/dialogs/LoginDialog';
|
||||
import { EditorDialogImage } from '~/containers/editors/EditorDialogImage';
|
||||
import { EditorDialogText } from '~/containers/editors/EditorDialogText';
|
||||
import { NODE_TYPES } from '../node/constants';
|
||||
|
||||
export const MODAL_ACTIONS = {
|
||||
SET_SHOWN: 'MODAL.SET_SHOWN',
|
||||
|
@ -10,14 +12,21 @@ export const MODAL_ACTIONS = {
|
|||
|
||||
export const DIALOGS = {
|
||||
EDITOR_IMAGE: 'EDITOR_IMAGE',
|
||||
EDITOR_TEXT: 'EDITOR_TEXT',
|
||||
LOGIN: 'LOGIN',
|
||||
};
|
||||
|
||||
export const DIALOG_CONTENT = {
|
||||
[DIALOGS.EDITOR_IMAGE]: EditorDialogImage,
|
||||
[DIALOGS.EDITOR_TEXT]: EditorDialogText,
|
||||
[DIALOGS.LOGIN]: LoginDialog,
|
||||
};
|
||||
|
||||
export const NODE_EDITOR_DIALOGS = {
|
||||
[NODE_TYPES.IMAGE]: DIALOGS.EDITOR_IMAGE,
|
||||
[NODE_TYPES.TEXT]: DIALOGS.EDITOR_TEXT,
|
||||
};
|
||||
|
||||
export interface IDialogProps {
|
||||
onRequestClose: () => void;
|
||||
onDialogChange: (dialog: ValueOf<typeof DIALOGS>) => void;
|
||||
|
|
|
@ -9,8 +9,8 @@ export interface IModalState {
|
|||
}
|
||||
|
||||
const INITIAL_STATE: IModalState = {
|
||||
is_shown: true,
|
||||
dialog: DIALOGS.EDITOR_IMAGE,
|
||||
is_shown: false,
|
||||
dialog: DIALOGS.EDITOR_TEXT,
|
||||
};
|
||||
|
||||
export default createReducer(INITIAL_STATE, MODAL_HANDLERS);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue