Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix projects visibility on testnet #342

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions apps/new/widget/components/project/Card.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,11 @@ const ProjectCard = ({ data, showEditProjectAction }) => {
collaborators,
metadata,
projectID,
profileImage,
backgroundImage,
location,
} = data;

const profile = Social.getr(`${projectAccountId}/profile`);

return (
<Link
href={href({
Expand All @@ -124,8 +125,8 @@ const ProjectCard = ({ data, showEditProjectAction }) => {
src="${alias_mob}/widget/Image"
loading=""
props={{
image: profile.backgroundImage,
alt: profile?.name,
image: backgroundImage.image ?? backgroundImage,
alt: title,
className: "w-100",
style: {
objectFit: "cover",
Expand All @@ -149,8 +150,8 @@ const ProjectCard = ({ data, showEditProjectAction }) => {
src="${alias_mob}/widget/Image"
loading=""
props={{
image: metadata.profileImage?.image ?? metadata.profileImage,
alt: metadata.title,
image: profileImage?.image ?? profileImage,
alt: title,
className: "rounded-circle w-100 h-100",
style: { objectFit: "cover" },
thumbnail: "thumbnail",
Expand Down Expand Up @@ -205,10 +206,10 @@ const ProjectCard = ({ data, showEditProjectAction }) => {
</div>
<div className="d-flex justify-content-between align-items-center mt-auto">
<div className="d-flex align-items-center flex-wrap gap-2">
{profile.location && (
{location && (
<Tag>
<i className="bi bi-globe"></i>
{profile.location}
{location}
</Tag>
)}
{tags.map((tag) => (
Expand Down
12 changes: 6 additions & 6 deletions apps/new/widget/components/project/ListCard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,10 @@ const ListCard = ({ data, showEditProjectAction }) => {
collaborators,
metadata,
projectID,
profileImage,
location,
} = data;

const profile = Social.getr(`${projectAccountId}/profile`);

return (
<Link
href={href({
Expand All @@ -130,8 +130,8 @@ const ListCard = ({ data, showEditProjectAction }) => {
src="${alias_mob}/widget/Image"
loading=""
props={{
image: metadata.profileImage?.image ?? metadata.profileImage,
alt: metadata.title,
image: profileImage?.image ?? profileImage,
alt: title,
className: "rounded-circle w-100 h-100",
style: { objectFit: "cover" },
thumbnail: "thumbnail",
Expand All @@ -156,9 +156,9 @@ const ListCard = ({ data, showEditProjectAction }) => {
</div>
<div className="d-flex align-items-center gap-3">
<div className="d-flex align-items-center flex-wrap gap-2">
{profile.location && (
{location && (
<Tag>
<i className="bi bi-globe"></i> {profile.location}
<i className="bi bi-globe"></i> {location}
</Tag>
)}
{tags.map((tag) => (
Expand Down
2 changes: 1 addition & 1 deletion apps/new/widget/lib/projects.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const processData = (data, type) => {
};

const fetchProjects = (props) => {
const app = props.app || "${alias_old}";
const app = props.app || "${alias_new}";
const type = props.type || "project";

const data = fetchThings(props, app, type);
Expand Down
11 changes: 7 additions & 4 deletions apps/new/widget/page/projects/Editor.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -151,18 +151,21 @@ useEffect(() => {
const {
title,
description,
image,
profileImage,
backgroundImage,
linktree,
contributorsWithRoles,
contributors,
projectAccountId,
tags,
tabs,
location,
teamSize,
} = editProjectData;

const { twitter, github, telegram, website } = linktree;
setTitle(title);
setLocation(location);
setTeamSize(teamSize);
setProjectId(editProjectId.split("project/")[1]);
setDescription(description);
setContributorsWithRoles(contributorsWithRoles ?? []);
Expand All @@ -171,8 +174,8 @@ useEffect(() => {
setGitHub(github);
setTelegram(telegram);
setWebsite(website);
setAvatar(image);
setCoverImage(backgroundImage);
setAvatar(profileImage?.image ?? profileImage);
setCoverImage(backgroundImage?.image ?? backgroundImage);
setProjectAccount(projectAccountId);
setTags(tags);
setSelectedTabs(new Set(tabs));
Expand Down
Loading