From 482e2c4d1dff5d88d8598cbe7b4b7188a07f83a2 Mon Sep 17 00:00:00 2001 From: Mike Smith <89040888+smiggiddy@users.noreply.github.com> Date: Wed, 19 Jun 2024 22:06:07 -0400 Subject: [PATCH] feat: experience component added --- cv-project/src/App.jsx | 2 + cv-project/src/components/experience.jsx | 135 +++++++++++++++++++++++ cv-project/src/components/resume.jsx | 0 3 files changed, 137 insertions(+) create mode 100644 cv-project/src/components/experience.jsx delete mode 100644 cv-project/src/components/resume.jsx diff --git a/cv-project/src/App.jsx b/cv-project/src/App.jsx index 6d2f344..3a2a6ad 100644 --- a/cv-project/src/App.jsx +++ b/cv-project/src/App.jsx @@ -1,5 +1,6 @@ import GeneralInfo from "./components/generalInfo"; import EducationInfo from "./components/educationInfo"; +import Experience from "./components/experience"; import "./App.css"; function App() { @@ -7,6 +8,7 @@ function App() { <> + ); } diff --git a/cv-project/src/components/experience.jsx b/cv-project/src/components/experience.jsx new file mode 100644 index 0000000..0ef96b6 --- /dev/null +++ b/cv-project/src/components/experience.jsx @@ -0,0 +1,135 @@ +import { useState } from "react"; + +export default function Experience() { + const [jobs, setJobs] = useState([]); + const [showJobForm, setShowJobForm] = useState(false); + + const mainDivStyle = { + display: "flex", + justifyContent: "space-between", + flexDirection: "row-reverse", + }; + + return ( +
+
+ +
+
+ + +
+
+ ); +} + +function JobList(props) { + return ( + <> + {props.jobs.map((item) => { + return ( +
+

{item.employer}

+

{item.jobTitle}

+

+ {item.employmentStart} - {item.employmentEnd} +

+

{item.jobDescription}

+
+ ); + })} + + ); +} + +function JobForm({ isActive, jobs, setJobs }) { + const [employer, setEmployer] = useState(""); + const [jobTitle, setJobTitle] = useState(""); + const [jobDescription, setJobDescription] = useState([]); + const [employmentStart, setEmploymentStart] = useState(""); + const [employmentEnd, setEmploymentEnd] = useState(""); + + const formStyle = { + display: "flex", + flexDirection: "column", + width: "30vw", + }; + + function clear() { + setEmployer(""); + setJobTitle(""); + setJobDescription(""); + setEmploymentEnd(""); + setEmploymentStart(""); + } + + function handleSubmit(event, stuff) { + event.preventDefault(); + + const newJob = { ...stuff }; + + setJobs([...jobs, newJob]); + + clear(); + } + + return ( + <> + {isActive ? ( +
+ setEmployer(e.target.value)} + /> + setJobTitle(e.target.value)} + /> + setEmploymentStart(e.target.value)} + /> + setEmploymentEnd(e.target.value)} + /> +