-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add edit profile modal with no action
- Loading branch information
Showing
4 changed files
with
277 additions
and
1 deletion.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
import TButton from '../Button/TButton.tsx'; | ||
import { FaEdit } from 'react-icons/fa'; | ||
import { Dispatch, SetStateAction, useState } from 'react'; | ||
import FileBase from 'react-file-base64'; | ||
|
||
interface Talent { | ||
name: string; | ||
email: string; | ||
hashedPassword: string; | ||
jobRole: string; | ||
location?: string; | ||
hasOffer: boolean; | ||
rank: number; | ||
socials?: Array<string>; | ||
github?: string; | ||
linkedin?: string; | ||
x?: string; | ||
bio?: string; | ||
profileImg?: string; | ||
createdAt?: Date; | ||
updatedAt?: Date; | ||
} | ||
|
||
interface UpdateTalentModalProps { | ||
showTalentEditModal: boolean; | ||
setShowTalentEditModal: Dispatch<SetStateAction<boolean>>; | ||
talent: Talent; | ||
} | ||
|
||
const UpdateTalentModal = ({ | ||
showTalentEditModal, | ||
setShowTalentEditModal, | ||
talent, | ||
}: UpdateTalentModalProps): JSX.Element => { | ||
const modalStyle = showTalentEditModal ? 'showModal' : ''; | ||
const [img, setImg] = useState(''); | ||
|
||
const handleSubmit = () => {}; | ||
|
||
return ( | ||
<div className={'Modal ' + modalStyle}> | ||
<div className='content'> | ||
<div className={'header-11'}> | ||
<h1>Add Education</h1>{' '} | ||
<TButton value={'X'} onClick={() => setShowTalentEditModal(false)} /> | ||
</div> | ||
<hr /> | ||
<form onSubmit={handleSubmit}> | ||
<div className='form-control'> | ||
<label htmlFor='name'>Name</label> | ||
<input type='text' name={'name'} defaultValue={talent?.name} /> | ||
</div>{' '} | ||
<div className='form-control'> | ||
<label htmlFor='email'>Email</label> | ||
<input type='text' name={'email'} defaultValue={talent?.email} /> | ||
</div>{' '} | ||
<div className='form-control'> | ||
<label htmlFor='jobRole'>Job Role</label> | ||
<input | ||
type='text' | ||
name={'jobRole'} | ||
defaultValue={talent?.jobRole} | ||
/> | ||
</div> | ||
<div className='form-control'> | ||
<label htmlFor='location'>Location</label> | ||
<input | ||
type='text' | ||
name={'location'} | ||
defaultValue={talent?.location} | ||
/> | ||
</div> | ||
<div className='form-control'> | ||
<label htmlFor='github'>Github Username</label> | ||
<input type='text' name={'github'} defaultValue={talent?.github} /> | ||
</div> | ||
<div className='form-control'> | ||
<label htmlFor='linkedIn'>LinkedIn Username</label> | ||
<input | ||
type='text' | ||
name={'linkedIn'} | ||
defaultValue={talent?.linkedin} | ||
/> | ||
</div> | ||
<div className='form-control'> | ||
<label htmlFor='city'>X Username</label> | ||
<input type='text' name={'x'} defaultValue={talent?.x} /> | ||
</div> | ||
<div className='form-control'> | ||
<label htmlFor='profileImg'>Upload your Profile Image</label> | ||
<FileBase | ||
type='file' | ||
multiple={false} | ||
onDone={({ base64 }) => setImg(base64)} | ||
/> | ||
</div> | ||
<div className='form-control'> | ||
<label htmlFor={'bio'}>Bio</label> | ||
<textarea name={'bio'} defaultValue={talent.bio} /> | ||
</div> | ||
{/* add a save button */} | ||
<div className='form-control'> | ||
<TButton | ||
value={(<FaEdit />) as unknown as string} | ||
type={'submit'} | ||
/> | ||
</div> | ||
</form> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default UpdateTalentModal; |
Oops, something went wrong.