mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2025-11-19 03:01:53 +10:00
- implement work experience
- implement education - show dynamic names in layout
This commit is contained in:
@ -1,15 +1,17 @@
|
||||
import { createNanoEvents } from "nanoevents";
|
||||
import React, { createContext } from "react";
|
||||
|
||||
const events = {
|
||||
const MODAL_EVENTS = {
|
||||
AUTH_MODAL: "auth_modal",
|
||||
CREATE_RESUME_MODAL: "create_resume_modal",
|
||||
SOCIAL_MODAL: "social_modal",
|
||||
WORK_MODAL: "work_modal",
|
||||
EDUCATION_MODAL: "education_modal",
|
||||
};
|
||||
|
||||
const emitter = createNanoEvents();
|
||||
|
||||
const defaultState = { events, emitter };
|
||||
const defaultState = { events: MODAL_EVENTS, emitter };
|
||||
|
||||
const ModalContext = createContext(defaultState);
|
||||
|
||||
@ -23,4 +25,4 @@ const ModalProvider = ({ children }) => {
|
||||
|
||||
export default ModalContext;
|
||||
|
||||
export { ModalProvider };
|
||||
export { ModalProvider, MODAL_EVENTS };
|
||||
|
||||
@ -21,6 +21,7 @@ const ResumeProvider = ({ children }) => {
|
||||
|
||||
switch (type) {
|
||||
case "on_add_item":
|
||||
delete payload.value.__temp;
|
||||
items = get(state, payload.path, []);
|
||||
newState = setWith(
|
||||
clone(state),
|
||||
@ -32,6 +33,7 @@ const ResumeProvider = ({ children }) => {
|
||||
return newState;
|
||||
|
||||
case "on_edit_item":
|
||||
delete payload.value.__temp;
|
||||
items = get(state, payload.path);
|
||||
index = findIndex(items, ["id", payload.value.id]);
|
||||
newState = setWith(
|
||||
|
||||
@ -10,7 +10,7 @@ const defaultState = {
|
||||
primaryColor: "#f44336",
|
||||
backgroundColor: "#FFFFFF",
|
||||
},
|
||||
blocks: [leftSections.map((x) => x.id)],
|
||||
blocks: [leftSections],
|
||||
setBlocks: () => {},
|
||||
setFixedBlocks: () => {},
|
||||
setSupportedBlocks: () => {},
|
||||
|
||||
Reference in New Issue
Block a user