diff --git a/apps/api/tests/analytics/overview.spec.ts b/apps/api/tests/analytics/overview.spec.ts index 9c1c41213bb4..f78782220dfe 100644 --- a/apps/api/tests/analytics/overview.spec.ts +++ b/apps/api/tests/analytics/overview.spec.ts @@ -16,7 +16,7 @@ describe("GET /analytics/overview", () => { expect(item).toHaveProperty("likes"); expect(item).toHaveProperty("comments"); expect(item).toHaveProperty("collects"); - expect(item).toHaveProperty("mirrors"); + expect(item).toHaveProperty("reposts"); expect(item).toHaveProperty("quotes"); expect(item).toHaveProperty("mentions"); expect(item).toHaveProperty("follows"); diff --git a/apps/og/src/app/posts/[id]/page.tsx b/apps/og/src/app/posts/[id]/page.tsx index 6e439e59912e..7c0583043dde 100644 --- a/apps/og/src/app/posts/[id]/page.tsx +++ b/apps/og/src/app/posts/[id]/page.tsx @@ -87,7 +87,7 @@ export const generateMetadata = async ({ "count:actions": targetPost.stats.countOpenActions, "count:comments": targetPost.stats.comments, "count:likes": targetPost.stats.reactions, - "count:mirrors": targetPost.stats.reposts, + "count:reposts": targetPost.stats.reposts, "count:quotes": targetPost.stats.quotes, "lens:id": targetPost.id, ...getCollectModuleMetadata(targetPost) @@ -128,7 +128,7 @@ const Page = async ({ params }: Props) => { Likes: {metadata.other?.["count:likes"]}
  • - Mirrors: {metadata.other?.["count:mirrors"]} + Reposts: {metadata.other?.["count:reposts"]}
  • diff --git a/apps/web/src/components/Analytics/Overview.tsx b/apps/web/src/components/Analytics/Overview.tsx index d7a557820781..93c192c5d7dd 100644 --- a/apps/web/src/components/Analytics/Overview.tsx +++ b/apps/web/src/components/Analytics/Overview.tsx @@ -39,7 +39,7 @@ const Overview: FC = () => { likes: number; comments: number; collects: number; - mirrors: number; + reposts: number; quotes: number; mentions: number; follows: number; @@ -79,7 +79,7 @@ const Overview: FC = () => { "Likes", "Comments", "Collects", - "Mirrors", + "Reposts", "Quotes", "Mentions", "Follows", diff --git a/apps/web/src/components/Composer/Actions/ReferenceSettings/index.tsx b/apps/web/src/components/Composer/Actions/ReferenceSettings/index.tsx index a0e1efa2b3ce..4640c2d31ead 100644 --- a/apps/web/src/components/Composer/Actions/ReferenceSettings/index.tsx +++ b/apps/web/src/components/Composer/Actions/ReferenceSettings/index.tsx @@ -65,18 +65,18 @@ const ReferenceSettings: FC = () => { const getSelectedReferenceModuleTooltipText = () => { if (isMyFollowers) { - return "My followers can comment and mirror"; + return "My followers can comment and repost"; } if (isMyFollows) { - return "My follows can comment and mirror"; + return "My follows can comment and repost"; } if (isFriendsOfFriends) { - return "Friend of friends can comment and mirror"; + return "Friend of friends can comment and repost"; } - return "Everyone can comment and mirror"; + return "Everyone can comment and repost"; }; return ( diff --git a/apps/web/src/components/Group/Details.tsx b/apps/web/src/components/Group/Details.tsx index b5646d4b538d..c842a0983aa8 100644 --- a/apps/web/src/components/Group/Details.tsx +++ b/apps/web/src/components/Group/Details.tsx @@ -3,17 +3,19 @@ import Markup from "@components/Shared/Markup"; import Slug from "@components/Shared/Slug"; import getMentions from "@hey/helpers/getMentions"; import humanize from "@hey/helpers/humanize"; -import type { Group } from "@hey/indexer"; +import type { Group, GroupStatsResponse } from "@hey/indexer"; import { H3, H4, Image, LightBox } from "@hey/ui"; import Link from "next/link"; +import plur from "plur"; import type { FC } from "react"; import { useState } from "react"; interface DetailsProps { group: Group; + stats: GroupStatsResponse; } -const Details: FC = ({ group }) => { +const Details: FC = ({ group, stats }) => { const [expandedImage, setExpandedImage] = useState(null); return ( @@ -47,10 +49,12 @@ const Details: FC = ({ group }) => {
    -

    {humanize(group.totalMembers)}

    -
    Members
    +

    {humanize(stats.totalMembers)}

    +
    + {plur("Member", stats.totalMembers)} +
    diff --git a/apps/web/src/components/Group/index.tsx b/apps/web/src/components/Group/index.tsx index d9a1b7825064..133f8ea56fc7 100644 --- a/apps/web/src/components/Group/index.tsx +++ b/apps/web/src/components/Group/index.tsx @@ -4,7 +4,11 @@ import Cover from "@components/Shared/Cover"; import { Leafwatch } from "@helpers/leafwatch"; import { APP_NAME, STATIC_IMAGES_URL } from "@hey/data/constants"; import { PAGEVIEW } from "@hey/data/tracking"; -import { type Group, useGroupQuery } from "@hey/indexer"; +import { + type Group, + type GroupStatsResponse, + useGroupQuery +} from "@hey/indexer"; import { GridItemEight, GridItemFour, GridLayout } from "@hey/ui"; import type { NextPage } from "next"; import { useRouter } from "next/router"; @@ -21,23 +25,26 @@ const ViewGroup: NextPage = () => { const { isReady, pathname, - query: { slug } + query: { address } } = useRouter(); const { currentAccount } = useAccountStore(); - const showMembers = pathname === "/g/[slug]/members"; + const showMembers = pathname === "/g/[address]/members"; useEffect(() => { if (isReady) { Leafwatch.track(PAGEVIEW, { page: "group", - subpage: pathname.replace("/g/[handle]", "") + subpage: pathname.replace("/g/[address]", "") }); } - }, [slug]); + }, [address]); const { data, loading, error } = useGroupQuery({ - variables: { request: { group: slug } } + variables: { + groupRequest: { group: address }, + groupStatsRequest: { group: address } + } }); if (!isReady || loading) { @@ -53,6 +60,7 @@ const ViewGroup: NextPage = () => { } const group = data.group as Group; + const stats = data.groupStats as GroupStatsResponse; return ( <> @@ -65,11 +73,11 @@ const ViewGroup: NextPage = () => { /> -
    +
    {showMembers ? ( - + ) : ( <> {currentAccount && group.isMember && ( diff --git a/apps/web/src/components/Post/Actions/Share/Repost.tsx b/apps/web/src/components/Post/Actions/Share/Repost.tsx index e5e71550eb2b..10d9120d2eea 100644 --- a/apps/web/src/components/Post/Actions/Share/Repost.tsx +++ b/apps/web/src/components/Post/Actions/Share/Repost.tsx @@ -2,16 +2,12 @@ import { useApolloClient } from "@apollo/client"; import { MenuItem } from "@headlessui/react"; import errorToast from "@helpers/errorToast"; import { Leafwatch } from "@helpers/leafwatch"; -import hasOptimisticallyMirrored from "@helpers/optimistic/hasOptimisticallyMirrored"; import { ArrowsRightLeftIcon } from "@heroicons/react/24/outline"; import { Errors } from "@hey/data/errors"; import { POST } from "@hey/data/tracking"; -import { - type CreateRepostRequest, - type Post, - TriStateValue, - useRepostMutation -} from "@hey/indexer"; +import selfFundedTransactionData from "@hey/helpers/selfFundedTransactionData"; +import sponsoredTransactionData from "@hey/helpers/sponsoredTransactionData"; +import { type Post, TriStateValue, useRepostMutation } from "@hey/indexer"; import { OptmisticPostType } from "@hey/types/enums"; import type { OptimisticTransaction } from "@hey/types/misc"; import cn from "@hey/ui/cn"; @@ -21,6 +17,8 @@ import { toast } from "react-hot-toast"; import { useAccountStatus } from "src/store/non-persisted/useAccountStatus"; import { useAccountStore } from "src/store/persisted/useAccountStore"; import { useTransactionStore } from "src/store/persisted/useTransactionStore"; +import { sendEip712Transaction, sendTransaction } from "viem/zksync"; +import { useWalletClient } from "wagmi"; interface RepostProps { isLoading: boolean; @@ -31,17 +29,18 @@ interface RepostProps { const Repost: FC = ({ isLoading, post, setIsLoading }) => { const { currentAccount } = useAccountStore(); const { isSuspended } = useAccountStatus(); - const { addTransaction } = useTransactionStore(); + const { addTransaction, hasOptimisticallyReposted } = useTransactionStore(); const hasReposted = - post.operations?.hasReposted || hasOptimisticallyMirrored(post.id); + post.operations?.hasReposted || hasOptimisticallyReposted(post.id); const [shares, { increment }] = useCounter( post.stats.reposts + post.stats.quotes ); const { cache } = useApolloClient(); + const { data: walletClient } = useWalletClient(); - const generateOptimisticMirror = ({ + const generateOptimisticRepost = ({ txHash }: { txHash: string; @@ -49,7 +48,7 @@ const Repost: FC = ({ isLoading, post, setIsLoading }) => { return { repostOf: post?.id, txHash, - type: OptmisticPostType.Mirror + type: OptmisticPostType.Repost }; }; @@ -68,52 +67,55 @@ const Repost: FC = ({ isLoading, post, setIsLoading }) => { }); }; - const onError = (error?: any) => { - setIsLoading(false); - errorToast(error); - }; - - const onCompleted = ( - __typename?: "LensProfileManagerRelayError" | "RelayError" | "RelaySuccess" - ) => { - if ( - __typename === "RelayError" || - __typename === "LensProfileManagerRelayError" - ) { - return onError(); - } - + const onCompleted = (hash: string) => { setIsLoading(false); increment(); updateCache(); + addTransaction(generateOptimisticRepost({ txHash: hash })); toast.success("Post has been mirrored!"); - Leafwatch.track(POST.MIRROR, { postId: post.id }); + Leafwatch.track(POST.REPOST, { postId: post.id }); }; - // Onchain mutations - const [createRepost] = useRepostMutation({ - onCompleted: ({ repost }) => { + const [repost] = useRepostMutation({ + onCompleted: async ({ repost }) => { if (repost.__typename === "PostResponse") { - addTransaction(generateOptimisticMirror({ txHash: repost.hash })); + return onCompleted(repost.hash); + } + + if (walletClient) { + if (repost.__typename === "SponsoredTransactionRequest") { + const hash = await sendEip712Transaction(walletClient, { + account: walletClient.account, + ...sponsoredTransactionData(repost.raw) + }); + + return onCompleted(hash); + } + + if (repost.__typename === "SelfFundedTransactionRequest") { + const hash = await sendTransaction(walletClient, { + account: walletClient.account, + ...selfFundedTransactionData(repost.raw) + }); + + return onCompleted(hash); + } + } + + if (repost.__typename === "TransactionWillFail") { + return toast.error(repost.reason); } - onCompleted(repost.__typename); }, - onError + onError: (error) => { + setIsLoading(false); + errorToast(error); + } }); if (post.operations?.canRepost === TriStateValue.No) { return null; } - const repost = async (request: CreateRepostRequest) => { - const { data } = await createRepost({ variables: { request } }); - if (data?.repost.__typename === "TransactionWillFail") { - return await createOnchainMirrorTypedData({ - variables: { request } - }); - } - }; - const handleCreateRepost = async () => { if (!currentAccount) { return toast.error(Errors.SignWallet); @@ -123,14 +125,9 @@ const Repost: FC = ({ isLoading, post, setIsLoading }) => { return toast.error(Errors.Suspended); } - try { - setIsLoading(true); - const request: CreateRepostRequest = { post: post?.id }; + setIsLoading(true); - return await repost(request); - } catch (error) { - onError(error); - } + return await repost({ variables: { request: { post: post.id } } }); }; return ( diff --git a/apps/web/src/components/Post/Actions/Share/UndoMirror.tsx b/apps/web/src/components/Post/Actions/Share/UndoRepost.tsx similarity index 90% rename from apps/web/src/components/Post/Actions/Share/UndoMirror.tsx rename to apps/web/src/components/Post/Actions/Share/UndoRepost.tsx index 055450c5be9c..8e5cc39ba5a8 100644 --- a/apps/web/src/components/Post/Actions/Share/UndoMirror.tsx +++ b/apps/web/src/components/Post/Actions/Share/UndoRepost.tsx @@ -12,13 +12,13 @@ import type { Dispatch, FC, SetStateAction } from "react"; import { toast } from "react-hot-toast"; import { useAccountStore } from "src/store/persisted/useAccountStore"; -interface MirrorProps { +interface UndoRepostProps { isLoading: boolean; post: AnyPost; setIsLoading: Dispatch>; } -const UndoMirror: FC = ({ isLoading, post, setIsLoading }) => { +const UndoRepost: FC = ({ isLoading, post, setIsLoading }) => { const { currentAccount } = useAccountStore(); const { cache } = useApolloClient(); @@ -41,8 +41,8 @@ const UndoMirror: FC = ({ isLoading, post, setIsLoading }) => { const [deletePost] = useDeletePostMutation({ onCompleted: () => { - Leafwatch.track(POST.UNDO_MIRROR); - toast.success("Undone mirror"); + Leafwatch.track(POST.UNDO_REPOST); + toast.success("Undone repost"); }, update: updateCache }); @@ -83,4 +83,4 @@ const UndoMirror: FC = ({ isLoading, post, setIsLoading }) => { ); }; -export default UndoMirror; +export default UndoRepost; diff --git a/apps/web/src/components/Post/Actions/Share/index.tsx b/apps/web/src/components/Post/Actions/Share/index.tsx index 5940b3467355..a5effff6dcdc 100644 --- a/apps/web/src/components/Post/Actions/Share/index.tsx +++ b/apps/web/src/components/Post/Actions/Share/index.tsx @@ -1,6 +1,5 @@ import MenuTransition from "@components/Shared/MenuTransition"; import { Menu, MenuButton, MenuItems } from "@headlessui/react"; -import hasOptimisticallyMirrored from "@helpers/optimistic/hasOptimisticallyMirrored"; import { ArrowsRightLeftIcon } from "@heroicons/react/24/outline"; import humanize from "@hey/helpers/humanize"; import nFormatter from "@hey/helpers/nFormatter"; @@ -11,9 +10,10 @@ import { Spinner, Tooltip } from "@hey/ui"; import cn from "@hey/ui/cn"; import type { FC } from "react"; import { useState } from "react"; +import { useTransactionStore } from "src/store/persisted/useTransactionStore"; import Quote from "./Quote"; import Repost from "./Repost"; -import UndoMirror from "./UndoMirror"; +import UndoRepost from "./UndoRepost"; interface ShareMenuProps { post: AnyPost; @@ -22,11 +22,12 @@ interface ShareMenuProps { const ShareMenu: FC = ({ post, showCount }) => { const [isLoading, setIsLoading] = useState(false); + const { hasOptimisticallyReposted } = useTransactionStore(); const targetPost = isRepost(post) ? post?.repostOf : post; const hasShared = targetPost.operations?.hasReposted || targetPost.operations?.hasQuoted || - hasOptimisticallyMirrored(post.id); + hasOptimisticallyReposted(post.id); const shares = targetPost.stats.reposts + targetPost.stats.quotes; const iconClassName = "w-[15px] sm:w-[18px]"; @@ -76,7 +77,7 @@ const ShareMenu: FC = ({ post, showCount }) => { /> {targetPost.operations?.hasReposted && targetPost.id !== post.id && ( - = ({ post }) => { const enabled = useFlag(FeatureFlag.Collect); + const { hasOptimisticallyCollected } = useTransactionStore(); const [showCollectModal, setShowCollectModal] = useState(false); const postActions = post.actions.filter((action) => allowedPostActionModules.includes(action.__typename) diff --git a/apps/web/src/components/Post/OpenAction/CollectModule/CollectAction.tsx b/apps/web/src/components/Post/OpenAction/CollectModule/CollectAction.tsx index fe22363d0e58..4910d8938bc3 100644 --- a/apps/web/src/components/Post/OpenAction/CollectModule/CollectAction.tsx +++ b/apps/web/src/components/Post/OpenAction/CollectModule/CollectAction.tsx @@ -6,7 +6,6 @@ import NoBalanceError from "@components/Shared/NoBalanceError"; import errorToast from "@helpers/errorToast"; import getCurrentSession from "@helpers/getCurrentSession"; import { Leafwatch } from "@helpers/leafwatch"; -import hasOptimisticallyCollected from "@helpers/optimistic/hasOptimisticallyCollected"; import { Errors } from "@hey/data/errors"; import { POST } from "@hey/data/tracking"; import getCollectModuleData from "@hey/helpers/getCollectModuleData"; @@ -49,7 +48,8 @@ const CollectAction: FC = ({ const { id: sessionAccountId } = getCurrentSession(); const { isSuspended } = useAccountStatus(); - const { addTransaction, isFollowPending } = useTransactionStore(); + const { addTransaction, isFollowPending, hasOptimisticallyCollected } = + useTransactionStore(); const [isLoading, setIsLoading] = useState(false); const [allowed, setAllowed] = useState(true); diff --git a/apps/web/src/components/Post/PostStats.tsx b/apps/web/src/components/Post/PostStats.tsx index 13bd1e55a63c..630bb8768adb 100644 --- a/apps/web/src/components/Post/PostStats.tsx +++ b/apps/web/src/components/Post/PostStats.tsx @@ -7,6 +7,7 @@ import getPostsViews, { GET_POSTS_VIEWS_QUERY_KEY } from "@hey/helpers/getPostsViews"; import nFormatter from "@hey/helpers/nFormatter"; +import type { PostStats as IPostStats } from "@hey/indexer"; import { Modal } from "@hey/ui"; import { useQuery } from "@tanstack/react-query"; import Link from "next/link"; @@ -16,7 +17,7 @@ import { memo, useState } from "react"; interface PostStatsProps { postId: string; - postStats: IPublicationStats; + postStats: IPostStats; } const PostStats: FC = ({ postId, postStats }) => { @@ -32,13 +33,13 @@ const PostStats: FC = ({ postId, postStats }) => { }); const views = data?.[0]?.views || 0; - const { bookmarks, comments, countOpenActions, mirrors, quotes, reactions } = + const { bookmarks, comments, countOpenActions, reposts, quotes, reactions } = postStats; const showStats = comments > 0 || reactions > 0 || - mirrors > 0 || + reposts > 0 || quotes > 0 || countOpenActions > 0 || bookmarks > 0 || @@ -58,14 +59,14 @@ const PostStats: FC = ({ postId, postStats }) => { {plur("Comment", comments)} ) : null} - {mirrors > 0 ? ( + {reposts > 0 ? ( ) : null} {quotes > 0 ? ( diff --git a/apps/web/src/components/Post/Type/Commented.tsx b/apps/web/src/components/Post/Type/Commented.tsx index 6122320e6343..156b7ecfcee7 100644 --- a/apps/web/src/components/Post/Type/Commented.tsx +++ b/apps/web/src/components/Post/Type/Commented.tsx @@ -1,12 +1,13 @@ +import type { Post } from "@hey/indexer"; import type { FC } from "react"; import ThreadBody from "../ThreadBody"; interface CommentedProps { - post: Comment; + post: Post; } const Commented: FC = ({ post }) => { - const commentOn: any | Comment = post?.commentOn; + const commentOn = post.commentOn; const root = commentOn?.root; return ( diff --git a/apps/web/src/components/Post/Type/Reposted.tsx b/apps/web/src/components/Post/Type/Reposted.tsx index a79f386c30de..2efcbc022795 100644 --- a/apps/web/src/components/Post/Type/Reposted.tsx +++ b/apps/web/src/components/Post/Type/Reposted.tsx @@ -11,7 +11,7 @@ const Reposted: FC = ({ account }) => { return (
    - +
    ); }; diff --git a/apps/web/src/components/Search/Accounts.tsx b/apps/web/src/components/Search/Accounts.tsx index 53fe00b13d0e..5c088c092055 100644 --- a/apps/web/src/components/Search/Accounts.tsx +++ b/apps/web/src/components/Search/Accounts.tsx @@ -2,7 +2,12 @@ import SingleAccountsShimmer from "@components/Shared/Shimmer/SingleAccountsShim import SingleAccount from "@components/Shared/SingleAccount"; import { UsersIcon } from "@heroicons/react/24/outline"; import { AccountLinkSource } from "@hey/data/tracking"; -import type { Account } from "@hey/indexer"; +import { + type Account, + type AccountSearchRequest, + PageSize, + useSearchAccountsQuery +} from "@hey/indexer"; import { Card, EmptyState, ErrorMessage } from "@hey/ui"; import type { FC } from "react"; import { Virtuoso } from "react-virtuoso"; @@ -12,18 +17,17 @@ interface AccountsProps { } const Accounts: FC = ({ query }) => { - const request: ProfileSearchRequest = { - limit: LimitType.TwentyFive, - query, - where: { customFilters: [CustomFiltersType.Gardeners] } + const request: AccountSearchRequest = { + pageSize: PageSize.Fifty, + localName: query }; - const { data, error, fetchMore, loading } = useSearchProfilesQuery({ + const { data, error, fetchMore, loading } = useSearchAccountsQuery({ skip: !query, variables: { request } }); - const search = data?.searchProfiles; + const search = data?.searchAccounts; const accounts = search?.items; const pageInfo = search?.pageInfo; const hasMore = pageInfo?.next; diff --git a/apps/web/src/components/Settings/Export/Posts.tsx b/apps/web/src/components/Settings/Export/Posts.tsx index b7bf2f0b9a7f..0013930f3f68 100644 --- a/apps/web/src/components/Settings/Export/Posts.tsx +++ b/apps/web/src/components/Settings/Export/Posts.tsx @@ -60,7 +60,7 @@ const Posts: FC = () => { return (
    diff --git a/apps/web/src/components/Shared/Alert/DeletePost.tsx b/apps/web/src/components/Shared/Alert/DeletePost.tsx index cbc7728a6755..8fca307f7bec 100644 --- a/apps/web/src/components/Shared/Alert/DeletePost.tsx +++ b/apps/web/src/components/Shared/Alert/DeletePost.tsx @@ -1,4 +1,3 @@ -import errorToast from "@helpers/errorToast"; import { Leafwatch } from "@helpers/leafwatch"; import { Errors } from "@hey/data/errors"; import { POST } from "@hey/data/tracking"; @@ -32,13 +31,9 @@ const DeletePost: FC = () => { return toast.error(Errors.Suspended); } - try { - return await deletePost({ - variables: { request: { post: deletingPost?.id } } - }); - } catch (error) { - errorToast(error); - } + return await deletePost({ + variables: { request: { post: deletingPost?.id } } + }); }; return ( diff --git a/apps/web/src/components/Shared/Auth/Signup/ChooseHandle.tsx b/apps/web/src/components/Shared/Auth/Signup/ChooseHandle.tsx index 7017d802c67e..e65b4915cbb3 100644 --- a/apps/web/src/components/Shared/Auth/Signup/ChooseHandle.tsx +++ b/apps/web/src/components/Shared/Auth/Signup/ChooseHandle.tsx @@ -6,7 +6,6 @@ import { FaceFrownIcon, FaceSmileIcon } from "@heroicons/react/24/outline"; -import { HeyLensSignup } from "@hey/abis"; import { APP_NAME, HANDLE_PREFIX, diff --git a/apps/web/src/components/Shared/Embed/Quote.tsx b/apps/web/src/components/Shared/Embed/Quote.tsx index 594d48db5004..f6ecb73c5901 100644 --- a/apps/web/src/components/Shared/Embed/Quote.tsx +++ b/apps/web/src/components/Shared/Embed/Quote.tsx @@ -1,9 +1,10 @@ import QuotedPost from "@components/Post/QuotedPost"; +import type { NestedPost } from "@hey/indexer"; import type { FC } from "react"; import Wrapper from "./Wrapper"; interface QuoteProps { - post: PrimaryPublication; + post: NestedPost; } const Quote: FC = ({ post }) => { diff --git a/apps/web/src/components/Shared/FallbackAccountName.tsx b/apps/web/src/components/Shared/FallbackAccountName.tsx index c128c325be4f..d7d249799a93 100644 --- a/apps/web/src/components/Shared/FallbackAccountName.tsx +++ b/apps/web/src/components/Shared/FallbackAccountName.tsx @@ -20,13 +20,13 @@ const FallbackAccountName: FC = ({ return null; } - const { displayName, link, slugWithPrefix } = getAccount(account); + const { name, link, slugWithPrefix } = getAccount(account); const accountName = account?.metadata?.name || ; return ( <> = ({ children, handle }) => {
    - +
    {group.metadata?.description && ( @@ -90,7 +90,7 @@ const GroupPreview: FC = ({ children, handle }) => {
    )}
    -
    {nFormatter(club.totalMembers)}
    +
    {nFormatter(group.totalMembers)}
    Members
    diff --git a/apps/web/src/components/Shared/Modal/Members.tsx b/apps/web/src/components/Shared/Modal/Members.tsx index 1b06cf40433d..18ec2acb920d 100644 --- a/apps/web/src/components/Shared/Modal/Members.tsx +++ b/apps/web/src/components/Shared/Modal/Members.tsx @@ -15,10 +15,9 @@ import { useAccountStore } from "src/store/persisted/useAccountStore"; interface MembersProps { address: string; - slug: string; } -const Members: FC = ({ address, slug }) => { +const Members: FC = ({ address }) => { const { currentAccount } = useAccountStore(); const request: GroupMembersRequest = { @@ -51,12 +50,7 @@ const Members: FC = ({ address, slug }) => { return ( } - message={ -
    - /{slug} - doesn't have any members. -
    - } + message="Group doesn't have any members." hideCard /> ); diff --git a/apps/web/src/components/Shared/Modal/OptimisticTransactions/Transaction.tsx b/apps/web/src/components/Shared/Modal/OptimisticTransactions/Transaction.tsx index c8ab7decf767..22877dc91947 100644 --- a/apps/web/src/components/Shared/Modal/OptimisticTransactions/Transaction.tsx +++ b/apps/web/src/components/Shared/Modal/OptimisticTransactions/Transaction.tsx @@ -24,7 +24,7 @@ const Transaction: FC = ({ transaction }) => { transaction.type === OptmisticPostType.Unfollow || transaction.type === OptmisticPostType.Block || transaction.type === OptmisticPostType.Unblock || - transaction.type === OptmisticPostType.Mirror || + transaction.type === OptmisticPostType.Repost || transaction.type === OptmisticPostType.Comment || transaction.type === OptmisticPostType.Collect ? (
    diff --git a/apps/web/src/components/Shared/Modal/Reposts.tsx b/apps/web/src/components/Shared/Modal/Reposts.tsx index ace551fb3061..34d591b84e99 100644 --- a/apps/web/src/components/Shared/Modal/Reposts.tsx +++ b/apps/web/src/components/Shared/Modal/Reposts.tsx @@ -6,8 +6,8 @@ import { type Account, PageSize, PostReferenceType, - useWhoReferencedPostQuery, - type WhoReferencedPostRequest + type WhoReferencedPostRequest, + useWhoReferencedPostQuery } from "@hey/indexer"; import { EmptyState, ErrorMessage } from "@hey/ui"; import type { FC } from "react"; @@ -53,7 +53,7 @@ const Reposts: FC = ({ postId }) => {
    } - message="No mirrors." + message="No reposts." hideCard />
    @@ -65,7 +65,7 @@ const Reposts: FC = ({ postId }) => { ); } @@ -84,7 +84,7 @@ const Reposts: FC = ({ postId }) => { account={account as Account} showBio showUserPreview={false} - source={AccountLinkSource.Mirrors} + source={AccountLinkSource.Reposts} />
    )} diff --git a/apps/web/src/components/Staff/Signup/AccountsCreated.tsx b/apps/web/src/components/Staff/Signup/AccountsCreated.tsx index aaf26df79413..e67e6d3938be 100644 --- a/apps/web/src/components/Staff/Signup/AccountsCreated.tsx +++ b/apps/web/src/components/Staff/Signup/AccountsCreated.tsx @@ -1,24 +1,8 @@ -import { HeyLensSignup } from "@hey/abis"; -import { HEY_LENS_SIGNUP } from "@hey/data/constants"; import { NumberedStat } from "@hey/ui"; import type { FC } from "react"; -import { useReadContract } from "wagmi"; const AccountsCreated: FC = () => { - const { data: totalProfilesCreated } = useReadContract({ - abi: HeyLensSignup, - address: HEY_LENS_SIGNUP, - functionName: "totalProfilesCreated", - query: { refetchInterval: 2000 } - }); - - return ( - - ); + return ; }; export default AccountsCreated; diff --git a/apps/web/src/helpers/optimistic/hasOptimisticallyCollected.spec.ts b/apps/web/src/helpers/optimistic/hasOptimisticallyCollected.spec.ts deleted file mode 100644 index 5f4ba4dedc0d..000000000000 --- a/apps/web/src/helpers/optimistic/hasOptimisticallyCollected.spec.ts +++ /dev/null @@ -1,49 +0,0 @@ -import { hydrateTxnQueue } from "src/store/persisted/useTransactionStore"; -import { beforeEach, describe, expect, test, vi } from "vitest"; -import hasOptimisticallyCollected from "./hasOptimisticallyCollected"; - -// Mock transaction data -const mockTxnQueue = [ - { collectOn: "post123", txHash: "hash123" }, - { collectOn: "post456", txHash: "hash456" } -]; - -// Mock `hydrateTxnQueue` function -vi.mock("src/store/persisted/useTransactionStore", () => ({ - hydrateTxnQueue: vi.fn() -})); - -describe("hasOptimisticallyCollected", () => { - beforeEach(() => { - // Reset the mock before each test - vi.clearAllMocks(); - }); - - test("should return true when the collectOn matches a transaction", () => { - (hydrateTxnQueue as any).mockReturnValue(mockTxnQueue); - - const result = hasOptimisticallyCollected("post123"); - expect(result).toBe(true); - }); - - test("should return false when the collectOn does not match any transaction", () => { - (hydrateTxnQueue as any).mockReturnValue(mockTxnQueue); - - const result = hasOptimisticallyCollected("post789"); - expect(result).toBe(false); - }); - - test("should return false when the txnQueue is empty", () => { - (hydrateTxnQueue as any).mockReturnValue([]); - - const result = hasOptimisticallyCollected("post123"); - expect(result).toBe(false); - }); - - test("should return false when hydrateTxnQueue returns undefined", () => { - (hydrateTxnQueue as any).mockReturnValue(undefined); - - const result = hasOptimisticallyCollected("post123"); - expect(result).toBe(false); - }); -}); diff --git a/apps/web/src/helpers/optimistic/hasOptimisticallyCollected.ts b/apps/web/src/helpers/optimistic/hasOptimisticallyCollected.ts deleted file mode 100644 index d6dee260f2ce..000000000000 --- a/apps/web/src/helpers/optimistic/hasOptimisticallyCollected.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { hydrateTxnQueue } from "src/store/persisted/useTransactionStore"; - -const hasOptimisticallyCollected = (collectOn: string): boolean => { - const txnQueue = hydrateTxnQueue(); - return txnQueue?.some((txn) => txn.collectOn === collectOn) || false; -}; - -export default hasOptimisticallyCollected; diff --git a/apps/web/src/helpers/optimistic/hasOptimisticallyMirrored.spec.ts b/apps/web/src/helpers/optimistic/hasOptimisticallyMirrored.spec.ts deleted file mode 100644 index 7a22437a0576..000000000000 --- a/apps/web/src/helpers/optimistic/hasOptimisticallyMirrored.spec.ts +++ /dev/null @@ -1,49 +0,0 @@ -import { hydrateTxnQueue } from "src/store/persisted/useTransactionStore"; -import { beforeEach, describe, expect, test, vi } from "vitest"; -import hasOptimisticallyMirrored from "./hasOptimisticallyMirrored"; - -// Mock transaction data -const mockTxnQueue = [ - { mirrorOn: "post123", txHash: "hash123" }, - { mirrorOn: "post456", txHash: "hash456" } -]; - -// Mock `hydrateTxnQueue` function with `vi.fn` -vi.mock("src/store/persisted/useTransactionStore", () => ({ - hydrateTxnQueue: vi.fn() -})); - -describe("hasOptimisticallyMirrored", () => { - beforeEach(() => { - // Clear the mock implementation before each test - vi.clearAllMocks(); - }); - - test("should return true when the mirrorOn matches a transaction", () => { - (hydrateTxnQueue as any).mockReturnValue(mockTxnQueue); - - const result = hasOptimisticallyMirrored("post123"); - expect(result).toBe(true); - }); - - test("should return false when the mirrorOn does not match any transaction", () => { - (hydrateTxnQueue as any).mockReturnValue(mockTxnQueue); - - const result = hasOptimisticallyMirrored("post789"); - expect(result).toBe(false); - }); - - test("should return false when the txnQueue is empty", () => { - (hydrateTxnQueue as any).mockReturnValue([]); - - const result = hasOptimisticallyMirrored("post123"); - expect(result).toBe(false); - }); - - test("should return false when hydrateTxnQueue returns undefined", () => { - (hydrateTxnQueue as any).mockReturnValue(undefined); - - const result = hasOptimisticallyMirrored("post123"); - expect(result).toBe(false); - }); -}); diff --git a/apps/web/src/helpers/optimistic/hasOptimisticallyMirrored.ts b/apps/web/src/helpers/optimistic/hasOptimisticallyMirrored.ts deleted file mode 100644 index e75cacdfe621..000000000000 --- a/apps/web/src/helpers/optimistic/hasOptimisticallyMirrored.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { hydrateTxnQueue } from "src/store/persisted/useTransactionStore"; - -const hasOptimisticallyMirrored = (repostOf: string): boolean => { - const txnQueue = hydrateTxnQueue(); - return txnQueue?.some((txn) => txn.repostOf === repostOf) || false; -}; - -export default hasOptimisticallyMirrored; diff --git a/apps/web/src/pages/g/[slug]/members.tsx b/apps/web/src/pages/g/[address].tsx similarity index 98% rename from apps/web/src/pages/g/[slug]/members.tsx rename to apps/web/src/pages/g/[address].tsx index 4c2f1eefe680..a25128c561bd 100644 --- a/apps/web/src/pages/g/[slug]/members.tsx +++ b/apps/web/src/pages/g/[address].tsx @@ -1,4 +1,3 @@ import ViewGroup from "@components/Group"; export default ViewGroup; - diff --git a/apps/web/src/pages/g/[slug]/index.tsx b/apps/web/src/pages/g/[slug]/index.tsx deleted file mode 100644 index 7e0470a854e6..000000000000 --- a/apps/web/src/pages/g/[slug]/index.tsx +++ /dev/null @@ -1,3 +0,0 @@ -import ViewClub from "@components/Group"; - -export default ViewClub; diff --git a/apps/web/src/store/persisted/useTransactionStore.ts b/apps/web/src/store/persisted/useTransactionStore.ts index ead8c4446226..cf9abc9b5791 100644 --- a/apps/web/src/store/persisted/useTransactionStore.ts +++ b/apps/web/src/store/persisted/useTransactionStore.ts @@ -10,6 +10,8 @@ interface State { isFollowPending: (profileAddress: string) => boolean; isUnfollowPending: (profileAddress: string) => boolean; isBlockOrUnblockPending: (profileAddress: string) => boolean; + hasOptimisticallyReposted: (repostOf: string) => boolean; + hasOptimisticallyCollected: (collectOn: string) => boolean; removeTransaction: (hash: string) => void; reset: () => void; setIndexedPostHash: (hash: string) => void; @@ -31,6 +33,10 @@ const store = create( get().txnQueue.some((txn) => txn.unfollowOn === profileAddress), isBlockOrUnblockPending: (profileAddress) => get().txnQueue.some((txn) => txn.blockOrUnblockOn === profileAddress), + hasOptimisticallyReposted: (repostOf) => + get().txnQueue.some((txn) => txn.repostOf === repostOf), + hasOptimisticallyCollected: (collectOn) => + get().txnQueue.some((txn) => txn.collectOn === collectOn), removeTransaction: (hash) => set((state) => ({ txnQueue: state.txnQueue.filter((txn) => txn.txHash !== hash) diff --git a/packages/data/tracking.ts b/packages/data/tracking.ts index bf20f697da22..fbcc0c14bc64 100644 --- a/packages/data/tracking.ts +++ b/packages/data/tracking.ts @@ -62,14 +62,14 @@ export const POST = { COPY_TEXT: "Copy post text", DELETE: "Delete post", LIKE: "Like post", - MIRROR: "Mirror post", + REPOST: "Repost post", NEW_COMMENT: "New comment", NEW_POST: "New post", NEW_QUOTE: "New quote", NOT_INTERESTED: "Not interested post", OPEN_GIFS: "Open GIFs modal", OPEN_LIKES: "Open likes modal", - OPEN_MIRRORS: "Open mirrors modal", + OPEN_REPOSTS: "Open reposts modal", OPEN_COLLECTORS: "Open collectors modal", REMOVE_BOOKMARK: "Remove bookmark post", REPORT: "Report post", @@ -81,7 +81,7 @@ export const POST = { TOGGLE_HIDE_COMMENT: "Toggle post hide comment", TOGGLE_MUTED_POST: "Toggle muted post", TRANSLATE: "Translate post", - UNDO_MIRROR: "Undo mirror post", + UNDO_REPOST: "Undo repost post", UNDO_NOT_INTERESTED: "Undo not interested post", UNLIKE: "Unlike post", UNPIN: "Unpin post", @@ -245,7 +245,7 @@ export enum AccountLinkSource { Followers = "followers", Following = "following", Likes = "likes", - Mirrors = "mirrors", + Reposts = "reposts", Post = "post", Quotes = "quotes", RecentSearch = "recent-search", diff --git a/packages/indexer/documents/fragments/group/GroupFields.graphql b/packages/indexer/documents/fragments/group/GroupFields.graphql index 01f03eb29f98..2feb96270593 100644 --- a/packages/indexer/documents/fragments/group/GroupFields.graphql +++ b/packages/indexer/documents/fragments/group/GroupFields.graphql @@ -1,10 +1,12 @@ fragment GroupFields on Group { address + isMember metadata { name slug description icon + coverPicture } timestamp } diff --git a/packages/indexer/documents/queries/group/Group.graphql b/packages/indexer/documents/queries/group/Group.graphql index 12d2ef6145fd..66a175498b53 100644 --- a/packages/indexer/documents/queries/group/Group.graphql +++ b/packages/indexer/documents/queries/group/Group.graphql @@ -1,5 +1,11 @@ -query Group($request: GroupRequest!) { - group(request: $request) { +query Group( + $groupRequest: GroupRequest! + $groupStatsRequest: GroupStatsRequest! +) { + group(request: $groupRequest) { ...GroupFields } + groupStats(request: $groupStatsRequest) { + totalMembers + } } diff --git a/packages/indexer/generated.ts b/packages/indexer/generated.ts index 9d6273567e1f..0f1642a7e548 100644 --- a/packages/indexer/generated.ts +++ b/packages/indexer/generated.ts @@ -5729,7 +5729,7 @@ export type SimplePaymentFollowRuleFieldsFragment = { __typename?: 'SimplePaymen export type UsernameFieldsFragment = { __typename?: 'Username', localName: string, linkedTo?: any | null, ownedBy: any, value: any }; -export type GroupFieldsFragment = { __typename?: 'Group', address: any, timestamp: any, metadata?: { __typename?: 'GroupMetadata', name: string, slug: string, description?: string | null, icon?: any | null } | null }; +export type GroupFieldsFragment = { __typename?: 'Group', address: any, isMember?: boolean | null, timestamp: any, metadata?: { __typename?: 'GroupMetadata', name: string, slug: string, description?: string | null, icon?: any | null, coverPicture?: any | null } | null }; export type CommentNotificationFieldsFragment = { __typename?: 'CommentNotification', id: any, comment: ( { __typename?: 'Post' } @@ -6696,14 +6696,15 @@ export type AuthenticatedSessionsQuery = { __typename?: 'Query', authenticatedSe ) } }; export type GroupQueryVariables = Exact<{ - request: GroupRequest; + groupRequest: GroupRequest; + groupStatsRequest: GroupStatsRequest; }>; export type GroupQuery = { __typename?: 'Query', group?: ( { __typename?: 'Group' } & GroupFieldsFragment - ) | null }; + ) | null, groupStats: { __typename?: 'GroupStatsResponse', totalMembers: number } }; export type GroupMembersQueryVariables = Exact<{ request: GroupMembersRequest; @@ -6889,7 +6890,7 @@ export type WhoReferencedPostQuery = { __typename?: 'Query', whoReferencedPost: export const PaginatedResultInfoFieldsFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"PaginatedResultInfoFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PaginatedResultInfo"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"prev"}},{"kind":"Field","name":{"kind":"Name","value":"next"}}]}}]} as unknown as DocumentNode; export const SelfFundedTransactionRequestFieldsFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SelfFundedTransactionRequestFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"SelfFundedTransactionRequest"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"reason"}},{"kind":"Field","name":{"kind":"Name","value":"raw"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"chainId"}},{"kind":"Field","name":{"kind":"Name","value":"data"}},{"kind":"Field","name":{"kind":"Name","value":"from"}},{"kind":"Field","name":{"kind":"Name","value":"gasLimit"}},{"kind":"Field","name":{"kind":"Name","value":"maxFeePerGas"}},{"kind":"Field","name":{"kind":"Name","value":"maxPriorityFeePerGas"}},{"kind":"Field","name":{"kind":"Name","value":"nonce"}},{"kind":"Field","name":{"kind":"Name","value":"to"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"value"}}]}}]}}]} as unknown as DocumentNode; export const SponsoredTransactionRequestFieldsFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SponsoredTransactionRequestFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"SponsoredTransactionRequest"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"reason"}},{"kind":"Field","name":{"kind":"Name","value":"raw"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"chainId"}},{"kind":"Field","name":{"kind":"Name","value":"data"}},{"kind":"Field","name":{"kind":"Name","value":"from"}},{"kind":"Field","name":{"kind":"Name","value":"gasLimit"}},{"kind":"Field","name":{"kind":"Name","value":"maxFeePerGas"}},{"kind":"Field","name":{"kind":"Name","value":"maxPriorityFeePerGas"}},{"kind":"Field","name":{"kind":"Name","value":"nonce"}},{"kind":"Field","name":{"kind":"Name","value":"to"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"value"}},{"kind":"Field","name":{"kind":"Name","value":"customData"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"customSignature"}},{"kind":"Field","name":{"kind":"Name","value":"factoryDeps"}},{"kind":"Field","name":{"kind":"Name","value":"gasPerPubdata"}},{"kind":"Field","name":{"kind":"Name","value":"paymasterParams"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"paymaster"}},{"kind":"Field","name":{"kind":"Name","value":"paymasterInput"}}]}}]}}]}}]}}]} as unknown as DocumentNode; -export const GroupFieldsFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"GroupFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Group"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"address"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"slug"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"icon"}}]}},{"kind":"Field","name":{"kind":"Name","value":"timestamp"}}]}}]} as unknown as DocumentNode; +export const GroupFieldsFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"GroupFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Group"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"address"}},{"kind":"Field","name":{"kind":"Name","value":"isMember"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"slug"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"icon"}},{"kind":"Field","name":{"kind":"Name","value":"coverPicture"}}]}},{"kind":"Field","name":{"kind":"Name","value":"timestamp"}}]}}]} as unknown as DocumentNode; export const PostStatsFieldsFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"PostStatsFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PostStats"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"bookmarks"}},{"kind":"Field","name":{"kind":"Name","value":"collects"}},{"kind":"Field","name":{"kind":"Name","value":"comments"}},{"kind":"Field","name":{"kind":"Name","value":"quotes"}},{"kind":"Field","name":{"kind":"Name","value":"reactions"}},{"kind":"Field","name":{"kind":"Name","value":"reposts"}}]}}]} as unknown as DocumentNode; export const AssetFieldsFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"AssetFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Asset"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Erc20"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"contract"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"address"}},{"kind":"Field","name":{"kind":"Name","value":"chainId"}}]}},{"kind":"Field","name":{"kind":"Name","value":"decimals"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"symbol"}}]}}]}}]} as unknown as DocumentNode; export const AmountFieldsFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"AmountFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Amount"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"asset"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"AssetFields"}}]}},{"kind":"Field","name":{"kind":"Name","value":"value"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"AssetFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Asset"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Erc20"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"contract"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"address"}},{"kind":"Field","name":{"kind":"Name","value":"chainId"}}]}},{"kind":"Field","name":{"kind":"Name","value":"decimals"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"symbol"}}]}}]}}]} as unknown as DocumentNode; @@ -8455,7 +8456,7 @@ export type AuthenticatedSessionsQueryHookResult = ReturnType; export type AuthenticatedSessionsSuspenseQueryHookResult = ReturnType; export type AuthenticatedSessionsQueryResult = Apollo.QueryResult; -export const GroupDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"Group"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"request"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"GroupRequest"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"group"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"request"},"value":{"kind":"Variable","name":{"kind":"Name","value":"request"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"GroupFields"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"GroupFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Group"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"address"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"slug"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"icon"}}]}},{"kind":"Field","name":{"kind":"Name","value":"timestamp"}}]}}]} as unknown as DocumentNode; +export const GroupDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"Group"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"groupRequest"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"GroupRequest"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"groupStatsRequest"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"GroupStatsRequest"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"group"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"request"},"value":{"kind":"Variable","name":{"kind":"Name","value":"groupRequest"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"GroupFields"}}]}},{"kind":"Field","name":{"kind":"Name","value":"groupStats"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"request"},"value":{"kind":"Variable","name":{"kind":"Name","value":"groupStatsRequest"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"totalMembers"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"GroupFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Group"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"address"}},{"kind":"Field","name":{"kind":"Name","value":"isMember"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"slug"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"icon"}},{"kind":"Field","name":{"kind":"Name","value":"coverPicture"}}]}},{"kind":"Field","name":{"kind":"Name","value":"timestamp"}}]}}]} as unknown as DocumentNode; /** * __useGroupQuery__ @@ -8469,7 +8470,8 @@ export const GroupDocument = {"kind":"Document","definitions":[{"kind":"Operatio * @example * const { data, loading, error } = useGroupQuery({ * variables: { - * request: // value for 'request' + * groupRequest: // value for 'groupRequest' + * groupStatsRequest: // value for 'groupStatsRequest' * }, * }); */ @@ -8523,7 +8525,7 @@ export type GroupMembersQueryHookResult = ReturnType; export type GroupMembersSuspenseQueryHookResult = ReturnType; export type GroupMembersQueryResult = Apollo.QueryResult; -export const GroupsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"Groups"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"request"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"GroupsRequest"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"groups"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"request"},"value":{"kind":"Variable","name":{"kind":"Name","value":"request"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"GroupFields"}}]}},{"kind":"Field","name":{"kind":"Name","value":"pageInfo"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"PaginatedResultInfoFields"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"PaginatedResultInfoFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PaginatedResultInfo"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"prev"}},{"kind":"Field","name":{"kind":"Name","value":"next"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"GroupFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Group"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"address"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"slug"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"icon"}}]}},{"kind":"Field","name":{"kind":"Name","value":"timestamp"}}]}}]} as unknown as DocumentNode; +export const GroupsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"Groups"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"request"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"GroupsRequest"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"groups"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"request"},"value":{"kind":"Variable","name":{"kind":"Name","value":"request"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"GroupFields"}}]}},{"kind":"Field","name":{"kind":"Name","value":"pageInfo"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"PaginatedResultInfoFields"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"PaginatedResultInfoFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PaginatedResultInfo"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"prev"}},{"kind":"Field","name":{"kind":"Name","value":"next"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"GroupFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Group"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"address"}},{"kind":"Field","name":{"kind":"Name","value":"isMember"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"slug"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"icon"}},{"kind":"Field","name":{"kind":"Name","value":"coverPicture"}}]}},{"kind":"Field","name":{"kind":"Name","value":"timestamp"}}]}}]} as unknown as DocumentNode; /** * __useGroupsQuery__ @@ -8557,7 +8559,7 @@ export type GroupsQueryHookResult = ReturnType; export type GroupsLazyQueryHookResult = ReturnType; export type GroupsSuspenseQueryHookResult = ReturnType; export type GroupsQueryResult = Apollo.QueryResult; -export const SearchGroupsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"SearchGroups"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"request"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"SearchGroupsRequest"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"searchGroups"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"request"},"value":{"kind":"Variable","name":{"kind":"Name","value":"request"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"GroupFields"}}]}},{"kind":"Field","name":{"kind":"Name","value":"pageInfo"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"PaginatedResultInfoFields"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"PaginatedResultInfoFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PaginatedResultInfo"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"prev"}},{"kind":"Field","name":{"kind":"Name","value":"next"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"GroupFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Group"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"address"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"slug"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"icon"}}]}},{"kind":"Field","name":{"kind":"Name","value":"timestamp"}}]}}]} as unknown as DocumentNode; +export const SearchGroupsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"SearchGroups"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"request"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"SearchGroupsRequest"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"searchGroups"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"request"},"value":{"kind":"Variable","name":{"kind":"Name","value":"request"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"GroupFields"}}]}},{"kind":"Field","name":{"kind":"Name","value":"pageInfo"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"PaginatedResultInfoFields"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"PaginatedResultInfoFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PaginatedResultInfo"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"prev"}},{"kind":"Field","name":{"kind":"Name","value":"next"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"GroupFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Group"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"address"}},{"kind":"Field","name":{"kind":"Name","value":"isMember"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"slug"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"icon"}},{"kind":"Field","name":{"kind":"Name","value":"coverPicture"}}]}},{"kind":"Field","name":{"kind":"Name","value":"timestamp"}}]}}]} as unknown as DocumentNode; /** * __useSearchGroupsQuery__ diff --git a/packages/types/enums.ts b/packages/types/enums.ts index 34193624ec5b..54561ed4ff85 100644 --- a/packages/types/enums.ts +++ b/packages/types/enums.ts @@ -2,7 +2,7 @@ export enum OptmisticPostType { Collect = "Collect", Comment = "Comment", Follow = "Follow", - Mirror = "Mirror", + Repost = "Repost", Post = "Post", Quote = "Quote", Unfollow = "Unfollow",