-
Notifications
You must be signed in to change notification settings - Fork 60
Admins - Mentor profile image update feature added #237
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: development
Are you sure you want to change the base?
Conversation
<div className="relative"> | ||
<input | ||
type="file" | ||
id="profilePic" | ||
accept="image/*" | ||
className="hidden" | ||
onChange={handleProfilePicChange} | ||
name="profilePic" | ||
/> | ||
<div | ||
onClick={handleImageClick} | ||
className="cursor-pointer relative group mb-4" | ||
> | ||
{profilePic ? ( | ||
<img | ||
src={profilePic} | ||
alt="Profile" | ||
className="w-[90px] h-[90px] rounded-full object-cover" | ||
referrerPolicy="no-referrer" | ||
/> | ||
) : ( | ||
<div className="w-[90px] h-[90px] rounded-full bg-gray-200 flex items-center justify-center"> | ||
<div className="w-24 h-24 bg-gray-200 rounded-full mx-auto flex items-center justify-center"> | ||
<span className="text-gray-400">+</span> | ||
</div> | ||
</div> | ||
)} | ||
<div className="absolute bottom-0 w-[90px] h-1/2 bg-black bg-opacity-40 rounded-b-full flex items-center p-5 justify-center"> | ||
<span className="text-white text-center text-xs"> | ||
Change Photo | ||
</span> | ||
</div> | ||
</div> | ||
</div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we create a separate component for this cuz we duplicating the code here and the settings page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@anjula-sack looked into it again. Seems the settings page is handling the image upload after a button is beging clicked since other fields such as firstName & lastName can be changed through that as well.
in the change I did, it handles the image uplaod when a file is being selected since there are no buttons within the page to update other data of mentors.
Purpose
The purpose of this PR is to fix #
Goals
Approach
Screenshots
Checklist
Related PRs
Test environment
Learning