Skip to content

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

Draft
wants to merge 1 commit into
base: development
Choose a base branch
from

Conversation

Disura-Randunu
Copy link
Contributor

Purpose

The purpose of this PR is to fix #

Goals

Approach

Screenshots

Checklist

  • This PR doesn't commit any keys, passwords, tokens, usernames, or other secrets.
  • I have read and understood the development best practices guidelines ( http://bit.ly/sef-best-practices )
  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation

Related PRs

Test environment

Learning

Comment on lines +69 to +102
<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>
Copy link
Member

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.

Copy link
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants