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

#35 refactored node layout

This commit is contained in:
Fedor Katurov 2021-03-06 13:17:39 +07:00
parent 428c7e7a06
commit d3473eab4c
20 changed files with 406 additions and 344 deletions

View file

@ -129,7 +129,7 @@ export const nodeSetEditor = (editor: INode) => ({
editor,
});
export const nodeSetCoverImage = (current_cover_image: IFile) => ({
export const nodeSetCoverImage = (current_cover_image?: IFile) => ({
type: NODE_ACTIONS.SET_COVER_IMAGE,
current_cover_image,
});

View file

@ -1,4 +1,4 @@
import { FC, ReactElement } from 'react';
import { FC } from 'react';
import { IComment, INode, ValueOf } from '../types';
import { NodeImageSlideBlock } from '~/components/node/NodeImageSlideBlock';
import { NodeTextBlock } from '~/components/node/NodeTextBlock';
@ -12,7 +12,6 @@ import { AudioEditor } from '~/components/editors/AudioEditor';
import { EditorImageUploadButton } from '~/components/editors/EditorImageUploadButton';
import { EditorAudioUploadButton } from '~/components/editors/EditorAudioUploadButton';
import { EditorUploadCoverButton } from '~/components/editors/EditorUploadCoverButton';
import { modalShowPhotoswipe } from '../modal/actions';
import { IEditorComponentProps, NodeEditorProps } from '~/redux/node/types';
import { EditorFiller } from '~/components/editors/EditorFiller';
@ -76,11 +75,7 @@ export const NODE_TYPES = {
export type INodeComponentProps = {
node: INode;
is_loading: boolean;
is_modal_shown: boolean;
layout: {};
updateLayout: () => void;
modalShowPhotoswipe: typeof modalShowPhotoswipe;
isLoading: boolean;
};
export type INodeComponents = Record<ValueOf<typeof NODE_TYPES>, FC<INodeComponentProps>>;

View file

@ -1,16 +1,14 @@
import { createReducer } from '~/utils/reducer';
import { INode, IComment, IFile } from '../types';
import { EMPTY_NODE, EMPTY_COMMENT } from './constants';
import { IComment, IFile, INode } from '../types';
import { EMPTY_COMMENT, EMPTY_NODE } from './constants';
import { NODE_HANDLERS } from './handlers';
import { INodeRelated } from '~/redux/node/types';
export type INodeState = Readonly<{
editor: INode;
current: INode;
comments: IComment[];
related: {
albums: Record<string, INode[]>;
similar: INode[];
};
related: INodeRelated;
comment_data: Record<number, IComment>;
comment_count: number;
current_cover_image?: IFile;

View file

@ -89,3 +89,8 @@ export type NodeEditorProps = {
temp: string[];
setTemp: (val: string[]) => void;
};
export type INodeRelated = {
albums: Record<string, INode[]>;
similar: INode[];
};