diff --git a/src/components/feed/SingleFeed.jsx b/src/components/feed/SingleFeed.jsx index dd4007e..731b1a2 100644 --- a/src/components/feed/SingleFeed.jsx +++ b/src/components/feed/SingleFeed.jsx @@ -3,6 +3,7 @@ import { hasMirrored } from "lens/check-mirror.js"; import { Link } from "react-router-dom"; import { useEffect, useState } from "react"; import PostStatus from "../post/PostStatus.jsx"; +import defaultUserIcon from "assets/defaultUserIcon.png"; const SingleFeed = ({ data }) => { const stats = data.postStats; @@ -35,6 +36,10 @@ const SingleFeed = ({ data }) => { } }, [loading]); + function addDefaultPFP(ev) { + ev.target.src = defaultUserIcon; + } + return ( <> {/*
@@ -62,6 +67,7 @@ const SingleFeed = ({ data }) => { className="h-9 w-9 rounded-full ring-2 ring-blue-100 hover:brightness-90" src={userProPic} alt="profile picture" + onError={addDefaultPFP} />
diff --git a/src/components/post/FullPost.jsx b/src/components/post/FullPost.jsx index 7b2a5e3..f6ebcdf 100644 --- a/src/components/post/FullPost.jsx +++ b/src/components/post/FullPost.jsx @@ -38,6 +38,11 @@ const FullPost = ({ postData, mirrored, mirrorFunc, mirrorsCount }) => { } }, []); + const resolveLink = (url) => { + if (!url || !url.includes("ipfs://")) return url; + return url.replace("ipfs://", "https://gateway.ipfs.io/ipfs/"); + }; + return ( <>
@@ -74,7 +79,7 @@ const FullPost = ({ postData, mirrored, mirrorFunc, mirrorsCount }) => { ) : (
post image diff --git a/src/components/profile/ProfilePage.jsx b/src/components/profile/ProfilePage.jsx index b5d1c1f..e266089 100644 --- a/src/components/profile/ProfilePage.jsx +++ b/src/components/profile/ProfilePage.jsx @@ -140,6 +140,10 @@ export default function ProfilePage() { return

This profile doesn't exist

; } + function addDefaultPFP(ev) { + ev.target.src = defaultUserIcon; + } + const profileName = profile?.name ? profile?.handle : profile?.handle @@ -191,6 +195,7 @@ export default function ProfilePage() { className="inline-block h-16 w-16 sm:h-20 sm:w-20 rounded-full" src={profile?.picture?.original?.url || defaultUserIcon} alt="profile picture" + onError={addDefaultPFP} />