Skip to content

Commit

Permalink
Fixed default photo not showing
Browse files Browse the repository at this point in the history
  • Loading branch information
aliraza556 committed Mar 21, 2024
1 parent a92cd5c commit 8104bf0
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 22 deletions.
2 changes: 1 addition & 1 deletion src/pages/leaderboard/userInfo/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export const UserInfo = observer(({ id }: { id: string }) => {
<EuiAvatar
size="l"
name={person.owner_alias}
imageUrl={person.img || '/static/person_placeholder.png'}
imageUrl={person.img || main.getUserAvatarPlaceholder(person.owner_pubkey)}
/>
<div className="info">
<EuiText className="name">
Expand Down
28 changes: 13 additions & 15 deletions src/people/widgetViews/wantedViews/DesktopView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function DesktopView(props: WantedViewsProps) {
titleString
} = props;

const { ui } = useStores();
const { ui, main } = useStores();
const color = colors['light'];

return (
Expand Down Expand Up @@ -105,20 +105,18 @@ function DesktopView(props: WantedViewsProps) {
marginTop: '8px'
}}
>
<img
src={
{
...assignee
}.img || '/static/person_placeholder.png'
}
alt="assignee_img"
style={{
borderRadius: '50%',
height: '16px',
width: '16px',
margin: '0px 8px'
}}
/>
{assignee && (
<img
src={assignee.img || main.getUserAvatarPlaceholder(assignee.owner_pubkey)}
alt="assignee_img"
style={{
borderRadius: '50%',
height: '16px',
width: '16px',
margin: '0px 8px'
}}
/>
)}
<span
onClick={(e: any) => {
e.stopPropagation();
Expand Down
9 changes: 3 additions & 6 deletions src/people/widgetViews/wantedViews/MobileView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ function MobileView(props: any) {
titleString
} = props;

const { ui } = useStores();
const { ui, main } = useStores();
const color = colors['light'];

return (
Expand Down Expand Up @@ -116,11 +116,7 @@ function MobileView(props: any) {
}}
>
<img
src={
{
...assignee
}.img || '/static/person_placeholder.png'
}
src={assignee.img || main.getUserAvatarPlaceholder(assignee.owner_pubkey)}
alt="assignee_img"
style={{
borderRadius: '50%',
Expand Down Expand Up @@ -304,4 +300,5 @@ function MobileView(props: any) {
</div>
);
}

export default observer(MobileView);

0 comments on commit 8104bf0

Please sign in to comment.