mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2025-11-13 08:13:49 +10:00
fix #1082
This commit is contained in:
@ -62,7 +62,7 @@ const LeftSidebar = () => {
|
|||||||
for (const item of left) {
|
for (const item of left) {
|
||||||
const id = (item as any).id;
|
const id = (item as any).id;
|
||||||
const component = (item as any).component;
|
const component = (item as any).component;
|
||||||
const type = component.props.type || 'basic';
|
const type = component.props.type;
|
||||||
const addMore = !!component.props.addMore;
|
const addMore = !!component.props.addMore;
|
||||||
|
|
||||||
sectionsComponents.push(
|
sectionsComponents.push(
|
||||||
@ -142,9 +142,10 @@ const LeftSidebar = () => {
|
|||||||
|
|
||||||
<main>
|
<main>
|
||||||
{sectionsList()}
|
{sectionsList()}
|
||||||
|
|
||||||
{customSections.map(({ id }) => (
|
{customSections.map(({ id }) => (
|
||||||
<section key={id} id={`section-${id}`}>
|
<section key={id} id={`section-${id}`}>
|
||||||
<Section path={`sections.${id}`} isEditable isHideable isDeletable />
|
<Section path={`sections.${id}`} type="custom" isEditable isHideable isDeletable />
|
||||||
</section>
|
</section>
|
||||||
))}
|
))}
|
||||||
|
|
||||||
|
|||||||
@ -47,12 +47,8 @@ const Section: React.FC<Props> = ({
|
|||||||
const visibility = useAppSelector<boolean>((state) => get(state.resume.present, `${path}.visible`, true));
|
const visibility = useAppSelector<boolean>((state) => get(state.resume.present, `${path}.visible`, true));
|
||||||
|
|
||||||
const handleAdd = () => {
|
const handleAdd = () => {
|
||||||
const id = path.split('.')[1];
|
const modal: ModalName = `builder.sections.${type}`;
|
||||||
let modal: ModalName = validate(id) ? 'builder.sections.custom' : `builder.${path}`;
|
|
||||||
|
|
||||||
if (type) {
|
|
||||||
modal = `builder.sections.${type}`;
|
|
||||||
}
|
|
||||||
dispatch(setModalState({ modal, state: { open: true, payload: { path } } }));
|
dispatch(setModalState({ modal, state: { open: true, payload: { path } } }));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user