mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2025-11-16 17:51:43 +10:00
- implement gengar template
This commit is contained in:
@ -2,7 +2,9 @@ import React, { memo } from 'react';
|
||||
import { Helmet } from 'react-helmet';
|
||||
import { useSelector } from '../../../contexts/ResumeContext';
|
||||
import Onyx from '../../../templates/Onyx';
|
||||
import Pikachu from '../../../templates/Pikachu';
|
||||
import styles from './Artboard.module.css';
|
||||
import Gengar from '../../../templates/Gengar';
|
||||
|
||||
const Artboard = () => {
|
||||
const state = useSelector();
|
||||
@ -18,6 +20,8 @@ const Artboard = () => {
|
||||
|
||||
<div id="artboard" className={styles.container}>
|
||||
{template === 'onyx' && <Onyx data={state} />}
|
||||
{template === 'pikachu' && <Pikachu data={state} />}
|
||||
{template === 'gengar' && <Gengar data={state} />}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import React, { useState } from 'react';
|
||||
import React, { memo, useState } from 'react';
|
||||
import { DragDropContext, Draggable, Droppable } from 'react-beautiful-dnd';
|
||||
import { useDispatch, useSelector } from '../../../../contexts/ResumeContext';
|
||||
import { move, reorder } from '../../../../utils';
|
||||
@ -9,7 +9,8 @@ import styles from './Layout.module.css';
|
||||
const Layout = () => {
|
||||
const [resetLayoutText, setResetLayoutText] = useState('Reset Layout');
|
||||
|
||||
const blocks = useSelector('metadata.layout');
|
||||
const template = useSelector('metadata.template');
|
||||
const blocks = useSelector(`metadata.layout.${template}`, [[]]);
|
||||
const dispatch = useDispatch();
|
||||
|
||||
const onDragEnd = (result) => {
|
||||
@ -28,7 +29,7 @@ const Layout = () => {
|
||||
dispatch({
|
||||
type: 'on_input',
|
||||
payload: {
|
||||
path: 'metadata.layout',
|
||||
path: `metadata.layout.${template}`,
|
||||
value: newState,
|
||||
},
|
||||
});
|
||||
@ -40,7 +41,7 @@ const Layout = () => {
|
||||
dispatch({
|
||||
type: 'on_input',
|
||||
payload: {
|
||||
path: 'metadata.layout',
|
||||
path: `metadata.layout.${template}`,
|
||||
value: newState,
|
||||
},
|
||||
});
|
||||
@ -110,4 +111,4 @@ const Layout = () => {
|
||||
);
|
||||
};
|
||||
|
||||
export default Layout;
|
||||
export default memo(Layout);
|
||||
|
||||
Reference in New Issue
Block a user