Skip to content

Commit

Permalink
final touch
Browse files Browse the repository at this point in the history
  • Loading branch information
Palveet committed Nov 29, 2024
1 parent c626286 commit 6e324c9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 67 deletions.
14 changes: 2 additions & 12 deletions src/components/ResumeDetails.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,9 @@ const ResumeDetails = () => {
<div>
<button onClick={() => navigate(-1)}>Back</button>
<h1>{resume.title}</h1>
<h2>Personal Info</h2>
<p>Name: {resume.personal_info.name}</p>
<p>Email: {resume.personal_info.email}</p>
<p>Phone: {resume.personal_info.phone}</p>

<h2>Education</h2>
<div dangerouslySetInnerHTML={{ __html: resume.education }} />

<h2>Work Experience</h2>
<div dangerouslySetInnerHTML={{ __html: resume.work_experience }} />

<h2>Skills</h2>
<div dangerouslySetInnerHTML={{ __html: resume.skills }} />
<h2>Resume Details</h2>
<div dangerouslySetInnerHTML={{ __html: resume.resume_content }} />
</div>
);
};
Expand Down
59 changes: 4 additions & 55 deletions src/components/ResumeForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,27 +32,12 @@ const formats = [
const ResumeForm = ({ resume = {}, onSuccess, isEditing = false }) => {
const [formData, setFormData] = useState({
title: resume?.title || "",
personal_info: {
name: resume?.personal_info?.name || "",
email: resume?.personal_info?.email || "",
phone: resume?.personal_info?.phone || "",
},
education: resume?.education || "",
work_experience: resume?.work_experience || "",
skills: resume?.skills || "",
resume_content: resume?.resume_content || "",
});

const handleInputChange = (e) => {
const { name, value } = e.target;
if (name.startsWith("personal_info.")) {
const field = name.split(".")[1];
setFormData((prevData) => ({
...prevData,
personal_info: { ...prevData.personal_info, [field]: value },
}));
} else {
setFormData((prevData) => ({ ...prevData, [name]: value }));
}
setFormData((prevData) => ({ ...prevData, [name]: value }));
};

const handleQuillChange = (field, value) => {
Expand Down Expand Up @@ -103,55 +88,19 @@ const ResumeForm = ({ resume = {}, onSuccess, isEditing = false }) => {
required
/>
</div>
<div className='controls'>
<label>Name:</label>
<input
type="text"
name="personal_info.name"
value={formData.personal_info.name}
onChange={handleInputChange}
required
/>
</div>
<div className='controls'>
<label>Email:</label>
<input
type="email"
name="personal_info.email"
value={formData.personal_info.email}
onChange={handleInputChange}
required
/>
</div>
<div className='controls'>
<label>Phone:</label>
<input
type="tel"
name="personal_info.phone"
value={formData.personal_info.phone}
onChange={handleInputChange}
required
/>
</div>
<div className='textbox-controls'>
<label>Work Experience:</label>
<ReactQuill
theme="snow"
value={formData.work_experience}
onChange={(value) => handleQuillChange("work_experience", value)}
value={formData.resume_content}
onChange={(value) => handleQuillChange("resume_content", value)}
placeholder="Enter your work experience here..."
formats={formats}
modules={modules}
/>
</div>
<button type="submit" className="primary-button button">{isEditing ? "Update Resume" : "Submit"}</button>
</form>

<div style={{ marginTop: "20px" }}>
<button className="action-button download-button" onClick={handleDownloadPDF}>
<Download style={{ width: '16px', height: '16px' }} />
PDF</button>
</div>
</div>
);
};
Expand Down
4 changes: 4 additions & 0 deletions src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -263,4 +263,8 @@ a{
.textbox-controls label{
width:150px;
}
}

.ql-editor{
color:black;
}

0 comments on commit 6e324c9

Please sign in to comment.