feat(styling): yep

This commit is contained in:
Mike 2024-06-22 21:20:43 -04:00
parent 69d31af19e
commit de5451a9ed
5 changed files with 153 additions and 92 deletions

View file

@ -74,8 +74,37 @@ body {
gap: 1rem; gap: 1rem;
} }
.education-info-form { .education-info-form,
.job-info-form {
padding: 20px; padding: 20px;
margin-bottom: 1rem; margin-bottom: 1rem;
background: hsl(var(--white-color)); background: hsl(var(--white-color));
border-radius: var(--default-border-radius);
}
.education-info {
display: flex;
flex-direction: column;
justify-content: center;
}
.education-info h2 {
align-self: center;
}
.education-item {
padding: 10px 25px 10px 25px;
}
.education-item h2,
p {
padding: 0;
margin: 0;
}
.btn-group {
display: flex;
justify-content: center;
margin: 30px 0 20px 0;
gap: 10px;
} }

View file

@ -18,22 +18,39 @@ function App() {
const [educationInfo, setEducationInfo] = useState([]); const [educationInfo, setEducationInfo] = useState([]);
const [editEducation, setEditEducation] = useState(null); const [editEducation, setEditEducation] = useState(null);
const [employmentHistory, setEmploymentHistory] = useState([]); const [employmentHistory, setEmploymentHistory] = useState([]);
const [showJobForm, setShowJobForm] = useState(false);
const [educationItemActive, setEducationItemActive] = useState(false);
return ( return (
<div className="container"> <div className="container">
<div className="form"> <div className="form">
<GeneralInfoForm setBasicInfo={setBasicInfo} basicInfo={basicInfo} /> <GeneralInfoForm setBasicInfo={setBasicInfo} basicInfo={basicInfo} />
<div className="btn-group">
<button
onClick={() => {
setEducationItemActive(!educationItemActive);
}}
>
Add Education Info
</button>
<button onClick={() => setShowJobForm(!showJobForm)}>
Add Employer Info
</button>
</div>
<EducationInfoForm <EducationInfoForm
educationInfo={educationInfo} educationInfo={educationInfo}
setEducationInfo={setEducationInfo} setEducationInfo={setEducationInfo}
setEditEducation={setEditEducation} setEditEducation={setEditEducation}
editEducation={editEducation} editEducation={editEducation}
educationItemActive={educationItemActive}
/> />
<ExperienceForm <ExperienceForm
employmentHistory={employmentHistory} employmentHistory={employmentHistory}
setEmploymentHistory={setEmploymentHistory} setEmploymentHistory={setEmploymentHistory}
showJobForm={showJobForm}
/> />
</div> </div>
<div className="resume"> <div className="resume">
<GeneralInfoDisplay basicInfo={basicInfo} /> <GeneralInfoDisplay basicInfo={basicInfo} />
<EducationInfoDisplay <EducationInfoDisplay

View file

@ -1,12 +1,13 @@
export default function EducationInfoDisplay(props) { export default function EducationInfoDisplay(props) {
return ( return (
<> <div className="education-info">
<h2>Education</h2>
<EducationDisplay <EducationDisplay
educationInfo={props.educationInfo} educationInfo={props.educationInfo}
setEducationInfo={props.setEducationInfo} setEducationInfo={props.setEducationInfo}
setEditEducation={props.setEditEducation} setEditEducation={props.setEditEducation}
/> />
</> </div>
); );
} }
@ -15,11 +16,12 @@ function EducationDisplay(props) {
<> <>
{props.educationInfo.map((item) => { {props.educationInfo.map((item) => {
return ( return (
<div key={item.schoolName} className="education-info"> <div key={item.schoolName} className="education-item">
<h2>School: {item.schoolName}</h2> <h2>{item.schoolName}</h2>
<p> <p>
Graduation: {item.graduationDate + " "} Graduation: {item.graduationDate + " "}
Degree: {item.fieldOfStudy} {item.fieldOfStudy}
</p>
<button onClick={() => props.setEditEducation(item)}>edit</button> <button onClick={() => props.setEditEducation(item)}>edit</button>
<button <button
onClick={() => onClick={() =>
@ -32,7 +34,6 @@ function EducationDisplay(props) {
> >
remove remove
</button> </button>
</p>
</div> </div>
); );
})} })}

View file

@ -2,20 +2,10 @@ import { useState, useEffect } from "react";
import Input from "./input"; import Input from "./input";
export default function EducationInfoForm(props) { export default function EducationInfoForm(props) {
const [educationItemActive, setEducationItemActive] = useState(false);
return ( return (
<> <>
<button
onClick={() => {
setEducationItemActive(!educationItemActive);
}}
>
Add Education Info
</button>
<EducationForm <EducationForm
isActive={educationItemActive} isActive={props.educationItemActive}
educationInfo={props.educationInfo} educationInfo={props.educationInfo}
setEducationInfo={props.setEducationInfo} setEducationInfo={props.setEducationInfo}
editSchool={props.editEducation} editSchool={props.editEducation}
@ -59,22 +49,32 @@ function EducationForm({
<> <>
{isActive ? ( {isActive ? (
<div className="education-info-form"> <div className="education-info-form">
<h2 className="general-info-header">Education History</h2>
<form action="" style={contactFormStyle}> <form action="" style={contactFormStyle}>
<Input <Input
label={true}
labelName="School"
name="School"
type="text" type="text"
placeholder="Enter university/school" placeholder=""
value={schoolName} value={schoolName}
onChange={(e) => setSchoolName(e.target.value)} onChange={(e) => setSchoolName(e.target.value)}
/> />
<Input <Input
label={true}
labelName="Graduation date"
name="graduationDate"
type="text" type="text"
placeholder="Enter graduation date" placeholder=""
value={graduationDate} value={graduationDate}
onChange={(e) => setGraduationDate(e.target.value)} onChange={(e) => setGraduationDate(e.target.value)}
/> />
<Input <Input
label={true}
labelName="Degree/Field of study"
name="degree"
type="text" type="text"
placeholder="Enter degree/field of study" placeholder=""
value={fieldOfStudy} value={fieldOfStudy}
onChange={(e) => setFieldOfStudy(e.target.value)} onChange={(e) => setFieldOfStudy(e.target.value)}
/> />

View file

@ -1,20 +1,15 @@
import { useState } from "react"; import { useState } from "react";
import Input from "./input";
export default function ExperienceForm(props) { export default function ExperienceForm(props) {
// const [jobs, setJobs] = useState([]);
const [showJobForm, setShowJobForm] = useState(false);
return ( return (
<div className="Job-info-form"> <>
<button onClick={() => setShowJobForm(!showJobForm)}>
Add Employer Info
</button>
<JobForm <JobForm
setJobs={props.setEmploymentHistory} setJobs={props.setEmploymentHistory}
jobs={props.employmentHistory} jobs={props.employmentHistory}
isActive={showJobForm} isActive={props.showJobForm}
/> />
</div> </>
); );
} }
@ -52,35 +47,53 @@ function JobForm({ isActive, jobs, setJobs }) {
return ( return (
<> <>
{isActive ? ( {isActive ? (
<div className="job-info-form">
<h2 className="general-info-header">Employment History</h2>
<form action="" style={formStyle}> <form action="" style={formStyle}>
<input <Input
name="employer"
label={true}
labelName="Employer"
type="text" type="text"
placeholder="Employer" placeholder=""
value={employer} value={employer}
onChange={(e) => setEmployer(e.target.value)} onChange={(e) => setEmployer(e.target.value)}
/> />
<input <Input
name="jobTitle"
label={true}
labelName="Job title"
type="text" type="text"
placeholder="Job title" placeholder=""
value={jobTitle} value={jobTitle}
onChange={(e) => setJobTitle(e.target.value)} onChange={(e) => setJobTitle(e.target.value)}
/> />
<input <Input
name="startDate"
label={true}
labelName="Start date"
type="text" type="text"
placeholder="Employment Start Date" placeholder=""
value={employmentStart} value={employmentStart}
onChange={(e) => setEmploymentStart(e.target.value)} onChange={(e) => setEmploymentStart(e.target.value)}
/> />
<input <Input
name="endDate"
label={true}
labelName="End date"
type="text" type="text"
placeholder="Employment End Date" placeholder=""
value={employmentEnd} value={employmentEnd}
onChange={(e) => setEmploymentEnd(e.target.value)} onChange={(e) => setEmploymentEnd(e.target.value)}
/> />
<div className="input">
<label>Description</label>
<textarea <textarea
name="jobDescription"
value={jobDescription} value={jobDescription}
onChange={(e) => setJobDescription(e.target.value)} onChange={(e) => setJobDescription(e.target.value)}
/> />
</div>
<button <button
onClick={(e) => { onClick={(e) => {
e.preventDefault(); e.preventDefault();
@ -103,6 +116,7 @@ function JobForm({ isActive, jobs, setJobs }) {
Submit Submit
</button> </button>
</form> </form>
</div>
) : null} ) : null}
</> </>
); );