Skip to content

Commit

Permalink
feat: add CollectCondition to token gated pubs (#4309)
Browse files Browse the repository at this point in the history
  • Loading branch information
bigint authored Dec 21, 2023
1 parent 594e78b commit 9131bec
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import type { FC } from 'react';

import { CollectCondition } from '@hey/lens';
import Link from 'next/link';

interface CollectConditionProps {
condition: CollectCondition;
}

const CollectCondition: FC<CollectConditionProps> = ({ condition }) => {
const { publicationId, thisPublication } = condition;

return (
<div className="flex items-center space-x-2">
<div>
{thisPublication
? 'Must collect this publication'
: 'Must collect the publication:'}
</div>
{!thisPublication ? (
<div className="linkify">
<Link className="underline" href={`/posts/${publicationId}`}>
{publicationId}
</Link>
</div>
) : null}
</div>
);
};

export default CollectCondition;
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import type { FC } from 'react';

import { ThirdTierCondition } from '@hey/lens';

import CollectCondition from '../CollectCondition';
import EoaOwnershipCondition from '../EoaOwnershipCondition';
import NftOwnershipCondition from '../NftOwnershipCondition';
import ProfileOwnershipCondition from '../ProfileOwnershipCondition';
Expand All @@ -22,6 +23,9 @@ const ThirdTierCondition: FC<ThirdTierConditionProps> = ({ condition }) => {
{condition.__typename === 'NftOwnershipCondition' ? (
<NftOwnershipCondition condition={condition} />
) : null}
{condition.__typename === 'CollectCondition' ? (
<CollectCondition condition={condition} />
) : null}
</div>
);
};
Expand Down

1 comment on commit 9131bec

@vercel
Copy link

@vercel vercel bot commented on 9131bec Dec 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

web – ./

web-heyxyz.vercel.app
web-git-main-heyxyz.vercel.app
hey.xyz
heyxyz.vercel.app

Please sign in to comment.