33 :options =" {
44 title: 'Edit your profile',
55 size: '3xl',
6- actions: [
7- {
8- label: 'Save',
9- variant: 'solid',
10- onClick: (close) => saveProfile(close),
11- },
12- ],
136 }"
147 >
158 <template #body-content >
16- <div class =" grid grid-cols-2 gap-5" >
17- <div class =" space-y-4" >
18- <!-- <Uploader
19- v-model="profile.image.file_url"
20- label="Profile Image"
21- description="Your profile image to help others recognize you."
22- /> -->
9+ <div >
10+ <div class =" grid grid-cols-2 gap-10" >
2311 <div >
2412 <div class =" text-xs text-ink-gray-5 mb-1" >
2513 {{ __('Profile Image') }}
4735 <div v-else class =" mb-4" >
4836 <div class =" flex items-center" >
4937 <img
50- :src =" profile.image.file_url"
38+ :src =" profile.image? .file_url"
5139 class =" object-cover h-[50px] w-[50px] rounded-full border-4 border-white object-cover"
5240 />
5341
5442 <div class =" text-base flex flex-col ml-2" >
5543 <span >
56- {{ profile.image.file_name }}
44+ {{ profile.image? .file_name }}
5745 </span >
5846 <span class =" text-sm text-ink-gray-4 mt-1" >
59- {{ getFileSize(profile.image.file_size) }}
47+ {{ getFileSize(profile.image? .file_size) }}
6048 </span >
6149 </div >
6250 <X
6654 </div >
6755 </div >
6856 </div >
69- <FormControl v-model = " profile.first_name " :label = " __('First Name') " />
70- < FormControl v-model =" profile.last_name " :label = " __('Last Name') " />
71- < FormControl v-model = " profile.headline " :label =" __('Headline ')" />
72- < Link
73- :label = " __('Language') "
74- v-model = " profile.language "
75- doctype = " Language "
57+ <Switch
58+ v-model =" profile.looking_for_job "
59+ :label =" __('Open to Opportunities ')"
60+ :description = "
61+ __('Show recruiters and others that you are open to work.')
62+ "
63+ class = " !px-0 "
7664 />
7765 </div >
78- <div >
79- <div class =" mb-4" >
80- <div class =" mb-1.5 text-sm text-ink-gray-5" >
81- {{ __('Bio') }}
66+
67+ <div class =" grid grid-cols-2 gap-10" >
68+ <div class =" space-y-4" >
69+ <div class =" space-y-4" >
70+ <FormControl
71+ v-model =" profile.first_name"
72+ :label =" __('First Name')"
73+ />
74+ <FormControl
75+ v-model =" profile.last_name"
76+ :label =" __('Last Name')"
77+ />
78+ <FormControl v-model =" profile.headline" :label =" __('Headline')" />
79+
80+ <FormControl
81+ v-model =" profile.linkedin"
82+ :label =" __('LinkedIn ID')"
83+ />
84+ <FormControl v-model =" profile.github" :label =" __('GitHub ID')" />
85+ <FormControl
86+ v-model =" profile.twitter"
87+ :label =" __('Twitter ID')"
88+ />
8289 </div >
83- <TextEditor
84- :fixedMenu =" true"
85- @change =" (val) => (profile.bio = val)"
86- :content =" profile.bio"
87- editorClass =" prose-sm py-2 px-2 min-h-[200px] border-outline-gray-2 hover:border-outline-gray-3 rounded-b-md bg-surface-gray-3"
90+ </div >
91+ <div class =" space-y-4" >
92+ <Link
93+ :label =" __('Language')"
94+ v-model =" profile.language"
95+ doctype =" Language"
8896 />
97+ <div >
98+ <div class =" mb-1.5 text-sm text-ink-gray-5" >
99+ {{ __('Bio') }}
100+ </div >
101+ <TextEditor
102+ :fixedMenu =" true"
103+ @change =" (val) => (profile.bio = val)"
104+ :content =" profile.bio"
105+ :rows =" 15"
106+ editorClass =" prose-sm py-2 px-2 min-h-[200px] border-outline-gray-2 hover:border-outline-gray-3 rounded-b-md bg-surface-gray-3"
107+ />
108+ </div >
89109 </div >
90110 </div >
91111 </div >
92112 </template >
113+ <template #actions =" { close } " >
114+ <div class =" pb-5 float-right" >
115+ <Button variant =" solid" @click =" saveProfile(close)" >
116+ {{ __('Save') }}
117+ </Button >
118+ </div >
119+ </template >
93120 </Dialog >
94121</template >
95122<script setup>
96123import {
124+ Button ,
125+ createResource ,
97126 Dialog ,
98127 FormControl ,
99128 FileUploader ,
100- Button ,
101- createResource ,
129+ Switch ,
102130 TextEditor ,
103131 toast ,
104132} from ' frappe-ui'
@@ -123,6 +151,10 @@ const profile = reactive({
123151 headline: ' ' ,
124152 bio: ' ' ,
125153 image: ' ' ,
154+ looking_for_job: false ,
155+ linkedin: ' ' ,
156+ github: ' ' ,
157+ twitter: ' ' ,
126158})
127159
128160const imageResource = createResource ({
@@ -145,7 +177,7 @@ const updateProfile = createResource({
145177 doctype: ' User' ,
146178 name: props .profile .data .name ,
147179 fieldname: {
148- user_image: profile .image .file_url ,
180+ user_image: profile .image ? .file_url || null ,
149181 ... profile,
150182 },
151183 }
@@ -199,6 +231,10 @@ watch(
199231 profile .headline = newVal .headline
200232 profile .language = newVal .language
201233 profile .bio = newVal .bio
234+ profile .looking_for_job = newVal .looking_for_job
235+ profile .linkedin = newVal .linkedin
236+ profile .github = newVal .github
237+ profile .twitter = newVal .twitter
202238 if (newVal .user_image ) imageResource .submit ({ image: newVal .user_image })
203239 }
204240 }
0 commit comments