Skip to content

Commit

Permalink
Merge pull request #26 from Kingscliq/feat/delete-experience
Browse files Browse the repository at this point in the history
Add delete funtionality to the experience
  • Loading branch information
yashika51 authored Oct 14, 2024
2 parents c305fa4 + e43c176 commit c4a85d4
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,14 @@ function App() {
setShowEducationEditPage(false);
};

const handleDelete = useCallback(
(id) => {
const filtered = () =>
experiences.filter((experience) => experience.id !== id);
setExperiences(filtered);
},
[experiences]
);
const experienceTabs = {
form: (
<ExperienceForm
Expand All @@ -95,6 +103,7 @@ function App() {
experiences={experiences}
setSelectedExperience={setSelectedExperience}
setActiveTab={setActiveTab}
onDelete={handleDelete}
/>
</>
),
Expand Down

0 comments on commit c4a85d4

Please sign in to comment.