Skip to content

Commit

Permalink
Fix Profile image Loading (#188)
Browse files Browse the repository at this point in the history
  • Loading branch information
dilankavishka authored Sep 24, 2024
1 parent 6775751 commit 6bcc56c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 24 deletions.
18 changes: 6 additions & 12 deletions src/components/MenteeApplication/MenteeApplication.component.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import { getStateColor } from '../../utils';
import UserIcon from '../../assets/svg/Icons/UserIcon';
import ProfilePic from '../ProfilePic';
import { useParams } from 'react-router-dom';
import useMentee from '../../hooks/admin/useMentee';
import Toast from '../Toast';
Expand Down Expand Up @@ -33,17 +33,11 @@ const MenteeApplication: React.FC = () => {
) : (
<div className="w-full space-y-8">
<div className="flex items-center">
{mentee?.profile.image_url !== '' ? (
<img
src={mentee?.profile.image_url}
alt="Mentee Avatar"
className="w-24 h-24 rounded-full mb-4 object-cover"
/>
) : (
<div className="w-24 h-24 bg-gray-200 rounded-full mb-4 flex items-center justify-center">
<UserIcon />
</div>
)}
<ProfilePic
src={mentee?.profile.image_url}
alt="Mentee Avatar"
size="6rem"
/>
<div className="ml-5">
<div className="flex items-center space-x-3">
<span className="text-2xl font-semibold">
Expand Down
18 changes: 6 additions & 12 deletions src/components/MentorApplication/MentorApplication.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { getStateColor } from '../../utils';
import { useParams } from 'react-router-dom';
import useMentor from '../../hooks/admin/useMentor';
import Toast from '../Toast';
import UserIcon from '../../assets/svg/Icons/UserIcon';
import ProfilePic from '../ProfilePic';
import ActionButtons from '../ActionButtons';
import { ApplicationStatus } from '../../enums';

Expand Down Expand Up @@ -33,17 +33,11 @@ const MentorApplication: React.FC = () => {
) : (
<div className="w-full space-y-8">
<div className="flex items-center">
{mentor?.profile.image_url ? (
<img
src={mentor?.profile.image_url}
alt=""
className="w-24 h-24 rounded-full object-cover"
/>
) : (
<div className="w-12 h-12 md:w-24 md:h-24 bg-gray-200 rounded-full flex items-center justify-center">
<UserIcon />
</div>
)}
<ProfilePic
src={mentor?.profile.image_url}
alt="Mentee Avatar"
size="6rem"
/>
<div className="ml-5">
<div className="flex items-center space-x-3">
<span className="text-2xl font-semibold">
Expand Down

0 comments on commit 6bcc56c

Please sign in to comment.