mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 12:56:41 +07:00
Merge branch 'master' into 23-labs
# Conflicts: # src/redux/node/constants.ts
This commit is contained in:
commit
8316b46efe
56 changed files with 1085 additions and 527 deletions
|
@ -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,
|
||||
});
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
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';
|
||||
import { NodeAudioBlock } from '~/components/node/NodeAudioBlock';
|
||||
import { NodeVideoBlock } from '~/components/node/NodeVideoBlock';
|
||||
|
@ -12,10 +11,10 @@ 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';
|
||||
import { EditorPublicSwitch } from '~/components/editors/EditorPublicSwitch';
|
||||
import { NodeImageSwiperBlock } from '~/components/node/NodeImageSwiperBlock';
|
||||
|
||||
const prefix = 'NODE.';
|
||||
export const NODE_ACTIONS = {
|
||||
|
@ -79,17 +78,13 @@ 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>>;
|
||||
|
||||
export const NODE_HEADS: INodeComponents = {
|
||||
[NODE_TYPES.IMAGE]: NodeImageSlideBlock,
|
||||
[NODE_TYPES.IMAGE]: NodeImageSwiperBlock,
|
||||
};
|
||||
|
||||
export const NODE_COMPONENTS: INodeComponents = {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -89,3 +89,8 @@ export type NodeEditorProps = {
|
|||
temp: string[];
|
||||
setTemp: (val: string[]) => void;
|
||||
};
|
||||
|
||||
export type INodeRelated = {
|
||||
albums: Record<string, INode[]>;
|
||||
similar: INode[];
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue