1
-
2
1
import React , { useState } from "react" ;
3
2
import "./App.css" ;
4
3
import AddSkillForm from "./components/skills/AddSkillForm" ;
@@ -7,11 +6,14 @@ import SkillEditPage from "./components/skills/SkillEditPage";
7
6
import EducationForm from "./components/education/EducationForm" ;
8
7
import EducationView from "./components/education/EducationView" ;
9
8
import EducationEditPage from "./components/education/EducationEditPage" ;
10
- import ExperienceForm from "./components/experience/ExperienceForm" ;
11
- import ViewExperience from "./components/experience/ViewExperience"
9
+ import ExperienceForm from "./components/experience/ExperienceForm" ;
10
+ import ViewExperience from "./components/experience/ViewExperience" ;
12
11
import User from "./components/User/page" ;
13
12
14
13
function App ( ) {
14
+ const [ showEducationForm , setShowEducationForm ] = useState ( false ) ;
15
+ const [ showEducationEditPage , setShowEducationEditPage ] = useState ( false ) ;
16
+ const [ education , setEducation ] = useState ( [ ] ) ;
15
17
const [ showAddSkillForm , setShowAddSkillForm ] = useState ( false ) ;
16
18
const [ showSkillEditPage , setShowSkillEditPage ] = useState ( false ) ;
17
19
const [ skills , setSkills ] = useState ( [ ] ) ;
@@ -28,120 +30,115 @@ function App() {
28
30
} ;
29
31
30
32
const handleCancel = ( ) => {
31
- setShowForm ( false ) ;
32
- const [ showEducationForm , setShowEducationForm ] = useState ( false ) ;
33
- const [ showEducationEditPage , setShowEducationEditPage ] = useState ( false ) ;
34
- const [ education , setEducation ] = useState ( [ ] ) ;
35
-
36
- const handleAddSkillClick = ( ) => {
37
- setShowAddSkillForm ( ! showAddSkillForm ) ;
38
- } ;
39
-
40
- const handleFormSubmit = ( newSkill ) => {
41
- setSkills ( [ ...skills , newSkill ] ) ;
42
- setShowAddSkillForm ( false ) ;
43
- } ;
44
-
45
- const toggleSkillEditPage = ( ) => {
46
- setShowSkillEditPage ( ! showSkillEditPage ) ;
47
- } ;
48
-
49
- const handleSkillUpdate = ( updatedSkills ) => {
50
- setSkills ( updatedSkills ) ;
51
- setShowSkillEditPage ( false ) ;
52
- } ;
53
-
54
- const handleAddEducationClick = ( ) => {
55
- setShowEducationForm ( ! showEducationForm ) ;
56
- } ;
57
-
58
- const handleEducationFormSubmit = ( newEducation ) => {
59
- setEducation ( [ ...education , newEducation ] ) ;
60
- setShowEducationForm ( false ) ;
61
- } ;
62
-
63
- const toggleEducationEditPage = ( ) => {
64
- setShowEducationEditPage ( ! showEducationEditPage ) ;
65
- } ;
66
-
67
- const handleEducationUpdate = ( updatedEducation ) => {
68
- setEducation ( updatedEducation ) ;
69
- setShowEducationEditPage ( false ) ;
70
-
33
+ setShowExperienceForm ( false ) ;
71
34
} ;
72
-
73
- return (
74
- < div className = "App" >
75
- < h1 > Resume Builder</ h1 >
76
- < div className = "resumeSection" >
77
- < h2 > User</ h2 >
78
- < p > Add User Information</ p >
79
- < User />
80
- < br > </ br >
81
- </ div >
82
- < div className = "resumeSection" >
83
- < h2 > Experience</ h2 >
84
-
85
- { showExperienceForm ? (
86
- < ExperienceForm
87
- onSubmit = { handleSubmitExperience }
88
- onCancel = { handleCancel }
89
- />
90
- ) : (
91
- < >
92
- < button onClick = { handleAddExperience } > Add Experience</ button >
93
- < ViewExperience experiences = { experiences } />
94
- </ >
95
- ) }
96
-
97
- </ div >
98
-
99
- < div className = "resumeSection" >
100
- < h2 > Education</ h2 >
101
-
102
- < EducationView education = { education } />
103
- < div className = "button-group" >
104
- < button onClick = { handleAddEducationClick } >
105
- { showEducationForm ? "Hide" : "Add Education" }
106
- </ button >
107
- < button onClick = { toggleEducationEditPage } >
108
- { showEducationEditPage ? "Hide Edit Education" : "Edit Education" }
109
- </ button >
35
+
36
+ const handleAddSkillClick = ( ) => {
37
+ setShowAddSkillForm ( ! showAddSkillForm ) ;
38
+ } ;
39
+
40
+ const handleFormSubmit = ( newSkill ) => {
41
+ setSkills ( [ ...skills , newSkill ] ) ;
42
+ setShowAddSkillForm ( false ) ;
43
+ } ;
44
+
45
+ const toggleSkillEditPage = ( ) => {
46
+ setShowSkillEditPage ( ! showSkillEditPage ) ;
47
+ } ;
48
+
49
+ const handleSkillUpdate = ( updatedSkills ) => {
50
+ setSkills ( updatedSkills ) ;
51
+ setShowSkillEditPage ( false ) ;
52
+ } ;
53
+
54
+ const handleAddEducationClick = ( ) => {
55
+ setShowEducationForm ( ! showEducationForm ) ;
56
+ } ;
57
+
58
+ const handleEducationFormSubmit = ( newEducation ) => {
59
+ setEducation ( [ ...education , newEducation ] ) ;
60
+ setShowEducationForm ( false ) ;
61
+ } ;
62
+
63
+ const toggleEducationEditPage = ( ) => {
64
+ setShowEducationEditPage ( ! showEducationEditPage ) ;
65
+ } ;
66
+
67
+ const handleEducationUpdate = ( updatedEducation ) => {
68
+ setEducation ( updatedEducation ) ;
69
+ setShowEducationEditPage ( false ) ;
70
+ } ;
71
+
72
+ return (
73
+ < div className = "App" >
74
+ < h1 > Resume Builder</ h1 >
75
+ < div className = "resumeSection" >
76
+ < h2 > User</ h2 >
77
+ < p > Add User Information</ p >
78
+ < User />
79
+ < br > </ br >
80
+ </ div >
81
+ < div className = "resumeSection" >
82
+ < h2 > Experience</ h2 >
83
+
84
+ { showExperienceForm ? (
85
+ < ExperienceForm
86
+ onSubmit = { handleSubmitExperience }
87
+ onCancel = { handleCancel }
88
+ />
89
+ ) : (
90
+ < >
91
+ < button onClick = { handleAddExperience } > Add Experience</ button >
92
+ < ViewExperience experiences = { experiences } />
93
+ </ >
94
+ ) }
110
95
</ div >
111
- { showEducationForm && (
112
- < EducationForm onSubmit = { handleEducationFormSubmit } />
113
- ) }
114
- { showEducationEditPage && (
115
- < EducationEditPage
116
- education = { education }
117
- onUpdate = { handleEducationUpdate }
118
- />
119
- ) }
120
96
121
- </ div >
97
+ < div className = "resumeSection" >
98
+ < h2 > Education</ h2 >
99
+
100
+ < EducationView education = { education } />
101
+ < div className = "button-group" >
102
+ < button onClick = { handleAddEducationClick } >
103
+ { showEducationForm ? "Hide" : "Add Education" }
104
+ </ button >
105
+ < button onClick = { toggleEducationEditPage } >
106
+ { showEducationEditPage ? "Hide Edit Education" : "Edit Education" }
107
+ </ button >
108
+ </ div >
109
+ { showEducationForm && (
110
+ < EducationForm onSubmit = { handleEducationFormSubmit } />
111
+ ) }
112
+ { showEducationEditPage && (
113
+ < EducationEditPage
114
+ education = { education }
115
+ onUpdate = { handleEducationUpdate }
116
+ />
117
+ ) }
118
+ </ div >
122
119
123
- < div className = "resumeSection" >
124
- < h2 > Skills</ h2 >
125
-
126
- < SkillView skills = { skills } />
127
- < div className = "button-group" >
128
- < button onClick = { handleAddSkillClick } >
129
- { showAddSkillForm ? "Hide" : "Add Skill" }
130
- </ button >
131
- < button onClick = { toggleSkillEditPage } >
132
- { showSkillEditPage ? "Hide Edit Skills" : "Edit Skills" }
133
- </ button >
120
+ < div className = "resumeSection" >
121
+ < h2 > Skills</ h2 >
122
+
123
+ < SkillView skills = { skills } />
124
+ < div className = "button-group" >
125
+ < button onClick = { handleAddSkillClick } >
126
+ { showAddSkillForm ? "Hide" : "Add Skill" }
127
+ </ button >
128
+ < button onClick = { toggleSkillEditPage } >
129
+ { showSkillEditPage ? "Hide Edit Skills" : "Edit Skills" }
130
+ </ button >
131
+ </ div >
132
+ { showAddSkillForm && < AddSkillForm onSubmit = { handleFormSubmit } /> }
133
+ { showSkillEditPage && (
134
+ < SkillEditPage skills = { skills } onUpdate = { handleSkillUpdate } />
135
+ ) }
134
136
</ div >
135
- { showAddSkillForm && < AddSkillForm onSubmit = { handleFormSubmit } /> }
136
- { showSkillEditPage && (
137
- < SkillEditPage skills = { skills } onUpdate = { handleSkillUpdate } />
138
- ) }
139
- </ div >
140
137
141
- < br />
142
- < button > Export</ button >
143
- </ div >
144
- ) ;
145
- }
138
+ < br />
139
+ < button > Export</ button >
140
+ </ div >
141
+ ) ;
142
+ } ;
146
143
147
144
export default App ;
0 commit comments