From 83e3f59e68e12edaf3cf1ed51ba4d4af3ed68b2b Mon Sep 17 00:00:00 2001 From: Amruth Pillai Date: Wed, 23 Nov 2022 12:47:29 +0100 Subject: [PATCH] fix #1082 --- client/components/build/LeftSidebar/LeftSidebar.tsx | 5 +++-- client/components/build/LeftSidebar/sections/Section.tsx | 6 +----- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/client/components/build/LeftSidebar/LeftSidebar.tsx b/client/components/build/LeftSidebar/LeftSidebar.tsx index 1c56f8cd..4896933d 100644 --- a/client/components/build/LeftSidebar/LeftSidebar.tsx +++ b/client/components/build/LeftSidebar/LeftSidebar.tsx @@ -62,7 +62,7 @@ const LeftSidebar = () => { for (const item of left) { const id = (item as any).id; const component = (item as any).component; - const type = component.props.type || 'basic'; + const type = component.props.type; const addMore = !!component.props.addMore; sectionsComponents.push( @@ -142,9 +142,10 @@ const LeftSidebar = () => {
{sectionsList()} + {customSections.map(({ id }) => (
-
+
))} diff --git a/client/components/build/LeftSidebar/sections/Section.tsx b/client/components/build/LeftSidebar/sections/Section.tsx index f82f3744..680ccaaa 100644 --- a/client/components/build/LeftSidebar/sections/Section.tsx +++ b/client/components/build/LeftSidebar/sections/Section.tsx @@ -47,12 +47,8 @@ const Section: React.FC = ({ const visibility = useAppSelector((state) => get(state.resume.present, `${path}.visible`, true)); const handleAdd = () => { - const id = path.split('.')[1]; - let modal: ModalName = validate(id) ? 'builder.sections.custom' : `builder.${path}`; + const modal: ModalName = `builder.sections.${type}`; - if (type) { - modal = `builder.sections.${type}`; - } dispatch(setModalState({ modal, state: { open: true, payload: { path } } })); };