Skip to content

Commit 349dde2

Browse files
committed
feat: set fallback image to people when isDev
1 parent ffbe444 commit 349dde2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/components/PersonCard.astro

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ let icons = [
7373
7474
const { person } = Astro.props;
7575
76+
const isDev = import.meta.env.DEV;
77+
7678
const {
7779
data: { name, addresses, avatar, occupations },
7880
} = person;
@@ -97,6 +99,8 @@ let links = icons
9799
}));
98100
99101
const tags = await getPersonTags(person);
102+
103+
export const fallbackImage = '/projects/imgs/clarity-avatar-solid.svg';
100104
---
101105

102106
<div
@@ -106,7 +110,7 @@ const tags = await getPersonTags(person);
106110
<figure class="mx-auto overflow-hidden">
107111
<a href={addresses.linkedin} target="_blank" class="animate-pulse">
108112
<img
109-
src={getAvatarImageUrl(person)}
113+
src={isDev ? fallbackImage : getAvatarImageUrl(person)}
110114
alt={name.full}
111115
title={name.full}
112116
class="bg-gray-300 object-cover w-full h-[233px] hover:scale-105 transition duration-500"

0 commit comments

Comments
 (0)