mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2025-11-14 16:51:33 +10:00
updated(builder-page): added collapsible feature for each section
This commit is contained in:
@ -23,6 +23,10 @@ type ResumeStore = {
|
||||
// Custom Section Actions
|
||||
addSection: () => void;
|
||||
removeSection: (sectionId: SectionKey) => void;
|
||||
|
||||
collapsedSections: Record<string, boolean>;
|
||||
toggleSectionCollapsed: (id: string) => void;
|
||||
setSectionCollapsed: (id: string, collapsed: boolean) => void;
|
||||
};
|
||||
|
||||
export const useResumeStore = create<ResumeStore>()(
|
||||
@ -69,6 +73,19 @@ export const useResumeStore = create<ResumeStore>()(
|
||||
});
|
||||
}
|
||||
},
|
||||
collapsedSections: {},
|
||||
|
||||
toggleSectionCollapsed: (id) => {
|
||||
set((state) => {
|
||||
state.collapsedSections[id] = !state.collapsedSections[id];
|
||||
});
|
||||
},
|
||||
|
||||
setSectionCollapsed: (id, collapsed) => {
|
||||
set((state) => {
|
||||
state.collapsedSections[id] = collapsed;
|
||||
});
|
||||
},
|
||||
})),
|
||||
{
|
||||
limit: 100,
|
||||
|
||||
Reference in New Issue
Block a user