diff --git a/apps/potlock/widget/Project/Detail.jsx b/apps/potlock/widget/Project/Detail.jsx index a3d7e58d..910ff825 100644 --- a/apps/potlock/widget/Project/Detail.jsx +++ b/apps/potlock/widget/Project/Detail.jsx @@ -104,10 +104,16 @@ const BannerSkeleton = () => ( ); -if (registration === null) return ; -if (registration == undefined) { - return
Project not found
; -} +const account = fetch("https://api3.nearblocks.io/v1/account/" + projectId); + +if (registration === null || account === null) return ; + +const isObjectNotEmpty = (obj) => Object.keys(obj).length > 0; + +const addressExist = account?.body?.account[0]; + +if (!isObjectNotEmpty(addressExist || {})) + return
Account does not exist.
; const [directDonations, setDirectDonations] = useState(null); // mapping of pot IDs to array of Round Matching Donations for the project diff --git a/apps/potlock/widget/Project/ProjectBanner.jsx b/apps/potlock/widget/Project/ProjectBanner.jsx index 52e1d5dc..79af3abb 100644 --- a/apps/potlock/widget/Project/ProjectBanner.jsx +++ b/apps/potlock/widget/Project/ProjectBanner.jsx @@ -27,8 +27,14 @@ const statuses = { textColor: "#F6F5F3", toggleColor: "#C7C7C7", }, + Unregistered: { + background: "#DD3345", + text: "UNREGISTERED: This account has not registered as a public good", + textColor: "#F6F5F3", + toggleColor: "#C7C7C7", + }, }; -const registrationStatus = statuses[registration.status]; +const registrationStatus = registration ? statuses[registration.status] : statuses.Unregistered; const Banner = styled.div` width: 100%;