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 13, 2024
1 parent 503a41c commit 3768a40
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import getStampFyiURL from "@hey/helpers/getStampFyiURL";
import {
type Account,
type RecipientDataOutput,
useAccountsQuery
useAccountsBulkQuery
} from "@hey/indexer";
import { Image } from "@hey/ui";
import { chains } from "@lens-network/sdk/viem";
Expand All @@ -19,7 +19,7 @@ interface SplitsProps {
}

const Splits: FC<SplitsProps> = ({ recipients }) => {
const { data: recipientProfilesData, loading } = useAccountsQuery({
const { data: recipientProfilesData, loading } = useAccountsBulkQuery({
skip: !recipients?.length,
variables: {
request: { addresses: recipients?.map((r) => r.recipient) }
Expand All @@ -31,7 +31,7 @@ const Splits: FC<SplitsProps> = ({ recipients }) => {
}

const getAccountByAddress = (address: string) => {
const accounts = recipientProfilesData?.accounts;
const accounts = recipientProfilesData?.accountsBulk;
if (accounts) {
return accounts.find((a) => a.address === address);
}
Expand Down
12 changes: 6 additions & 6 deletions apps/web/src/components/Post/RelevantPeople.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { AccountLinkSource } from "@hey/data/tracking";
import {
type Account,
type AccountMention,
useAccountsQuery
useAccountsBulkQuery
} from "@hey/indexer";
import { Card, ErrorMessage, Modal } from "@hey/ui";
import type { FC } from "react";
Expand All @@ -24,7 +24,7 @@ const RelevantPeople: FC<RelevantPeopleProps> = ({ mentions }) => {
(accountMention) => accountMention.account
);

const { data, error, loading } = useAccountsQuery({
const { data, error, loading } = useAccountsBulkQuery({
skip: accountAddresses.length <= 0,
variables: { request: { addresses: accountAddresses } }
});
Expand All @@ -48,11 +48,11 @@ const RelevantPeople: FC<RelevantPeopleProps> = ({ mentions }) => {
);
}

if (data?.accounts?.length === 0) {
if (data?.accountsBulk?.length === 0) {
return null;
}

const firstAccounts = data?.accounts?.slice(0, 5);
const firstAccounts = data?.accountsBulk?.slice(0, 5);

return (
<>
Expand All @@ -69,7 +69,7 @@ const RelevantPeople: FC<RelevantPeopleProps> = ({ mentions }) => {
/>
</div>
))}
{(data?.accounts?.length || 0) > 5 && (
{(data?.accountsBulk?.length || 0) > 5 && (
<button
className="ld-text-gray-500 font-bold"
onClick={() => setShowMore(true)}
Expand All @@ -84,7 +84,7 @@ const RelevantPeople: FC<RelevantPeopleProps> = ({ mentions }) => {
show={showMore}
title="Relevant people"
>
<MoreRelevantPeople accounts={data?.accounts as Account[]} />
<MoreRelevantPeople accounts={data?.accountsBulk as Account[]} />
</Modal>
</>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { XMarkIcon } from "@heroicons/react/24/outline";
import { AccountLinkSource } from "@hey/data/tracking";
import getAccount from "@hey/helpers/getAccount";
import stopEventPropagation from "@hey/helpers/stopEventPropagation";
import { type Account, useAccountsQuery } from "@hey/indexer";
import { type Account, useAccountsBulkQuery } from "@hey/indexer";
import { H6 } from "@hey/ui";
import { useRouter } from "next/router";
import type { FC } from "react";
Expand All @@ -23,7 +23,7 @@ const RecentAccounts: FC<RecentAccountsProps> = ({ onAccountClick }) => {
profiles: recentProfiles
} = useSearchStore();

const { data, loading } = useAccountsQuery({
const { data, loading } = useAccountsBulkQuery({
skip: recentProfiles.length === 0,
variables: { request: { addresses: recentProfiles } }
});
Expand All @@ -32,7 +32,7 @@ const RecentAccounts: FC<RecentAccountsProps> = ({ onAccountClick }) => {
return null;
}

const accounts = data?.accounts || [];
const accounts = data?.accountsBulk || [];

return (
<div>
Expand Down

0 comments on commit 3768a40

Please sign in to comment.