Skip to content

Commit e95fdfb

Browse files
authored
fix: general member profile fixes (#191)
* fix: general member profile fixes replace x icon with trash icon * refactor: replace normal dash with en dash * fix: experience edit/add box add border and some padding to the design of the edit section * fix: edit/add form state reset form state when closed, show only one form at a time
1 parent a9ee4b1 commit e95fdfb

File tree

4 files changed

+68
-25
lines changed

4 files changed

+68
-25
lines changed

assets/css/global.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ ul > li {
148148

149149
.delete-btn,
150150
.edit-btn {
151-
@apply bg-xIcon bg-no-repeat w-5 h-5 border-none;
151+
@apply bg-trashIcon bg-no-repeat w-5 h-5 border-none;
152152
@apply p-4 border-r-0 ml-2;
153153
}
154154

components/member/Experience.vue

Lines changed: 60 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@
1515
<div
1616
v-if="memberAuth"
1717
@click="
18-
() => (showAddWorkExperienceForm = !showAddWorkExperienceForm)
18+
() => {
19+
showAddWorkExperienceForm = true
20+
showUpdateWorkExperienceForm = false
21+
state.form.workExperience = { ...defaultWorkExperience }
22+
}
1923
"
2024
>
2125
<img
@@ -39,7 +43,7 @@
3943
<h5 class="sub-title">{{ experience.position }}</h5>
4044
</div>
4145
<p class="date-container">
42-
{{ formatDate(experience.start_date) }} -
46+
{{ formatDate(experience.start_date) }} &ndash;
4347
{{
4448
experience.end_date
4549
? formatDate(experience.end_date)
@@ -64,6 +68,7 @@
6468
@click="
6569
() => {
6670
showUpdateWorkExperienceForm = true
71+
showAddWorkExperienceForm = false
6772
state.form.workExperience = { ...experience }
6873
}
6974
"
@@ -76,7 +81,10 @@
7681
</ul>
7782
<!-- Add Work Experience Form -->
7883
<div v-if="showAddWorkExperienceForm">
79-
<form @submit.prevent="addMemberWorkExperience">
84+
<form
85+
@submit.prevent="addMemberWorkExperience"
86+
class="border px-16 py-8"
87+
>
8088
<FormAppControlInput
8189
v-model:value="state.form.workExperience.company_name"
8290
isRequired
@@ -128,15 +136,18 @@
128136
</div>
129137
<!-- Update Work Experience Form -->
130138
<div v-if="showUpdateWorkExperienceForm">
131-
<div class="flex justify-end w-full">
132-
<img
133-
src="/icons/x.svg"
134-
alt=""
135-
class="cursor-pointer"
136-
@click="() => (showUpdateWorkExperienceForm = false)"
137-
/>
138-
</div>
139-
<form @submit.prevent="updateMemberWorkExperience">
139+
<form
140+
@submit.prevent="updateMemberWorkExperience"
141+
class="border px-16 py-8"
142+
>
143+
<div class="flex justify-end w-full">
144+
<img
145+
src="/icons/x.svg"
146+
alt=""
147+
class="cursor-pointer"
148+
@click="() => (showUpdateWorkExperienceForm = false)"
149+
/>
150+
</div>
140151
<FormAppControlInput
141152
v-model:value="state.form.workExperience.company_name"
142153
:value="state.form.workExperience.company_name"
@@ -167,6 +178,7 @@
167178
@checkbox-changed="
168179
state.form.workExperience.currently_working = $event
169180
"
181+
:isChecked="state.form.workExperience.end_date ? false : true"
170182
labelId="currently-working-edit"
171183
class="mt-2"
172184
>
@@ -195,7 +207,13 @@
195207
<h3 class="heading">Education</h3>
196208
<div
197209
v-if="memberAuth"
198-
@click="() => (showAddEducationForm = !showAddEducationForm)"
210+
@click="
211+
() => {
212+
showAddEducationForm = true
213+
showUpdateEducationForm = false
214+
state.form.education = { ...defaultEducation }
215+
}
216+
"
199217
>
200218
<img
201219
v-if="!showAddEducationForm"
@@ -242,6 +260,7 @@
242260
@click="
243261
() => {
244262
showUpdateEducationForm = true
263+
showAddEducationForm = false
245264
state.form.education = { ...education }
246265
}
247266
"
@@ -254,7 +273,7 @@
254273
</ul>
255274
<!-- Add Education Form -->
256275
<div v-if="showAddEducationForm">
257-
<form @submit.prevent="addMemberEducation">
276+
<form @submit.prevent="addMemberEducation" class="border px-16 py-8">
258277
<FormAppControlInput
259278
v-model:value="state.form.education.institution_name"
260279
isRequired
@@ -288,15 +307,15 @@
288307
</div>
289308
<!-- Update Education Form -->
290309
<div v-if="showUpdateEducationForm">
291-
<div class="flex justify-end w-full">
292-
<img
293-
src="/icons/x.svg"
294-
alt=""
295-
class="cursor-pointer flex"
296-
@click="() => (showUpdateEducationForm = false)"
297-
/>
298-
</div>
299-
<form @submit.prevent="updateMemberEducation">
310+
<form @submit.prevent="updateMemberEducation" class="border px-16 py-8">
311+
<div class="flex justify-end w-full">
312+
<img
313+
src="/icons/x.svg"
314+
alt=""
315+
class="cursor-pointer flex"
316+
@click="() => (showUpdateEducationForm = false)"
317+
/>
318+
</div>
300319
<FormAppControlInput
301320
v-model:value="state.form.education.institution_name"
302321
:value="state.form.education.institution_name"
@@ -315,6 +334,7 @@
315334
<FormAppControlInput
316335
inputType="checkbox"
317336
@checkbox-changed="state.form.education.still_studying = $event"
337+
:isChecked="state.form.education.graduated ? false : true"
318338
labelId="currently-studying-edit"
319339
>
320340
I'm still studying
@@ -368,6 +388,23 @@ const props = defineProps({
368388
},
369389
})
370390
391+
const defaultWorkExperience = {
392+
company_name: '',
393+
position: '',
394+
start_date: '',
395+
currently_working: false,
396+
end_date: null,
397+
id: '',
398+
}
399+
400+
const defaultEducation = {
401+
institution_name: '',
402+
degree: '',
403+
still_studying: false,
404+
graduated: '',
405+
id: '',
406+
}
407+
371408
const state = reactive({
372409
form: {
373410
workExperience: {

public/icons/delete.svg

Lines changed: 6 additions & 0 deletions
Loading

tailwind.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ module.exports = {
9797
'slashes': "url('/images/slashes.svg')",
9898
'editIcon': "url('/icons/edit.svg')",
9999
'editIconWhite': "url('/icons/edit-white.svg')",
100-
'xIcon': "url('/icons/x.svg')",
100+
'trashIcon': "url('/icons/delete.svg')",
101101
}
102102
},
103103
},

0 commit comments

Comments
 (0)