File tree Expand file tree Collapse file tree 2 files changed +15
-3
lines changed
app/[username]/[articleHandle] Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -114,11 +114,18 @@ const Page: NextPage<ArticlePageProps> = async ({ params }) => {
114114 </ div >
115115 ) }
116116
117+ { /* <pre>{JSON.stringify(article?.user, null, 2)}</pre> */ }
118+
117119 { /* User information */ }
118120 < div className = "mb-4 flex items-center my-4" >
119121 < div className = "relative rounded-full overflow-hidden border transition-transform duration-300 size-10" >
120- < Image
121- src = { getFileUrl ( article ?. user ?. profile_photo ) ?? "" }
122+ < img
123+ src = {
124+ Boolean ( article ?. user ?. profile_photo )
125+ ? getFileUrl ( article ?. user ?. profile_photo )
126+ : "https://api.dicebear.com/9.x/personas/svg?seed=" +
127+ article ?. user ?. name
128+ }
122129 alt = { article ?. user ?. username ?? "" }
123130 width = { 40 }
124131 height = { 40 }
Original file line number Diff line number Diff line change @@ -56,7 +56,12 @@ const ArticleCard = ({
5656 width = { 32 }
5757 height = { 32 }
5858 unoptimized
59- src = { author . avatar ?? "" }
59+ src = {
60+ Boolean ( author . avatar )
61+ ? author . avatar
62+ : "https://api.dicebear.com/9.x/personas/svg?seed=" +
63+ author . name
64+ }
6065 alt = { author . name ?? "" }
6166 className = "w-full h-full object-cover transition-opacity duration-300 ease-in-out opacity-100"
6267 />
You can’t perform that action at this time.
0 commit comments