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

#23 using custom blocks at lab nodes

This commit is contained in:
Fedor Katurov 2021-03-22 11:09:38 +07:00
parent bee41ebfb3
commit 031de64acc
17 changed files with 330 additions and 43 deletions

View file

@ -15,6 +15,11 @@ 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';
import { LabNodeTitle } from '~/components/lab/LabNodeTitle';
import { LabText } from '~/components/lab/LabText';
import { LabImage } from '~/components/lab/LabImage';
import { LabBottomPanel } from '~/components/lab/LabBottomPanel';
import { LabPad } from '~/components/lab/LabPad';
const prefix = 'NODE.';
export const NODE_ACTIONS = {
@ -83,6 +88,13 @@ export type INodeComponentProps = {
export type INodeComponents = Record<ValueOf<typeof NODE_TYPES>, FC<INodeComponentProps>>;
export const LAB_PREVIEW_LAYOUT: Record<string, FC<INodeComponentProps>[]> = {
[NODE_TYPES.IMAGE]: [LabImage, LabPad, LabNodeTitle, LabBottomPanel],
[NODE_TYPES.VIDEO]: [NodeVideoBlock, LabPad, LabNodeTitle, LabBottomPanel],
[NODE_TYPES.AUDIO]: [LabPad, LabNodeTitle, NodeAudioImageBlock, NodeAudioBlock, LabBottomPanel],
[NODE_TYPES.TEXT]: [LabPad, LabNodeTitle, LabText, LabBottomPanel],
};
export const NODE_HEADS: INodeComponents = {
[NODE_TYPES.IMAGE]: NodeImageSwiperBlock,
};