Skip to content

Commit

Permalink
fix: proper logic for impacts
Browse files Browse the repository at this point in the history
  • Loading branch information
Shalankwa authored and benfurber committed Oct 2, 2024
1 parent da8e21b commit 5ff5570
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/pages/User/content/SpaceProfile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ export const SpaceProfile = ({ user, docs }: IProps) => {

const coverImage = getCoverImages(user)
const hasContributed = docs?.howtos.length + docs?.research.length > 0
const hasImpacted = !!impact

const userLinks = links.filter(
(linkItem) =>
Expand Down Expand Up @@ -252,8 +253,8 @@ export const SpaceProfile = ({ user, docs }: IProps) => {
<Tabs defaultValue={0}>
<TabsList>
<Tab>Profile</Tab>
{hasContributed && <Tab>Contributions</Tab>}
{hasContributed && isPreciousPlastic() && (
{hasContributed && <Tab data-cy="ContribTab">Contributions</Tab>}
{hasImpacted && isPreciousPlastic() && (
<Tab data-cy="ImpactTab">{heading}</Tab>
)}
<Tab data-cy="contact-tab">Contact</Tab>
Expand Down Expand Up @@ -311,7 +312,7 @@ export const SpaceProfile = ({ user, docs }: IProps) => {
<UserCreatedDocuments docs={docs} />
</TabPanel>
)}
{hasContributed && isPreciousPlastic() && (
{hasImpacted && isPreciousPlastic() && (
<TabPanel>
<Impact impact={impact} user={user} />
</TabPanel>
Expand Down

0 comments on commit 5ff5570

Please sign in to comment.