Skip to content

Commit

Permalink
Migrate to Lens v3
Browse files Browse the repository at this point in the history
  • Loading branch information
Yoginth committed Dec 21, 2024
1 parent 9552f1b commit 8b40145
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 48 deletions.
2 changes: 1 addition & 1 deletion apps/web/src/components/Group/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ const ViewGroup: NextPage = () => {
<Details group={group} stats={stats} />
</GridItemFour>
<GridItemEight className="space-y-5">
{currentAccount && group.isMember && <NewPost />}
{currentAccount && group.operations?.isMember && <NewPost />}
<GroupFeed address={group.address} />
</GridItemEight>
</GridLayout>
Expand Down
6 changes: 3 additions & 3 deletions apps/web/src/components/Shared/Group/JoinLeaveButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ const JoinLeaveButton: FC<JoinLeaveButtonProps> = ({
group,
small = false
}) => {
const [joined, setJoined] = useState(group.isMember);
const [joined, setJoined] = useState(group.operations?.isMember);

useEffect(() => {
setJoined(group.isMember);
}, [group.isMember]);
setJoined(group.operations?.isMember);
}, [group.operations?.isMember]);

return joined ? (
<Leave address={group.address} setJoined={setJoined} small={small} />
Expand Down
12 changes: 8 additions & 4 deletions apps/web/src/components/Shared/Modal/Members.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,19 @@ const Members: FC<MembersProps> = ({ address }) => {
return (
<Virtuoso
className="virtual-account-list"
computeItemKey={(index, member) => `${member.address}-${index}`}
computeItemKey={(index, member) => `${member.account.address}-${index}`}
data={groupMembers}
endReached={onEndReached}
itemContent={(_, member) => (
<div className="p-5">
<SingleAccount
hideFollowButton={currentAccount?.address === member.address}
hideUnfollowButton={currentAccount?.address === member.address}
account={member as Account}
hideFollowButton={
currentAccount?.address === member.account.address
}
hideUnfollowButton={
currentAccount?.address === member.account.address
}
account={member.account as Account}
showBio
showUserPreview={false}
/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,6 @@
import MetaDetails from "@components/Shared/MetaDetails";
import {
BanknotesIcon,
HandRaisedIcon,
HashtagIcon,
PhotoIcon
} from "@heroicons/react/24/outline";
import {
CheckCircleIcon,
ShieldCheckIcon,
XCircleIcon
} from "@heroicons/react/24/solid";
import { BanknotesIcon, HashtagIcon } from "@heroicons/react/24/outline";
import { ShieldCheckIcon } from "@heroicons/react/24/solid";
import formatAddress from "@hey/helpers/formatAddress";
import type { Account } from "@hey/indexer";
import { H5 } from "@hey/ui";
Expand Down Expand Up @@ -42,35 +33,6 @@ const AccountOverview: FC<AccountOverviewProps> = ({ account }) => {
>
{formatAddress(account.owner)}
</MetaDetails>
{account?.followNftAddress ? (
<MetaDetails
icon={<PhotoIcon className="ld-text-gray-500 size-4" />}
title="NFT address"
value={account.followNftAddress.address}
>
{formatAddress(account.followNftAddress.address)}
</MetaDetails>
) : null}
<MetaDetails
icon={<HandRaisedIcon className="ld-text-gray-500 size-4" />}
title="Has Lens Manager"
>
{account.signless ? (
<CheckCircleIcon className="size-4 text-green-500" />
) : (
<XCircleIcon className="size-4 text-red-500" />
)}
</MetaDetails>
<MetaDetails
icon={<HandRaisedIcon className="ld-text-gray-500 size-4" />}
title="Gas sponsored"
>
{account.sponsor ? (
<CheckCircleIcon className="size-4 text-green-500" />
) : (
<XCircleIcon className="size-4 text-red-500" />
)}
</MetaDetails>
</div>
</>
);
Expand Down

0 comments on commit 8b40145

Please sign in to comment.