From 8e451b94d86b4dd1f5ca20eb67af270e035ad098 Mon Sep 17 00:00:00 2001 From: Yoginth Date: Wed, 13 Nov 2024 16:59:53 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=8D=20Rename=20publication=20to=20post?= =?UTF-8?q?=20for=20v3=20preparation=20(#pre-lens-v3)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Summary: Renamed components and helpers from "Publication" to "Post" for v3 preparation. Highlights: • Introduced `PostHeader`, `PostStats`, `QueuedPost`, and `QuotedPost` components. • Replaced `Publication` references with `Post` in components and helper functions. • Added `getPostData` and `isPostMetadataTypeAllowed` helper functions with tests. Read more: https://pierre.co/hey/hey/pre-lens-v3 --- apps/og/src/app/posts/[id]/page.tsx | 6 +-- .../helpers/getPublicationOGImages.spec.ts | 16 ++++---- apps/og/src/helpers/getPublicationOGImages.ts | 6 +-- .../components/Bookmarks/BookmarksFeed.tsx | 8 ++-- apps/web/src/components/Club/ClubFeed.tsx | 8 ++-- apps/web/src/components/Club/Shimmer.tsx | 4 +- .../src/components/Comment/CommentFeed.tsx | 12 +++--- .../components/Comment/NoneRelevantFeed.tsx | 4 +- .../components/Composer/NewPublication.tsx | 4 +- .../src/components/Explore/ExploreFeed.tsx | 8 ++-- apps/web/src/components/Home/ForYou.tsx | 12 +++--- .../src/components/Home/PaidActions/index.tsx | 4 +- .../src/components/Home/Timeline/index.tsx | 12 +++--- apps/web/src/components/List/ListFeed.tsx | 8 ++-- apps/web/src/components/List/Shimmer.tsx | 4 +- apps/web/src/components/Mod/LatestFeed.tsx | 8 ++-- .../components/Mod/ReportsFeed/Reports.tsx | 4 +- .../src/components/Mod/ReportsFeed/index.tsx | 8 ++-- apps/web/src/components/Mod/SearchFeed.tsx | 8 ++-- .../Notification/Type/ActedNotification.tsx | 4 +- .../Notification/Type/CommentNotification.tsx | 4 +- .../Notification/Type/MentionNotification.tsx | 4 +- .../Notification/Type/MirrorNotification.tsx | 4 +- .../Notification/Type/QuoteNotification.tsx | 4 +- .../Type/ReactionNotification.tsx | 4 +- .../src/components/Profile/ProfileFeed.tsx | 8 ++-- apps/web/src/components/Profile/Shimmer.tsx | 4 +- .../Publication/Actions/Menu/CopyPostText.tsx | 5 +-- .../components/Publication/Actions/index.tsx | 6 +-- ...yptedPublication.tsx => EncryptedPost.tsx} | 4 +- .../{FullPublication.tsx => FullPost.tsx} | 33 +++++++-------- .../{HiddenPublication.tsx => HiddenPost.tsx} | 8 ++-- .../src/components/Publication/Metadata.tsx | 4 +- .../{MutedPublication.tsx => MutedPost.tsx} | 6 +-- ...edPublication.tsx => NotSupportedPost.tsx} | 6 +-- .../{PublicationAvatar.tsx => PostAvatar.tsx} | 6 +-- .../{PublicationBody.tsx => PostBody.tsx} | 40 +++++++++---------- .../{PublicationHeader.tsx => PostHeader.tsx} | 6 +-- .../{PublicationStats.tsx => PostStats.tsx} | 9 ++--- .../{QueuedPublication.tsx => QueuedPost.tsx} | 6 +-- .../src/components/Publication/QuotedPost.tsx | 36 +++++++++++++++++ .../Publication/QuotedPublication.tsx | 39 ------------------ .../web/src/components/Publication/Quotes.tsx | 8 ++-- .../src/components/Publication/Shimmer.tsx | 12 +++--- .../Publication/SingleImagePublication.tsx | 6 +-- .../{SinglePublication.tsx => SinglePost.tsx} | 38 ++++++++---------- .../src/components/Publication/ThreadBody.tsx | 26 ++++++------ .../src/components/Publication/Translate.tsx | 5 +-- apps/web/src/components/Publication/index.tsx | 8 ++-- .../src/components/Search/Publications.tsx | 8 ++-- .../web/src/components/Shared/Embed/Quote.tsx | 4 +- ...PublicationWrapper.tsx => PostWrapper.tsx} | 6 +-- .../Shared/Shimmer/PaidActionsShimmer.tsx | 6 +-- ...ionListShimmer.tsx => PostListShimmer.tsx} | 8 ++-- ...PublicationShimmer.tsx => PostShimmer.tsx} | 4 +- ...blicationsShimmer.tsx => PostsShimmer.tsx} | 8 ++-- ...ibute.spec.ts => getPostAttribute.spec.ts} | 2 +- ...cationAttribute.ts => getPostAttribute.ts} | 4 +- ...cationData.spec.ts => getPostData.spec.ts} | 28 ++++++------- .../{getPublicationData.ts => getPostData.ts} | 4 +- ...c.ts => isPostMetadataTypeAllowed.spec.ts} | 22 +++++----- ...llowed.ts => isPostMetadataTypeAllowed.ts} | 4 +- 62 files changed, 292 insertions(+), 313 deletions(-) rename apps/web/src/components/Publication/{EncryptedPublication.tsx => EncryptedPost.tsx} (86%) rename apps/web/src/components/Publication/{FullPublication.tsx => FullPost.tsx} (83%) rename apps/web/src/components/Publication/{HiddenPublication.tsx => HiddenPost.tsx} (65%) rename apps/web/src/components/Publication/{MutedPublication.tsx => MutedPost.tsx} (89%) rename apps/web/src/components/Publication/{NotSupportedPublication.tsx => NotSupportedPost.tsx} (78%) rename apps/web/src/components/Publication/{PublicationAvatar.tsx => PostAvatar.tsx} (92%) rename apps/web/src/components/Publication/{PublicationBody.tsx => PostBody.tsx} (79%) rename apps/web/src/components/Publication/{PublicationHeader.tsx => PostHeader.tsx} (93%) rename apps/web/src/components/Publication/{PublicationStats.tsx => PostStats.tsx} (96%) rename apps/web/src/components/Publication/{QueuedPublication.tsx => QueuedPost.tsx} (94%) create mode 100644 apps/web/src/components/Publication/QuotedPost.tsx delete mode 100644 apps/web/src/components/Publication/QuotedPublication.tsx rename apps/web/src/components/Publication/{SinglePublication.tsx => SinglePost.tsx} (62%) rename apps/web/src/components/Shared/{PublicationWrapper.tsx => PostWrapper.tsx} (87%) rename apps/web/src/components/Shared/Shimmer/{PublicationListShimmer.tsx => PostListShimmer.tsx} (71%) rename apps/web/src/components/Shared/Shimmer/{PublicationShimmer.tsx => PostShimmer.tsx} (94%) rename apps/web/src/components/Shared/Shimmer/{PublicationsShimmer.tsx => PostsShimmer.tsx} (55%) rename packages/helpers/{getPublicationAttribute.spec.ts => getPostAttribute.spec.ts} (95%) rename packages/helpers/{getPublicationAttribute.ts => getPostAttribute.ts} (87%) rename packages/helpers/{getPublicationData.spec.ts => getPostData.spec.ts} (87%) rename packages/helpers/{getPublicationData.ts => getPostData.ts} (97%) rename packages/helpers/{isPublicationMetadataTypeAllowed.spec.ts => isPostMetadataTypeAllowed.spec.ts} (56%) rename packages/helpers/{isPublicationMetadataTypeAllowed.ts => isPostMetadataTypeAllowed.ts} (71%) diff --git a/apps/og/src/app/posts/[id]/page.tsx b/apps/og/src/app/posts/[id]/page.tsx index 60a17058d33e..3085aa2dd86c 100644 --- a/apps/og/src/app/posts/[id]/page.tsx +++ b/apps/og/src/app/posts/[id]/page.tsx @@ -1,8 +1,8 @@ import getCollectModuleMetadata from "@helpers/getCollectModuleMetadata"; import getPublicationOGImages from "@helpers/getPublicationOGImages"; import { APP_NAME } from "@hey/data/constants"; +import getPostData from "@hey/helpers/getPostData"; import getProfile from "@hey/helpers/getProfile"; -import getPublicationData from "@hey/helpers/getPublicationData"; import logger from "@hey/helpers/logger"; import { isMirrorPublication } from "@hey/helpers/publicationHelpers"; import type { AnyPublication } from "@hey/lens"; @@ -43,8 +43,8 @@ export const generateMetadata = async ({ ? publication.mirrorOn : publication; const { by: profile, metadata } = targetPublication; - const filteredContent = getPublicationData(metadata)?.content || ""; - const filteredAsset = getPublicationData(metadata)?.asset; + const filteredContent = getPostData(metadata)?.content || ""; + const filteredAsset = getPostData(metadata)?.asset; const assetIsAudio = filteredAsset?.type === "Audio"; const { displayName, link, slugWithPrefix } = getProfile(profile); diff --git a/apps/og/src/helpers/getPublicationOGImages.spec.ts b/apps/og/src/helpers/getPublicationOGImages.spec.ts index 51d1bd289d87..add3f91ca0cc 100644 --- a/apps/og/src/helpers/getPublicationOGImages.spec.ts +++ b/apps/og/src/helpers/getPublicationOGImages.spec.ts @@ -1,8 +1,8 @@ -import getPublicationData from "@hey/helpers/getPublicationData"; +import getPostData from "@hey/helpers/getPostData"; import { beforeEach, describe, expect, test, vi } from "vitest"; import getPublicationOGImages from "./getPublicationOGImages"; -vi.mock("@hey/helpers/getPublicationData", () => ({ +vi.mock("@hey/helpers/getPostData", () => ({ default: vi.fn() })); @@ -21,7 +21,7 @@ describe("getPublicationOGImages", () => { asset: { type: "Image", uri: "https://example.com/asset-image.jpg" } }; - (getPublicationData as any).mockReturnValue(mockPublicationData); + (getPostData as any).mockReturnValue(mockPublicationData); const result = getPublicationOGImages(mockMetadata); expect(result).toEqual([ @@ -37,7 +37,7 @@ describe("getPublicationOGImages", () => { asset: { type: "Image", uri: "https://example.com/asset-image.jpg" } }; - (getPublicationData as any).mockReturnValue(mockPublicationData); + (getPostData as any).mockReturnValue(mockPublicationData); const result = getPublicationOGImages(mockMetadata); expect(result).toEqual(["https://example.com/asset-image.jpg"]); @@ -50,7 +50,7 @@ describe("getPublicationOGImages", () => { asset: { type: "Video", cover: "https://example.com/video-cover.jpg" } }; - (getPublicationData as any).mockReturnValue(mockPublicationData); + (getPostData as any).mockReturnValue(mockPublicationData); const result = getPublicationOGImages(mockMetadata); expect(result).toEqual(["https://example.com/video-cover.jpg"]); @@ -63,7 +63,7 @@ describe("getPublicationOGImages", () => { asset: { type: "Audio", cover: "https://example.com/audio-cover.jpg" } }; - (getPublicationData as any).mockReturnValue(mockPublicationData); + (getPostData as any).mockReturnValue(mockPublicationData); const result = getPublicationOGImages(mockMetadata); expect(result).toEqual(["https://example.com/audio-cover.jpg"]); @@ -79,7 +79,7 @@ describe("getPublicationOGImages", () => { asset: { type: "Video", cover: "https://example.com/video-cover.jpg" } }; - (getPublicationData as any).mockReturnValue(mockPublicationData); + (getPostData as any).mockReturnValue(mockPublicationData); const result = getPublicationOGImages(mockMetadata); expect(result).toEqual([ @@ -91,7 +91,7 @@ describe("getPublicationOGImages", () => { test("should return empty array if no valid data is present", () => { const mockMetadata = { __typename: "TextOnlyMetadata" } as any; - (getPublicationData as any).mockReturnValue({ attachments: [], asset: {} }); + (getPostData as any).mockReturnValue({ attachments: [], asset: {} }); const result = getPublicationOGImages(mockMetadata); expect(result).toEqual([]); diff --git a/apps/og/src/helpers/getPublicationOGImages.ts b/apps/og/src/helpers/getPublicationOGImages.ts index 03c074340eed..c8494e43514f 100644 --- a/apps/og/src/helpers/getPublicationOGImages.ts +++ b/apps/og/src/helpers/getPublicationOGImages.ts @@ -1,9 +1,9 @@ -import getPublicationData from "@hey/helpers/getPublicationData"; +import getPostData from "@hey/helpers/getPostData"; import type { PublicationMetadata } from "@hey/lens"; const getPublicationOGImages = (metadata: PublicationMetadata) => { - const filteredAttachments = getPublicationData(metadata)?.attachments || []; - const filteredAsset = getPublicationData(metadata)?.asset; + const filteredAttachments = getPostData(metadata)?.attachments || []; + const filteredAsset = getPostData(metadata)?.asset; const assetIsImage = filteredAsset?.type === "Image"; const assetIsVideo = filteredAsset?.type === "Video"; diff --git a/apps/web/src/components/Bookmarks/BookmarksFeed.tsx b/apps/web/src/components/Bookmarks/BookmarksFeed.tsx index bd0944a42095..d242ee265162 100644 --- a/apps/web/src/components/Bookmarks/BookmarksFeed.tsx +++ b/apps/web/src/components/Bookmarks/BookmarksFeed.tsx @@ -1,5 +1,5 @@ -import SinglePublication from "@components/Publication/SinglePublication"; -import PublicationsShimmer from "@components/Shared/Shimmer/PublicationsShimmer"; +import SinglePost from "@components/Publication/SinglePost"; +import PostsShimmer from "@components/Shared/Shimmer/PostsShimmer"; import { BookmarkIcon } from "@heroicons/react/24/outline"; import type { AnyPublication, @@ -70,7 +70,7 @@ const BookmarksFeed: FC = ({ focus }) => { }; if (loading) { - return ; + return ; } if (publications?.length === 0) { @@ -95,7 +95,7 @@ const BookmarksFeed: FC = ({ focus }) => { endReached={onEndReached} isScrolling={onScrolling} itemContent={(index, publication) => ( - = ({ handle }) => { }; if (loading) { - return ; + return ; } if (publications?.length === 0) { @@ -101,7 +101,7 @@ const ClubFeed: FC = ({ handle }) => { endReached={onEndReached} isScrolling={onScrolling} itemContent={(index, publication) => ( - = ({ profileList = false }) => { ) : ( - + )} diff --git a/apps/web/src/components/Comment/CommentFeed.tsx b/apps/web/src/components/Comment/CommentFeed.tsx index 77960cecb12f..555842bf006c 100644 --- a/apps/web/src/components/Comment/CommentFeed.tsx +++ b/apps/web/src/components/Comment/CommentFeed.tsx @@ -1,7 +1,7 @@ import { useHiddenCommentFeedStore } from "@components/Publication"; -import QueuedPublication from "@components/Publication/QueuedPublication"; -import SinglePublication from "@components/Publication/SinglePublication"; -import PublicationsShimmer from "@components/Shared/Shimmer/PublicationsShimmer"; +import QueuedPost from "@components/Publication/QueuedPost"; +import SinglePost from "@components/Publication/SinglePost"; +import PostsShimmer from "@components/Shared/Shimmer/PostsShimmer"; import { ChatBubbleLeftIcon } from "@heroicons/react/24/outline"; import type { Comment, PublicationsRequest } from "@hey/lens"; import { @@ -81,7 +81,7 @@ const CommentFeed: FC = ({ publicationId }) => { }; if (loading) { - return ; + return ; } if (error) { @@ -100,7 +100,7 @@ const CommentFeed: FC = ({ publicationId }) => { return ( <> {queuedComments.map((txn) => ( - + ))} = ({ publicationId }) => { const isLast = index === comments.length - 1; return ( - = ({ publicationId }) => { const isLast = index === comments.length - 1; return ( - = ({ {quotedPublication ? ( - diff --git a/apps/web/src/components/Explore/ExploreFeed.tsx b/apps/web/src/components/Explore/ExploreFeed.tsx index 3469dc49e014..f9490bbe3d77 100644 --- a/apps/web/src/components/Explore/ExploreFeed.tsx +++ b/apps/web/src/components/Explore/ExploreFeed.tsx @@ -1,5 +1,5 @@ -import SinglePublication from "@components/Publication/SinglePublication"; -import PublicationsShimmer from "@components/Shared/Shimmer/PublicationsShimmer"; +import SinglePost from "@components/Publication/SinglePost"; +import PostsShimmer from "@components/Shared/Shimmer/PostsShimmer"; import { ChatBubbleBottomCenterIcon } from "@heroicons/react/24/outline"; import type { AnyPublication, @@ -77,7 +77,7 @@ const ExploreFeed: FC = ({ }; if (loading) { - return ; + return ; } if (publications?.length === 0) { @@ -102,7 +102,7 @@ const ExploreFeed: FC = ({ endReached={onEndReached} isScrolling={onScrolling} itemContent={(index, publication) => ( - { }; if (loading) { - return ; + return ; } if (publications?.length === 0) { @@ -69,7 +69,7 @@ const ForYou: FC = () => { <> {txnQueue.map((txn) => txn?.type === OptmisticPublicationType.Post ? ( - + ) : null )} @@ -79,7 +79,7 @@ const ForYou: FC = () => { data={publications} endReached={onEndReached} itemContent={(index, item) => ( - { publication={action.actedOn as AnyPublication} />
- { }; if (loading) { - return ; + return ; } if (feed?.length === 0) { @@ -98,7 +98,7 @@ const Timeline: FC = () => { <> {txnQueue.map((txn) => txn?.type !== OptmisticPublicationType.Comment ? ( - + ) : null )} @@ -109,7 +109,7 @@ const Timeline: FC = () => { endReached={onEndReached} isScrolling={onScrolling} itemContent={(index, feedItem) => ( - = ({ list, showHeader = false }) => { }; if (loadingPublicationIds || publicationsLoading) { - return ; + return ; } const Header = () => { @@ -141,7 +141,7 @@ const ListFeed: FC = ({ list, showHeader = false }) => { data={publications} isScrolling={onScrolling} itemContent={(index, publication) => ( - = ({ profileList = false }) => { ) : ( - + )} diff --git a/apps/web/src/components/Mod/LatestFeed.tsx b/apps/web/src/components/Mod/LatestFeed.tsx index 5520a3062661..4c7ddccce658 100644 --- a/apps/web/src/components/Mod/LatestFeed.tsx +++ b/apps/web/src/components/Mod/LatestFeed.tsx @@ -1,6 +1,6 @@ import HigherActions from "@components/Publication/Actions/HigherActions"; -import SinglePublication from "@components/Publication/SinglePublication"; -import PublicationsShimmer from "@components/Shared/Shimmer/PublicationsShimmer"; +import SinglePost from "@components/Publication/SinglePost"; +import PostsShimmer from "@components/Shared/Shimmer/PostsShimmer"; import { ChatBubbleBottomCenterIcon } from "@heroicons/react/24/outline"; import { IS_MAINNET } from "@hey/data/constants"; import type { @@ -65,7 +65,7 @@ const LatestFeed: FC = () => { }; if (loading) { - return ; + return ; } if (publications?.length === 0) { @@ -95,7 +95,7 @@ const LatestFeed: FC = () => { endReached={onEndReached} itemContent={(_, publication) => ( - = ({ profileId, publicationId }) => { endReached={onEndReached} itemContent={(_, report) => ( - { }; if (loading) { - return ; + return ; } if (reports?.length === 0) { @@ -61,7 +61,7 @@ const ReportsFeed: FC = () => { return ( - { {loading ? ( - + ) : !query || publications?.length === 0 ? ( } @@ -104,7 +104,7 @@ const SearchFeed: FC = () => { return ( - = ({ notification }) => { ? publication.mirrorOn : publication; const { metadata } = targetPublication; - const filteredContent = getPublicationData(metadata)?.content || ""; + const filteredContent = getPostData(metadata)?.content || ""; const actions = notification?.actions; const firstProfile = actions?.[0]?.by; const length = actions.length - 1; diff --git a/apps/web/src/components/Notification/Type/CommentNotification.tsx b/apps/web/src/components/Notification/Type/CommentNotification.tsx index 21a594500325..ab4f6a247891 100644 --- a/apps/web/src/components/Notification/Type/CommentNotification.tsx +++ b/apps/web/src/components/Notification/Type/CommentNotification.tsx @@ -1,6 +1,6 @@ import Markup from "@components/Shared/Markup"; import { ChatBubbleLeftIcon } from "@heroicons/react/24/outline"; -import getPublicationData from "@hey/helpers/getPublicationData"; +import getPostData from "@hey/helpers/getPostData"; import type { CommentNotification as TCommentNotification } from "@hey/lens"; import Link from "next/link"; import type { FC } from "react"; @@ -16,7 +16,7 @@ const CommentNotification: FC = ({ notification }) => { const metadata = notification?.comment.metadata; - const filteredContent = getPublicationData(metadata)?.content || ""; + const filteredContent = getPostData(metadata)?.content || ""; const firstProfile = notification.comment.by; const text = "commented on your"; diff --git a/apps/web/src/components/Notification/Type/MentionNotification.tsx b/apps/web/src/components/Notification/Type/MentionNotification.tsx index ebe25c17fdf5..601ad22ba926 100644 --- a/apps/web/src/components/Notification/Type/MentionNotification.tsx +++ b/apps/web/src/components/Notification/Type/MentionNotification.tsx @@ -1,6 +1,6 @@ import Markup from "@components/Shared/Markup"; import { AtSymbolIcon } from "@heroicons/react/24/outline"; -import getPublicationData from "@hey/helpers/getPublicationData"; +import getPostData from "@hey/helpers/getPostData"; import type { MentionNotification as TMirrorNotification } from "@hey/lens"; import Link from "next/link"; import type { FC } from "react"; @@ -16,7 +16,7 @@ const MentionNotification: FC = ({ notification }) => { const metadata = notification?.publication.metadata; - const filteredContent = getPublicationData(metadata)?.content || ""; + const filteredContent = getPostData(metadata)?.content || ""; const firstProfile = notification.publication.by; const text = "mentioned you in a"; diff --git a/apps/web/src/components/Notification/Type/MirrorNotification.tsx b/apps/web/src/components/Notification/Type/MirrorNotification.tsx index 90d1f36500ab..a05fbd832867 100644 --- a/apps/web/src/components/Notification/Type/MirrorNotification.tsx +++ b/apps/web/src/components/Notification/Type/MirrorNotification.tsx @@ -1,6 +1,6 @@ import Markup from "@components/Shared/Markup"; import { ArrowsRightLeftIcon } from "@heroicons/react/24/solid"; -import getPublicationData from "@hey/helpers/getPublicationData"; +import getPostData from "@hey/helpers/getPostData"; import type { MirrorNotification as TMirrorNotification } from "@hey/lens"; import Link from "next/link"; import plur from "plur"; @@ -15,7 +15,7 @@ interface MirrorNotificationProps { const MirrorNotification: FC = ({ notification }) => { const metadata = notification?.publication.metadata; - const filteredContent = getPublicationData(metadata)?.content || ""; + const filteredContent = getPostData(metadata)?.content || ""; const mirrors = notification?.mirrors; const firstProfile = mirrors?.[0]?.profile; const length = mirrors.length - 1; diff --git a/apps/web/src/components/Notification/Type/QuoteNotification.tsx b/apps/web/src/components/Notification/Type/QuoteNotification.tsx index 952eb63a0479..a49f0538190c 100644 --- a/apps/web/src/components/Notification/Type/QuoteNotification.tsx +++ b/apps/web/src/components/Notification/Type/QuoteNotification.tsx @@ -1,6 +1,6 @@ import Markup from "@components/Shared/Markup"; import { ChatBubbleBottomCenterTextIcon } from "@heroicons/react/24/outline"; -import getPublicationData from "@hey/helpers/getPublicationData"; +import getPostData from "@hey/helpers/getPostData"; import type { QuoteNotification as TQuoteNotification } from "@hey/lens"; import Link from "next/link"; import type { FC } from "react"; @@ -14,7 +14,7 @@ interface QuoteNotificationProps { const QuoteNotification: FC = ({ notification }) => { const metadata = notification?.quote.metadata; - const filteredContent = getPublicationData(metadata)?.content || ""; + const filteredContent = getPostData(metadata)?.content || ""; const firstProfile = notification.quote.by; const text = "quoted your"; diff --git a/apps/web/src/components/Notification/Type/ReactionNotification.tsx b/apps/web/src/components/Notification/Type/ReactionNotification.tsx index 457183d02439..456d5f75009b 100644 --- a/apps/web/src/components/Notification/Type/ReactionNotification.tsx +++ b/apps/web/src/components/Notification/Type/ReactionNotification.tsx @@ -1,6 +1,6 @@ import Markup from "@components/Shared/Markup"; import { HeartIcon } from "@heroicons/react/24/outline"; -import getPublicationData from "@hey/helpers/getPublicationData"; +import getPostData from "@hey/helpers/getPostData"; import type { ReactionNotification as TReactionNotification } from "@hey/lens"; import Link from "next/link"; import plur from "plur"; @@ -17,7 +17,7 @@ const ReactionNotification: FC = ({ notification }) => { const metadata = notification?.publication.metadata; - const filteredContent = getPublicationData(metadata)?.content || ""; + const filteredContent = getPostData(metadata)?.content || ""; const reactions = notification?.reactions; const firstProfile = reactions?.[0]?.profile; const length = reactions.length - 1; diff --git a/apps/web/src/components/Profile/ProfileFeed.tsx b/apps/web/src/components/Profile/ProfileFeed.tsx index 8f42eba99263..843699462c34 100644 --- a/apps/web/src/components/Profile/ProfileFeed.tsx +++ b/apps/web/src/components/Profile/ProfileFeed.tsx @@ -1,5 +1,5 @@ -import SinglePublication from "@components/Publication/SinglePublication"; -import PublicationsShimmer from "@components/Shared/Shimmer/PublicationsShimmer"; +import SinglePost from "@components/Publication/SinglePost"; +import PostsShimmer from "@components/Shared/Shimmer/PostsShimmer"; import { ChatBubbleBottomCenterIcon } from "@heroicons/react/24/outline"; import { ProfileFeedType } from "@hey/data/enums"; import type { AnyPublication, PublicationsRequest } from "@hey/lens"; @@ -141,7 +141,7 @@ const ProfileFeed: FC = ({ }; if (loading || profileDetailsLoading) { - return ; + return ; } if (publications?.length === 0) { @@ -182,7 +182,7 @@ const ProfileFeed: FC = ({ endReached={onEndReached} isScrolling={onScrolling} itemContent={(index, publication) => ( - { /> ))}
- + diff --git a/apps/web/src/components/Publication/Actions/Menu/CopyPostText.tsx b/apps/web/src/components/Publication/Actions/Menu/CopyPostText.tsx index cccf8e365bcc..ef4a47492d8b 100644 --- a/apps/web/src/components/Publication/Actions/Menu/CopyPostText.tsx +++ b/apps/web/src/components/Publication/Actions/Menu/CopyPostText.tsx @@ -2,7 +2,7 @@ import { MenuItem } from "@headlessui/react"; import { Leafwatch } from "@helpers/leafwatch"; import { ClipboardDocumentIcon } from "@heroicons/react/24/outline"; import { PUBLICATION } from "@hey/data/tracking"; -import getPublicationData from "@hey/helpers/getPublicationData"; +import getPostData from "@hey/helpers/getPostData"; import stopEventPropagation from "@hey/helpers/stopEventPropagation"; import type { MirrorablePublication } from "@hey/lens"; import cn from "@hey/ui/cn"; @@ -15,8 +15,7 @@ interface CopyPostTextProps { const CopyPostText: FC = ({ publication }) => { const publicationType = publication.__typename; - const filteredContent = - getPublicationData(publication.metadata)?.content || ""; + const filteredContent = getPostData(publication.metadata)?.content || ""; return ( = ({ +const PostActions: FC = ({ publication, showCount = false }) => { @@ -63,4 +63,4 @@ const PublicationActions: FC = ({ ); }; -export default memo(PublicationActions); +export default memo(PostActions); diff --git a/apps/web/src/components/Publication/EncryptedPublication.tsx b/apps/web/src/components/Publication/EncryptedPost.tsx similarity index 86% rename from apps/web/src/components/Publication/EncryptedPublication.tsx rename to apps/web/src/components/Publication/EncryptedPost.tsx index e585b42ea55c..e2124c9a903b 100644 --- a/apps/web/src/components/Publication/EncryptedPublication.tsx +++ b/apps/web/src/components/Publication/EncryptedPost.tsx @@ -3,7 +3,7 @@ import { APP_NAME } from "@hey/data/constants"; import { Card } from "@hey/ui"; import type { FC } from "react"; -const EncryptedPublication: FC = () => { +const EncryptedPost: FC = () => { return (
@@ -14,4 +14,4 @@ const EncryptedPublication: FC = () => { ); }; -export default EncryptedPublication; +export default EncryptedPost; diff --git a/apps/web/src/components/Publication/FullPublication.tsx b/apps/web/src/components/Publication/FullPost.tsx similarity index 83% rename from apps/web/src/components/Publication/FullPublication.tsx rename to apps/web/src/components/Publication/FullPost.tsx index 0db3290adda6..fe84c0e31498 100644 --- a/apps/web/src/components/Publication/FullPublication.tsx +++ b/apps/web/src/components/Publication/FullPost.tsx @@ -14,24 +14,21 @@ import { useFlag } from "@unleash/proxy-client-react"; import type { FC } from "react"; import usePushToImpressions from "src/hooks/usePushToImpressions"; import { useHiddenCommentFeedStore } from "."; -import PublicationActions from "./Actions"; -import HiddenPublication from "./HiddenPublication"; -import PublicationAvatar from "./PublicationAvatar"; -import PublicationBody from "./PublicationBody"; -import PublicationHeader from "./PublicationHeader"; -import PublicationStats from "./PublicationStats"; +import PostActions from "./Actions"; +import HiddenPost from "./HiddenPost"; +import PostAvatar from "./PostAvatar"; +import PostBody from "./PostBody"; +import PostHeader from "./PostHeader"; +import PostStats from "./PostStats"; import Translate from "./Translate"; import PublicationType from "./Type"; -interface FullPublicationProps { +interface FullPostProps { hasHiddenComments: boolean; publication: AnyPublication; } -const FullPublication: FC = ({ - hasHiddenComments, - publication -}) => { +const FullPost: FC = ({ hasHiddenComments, publication }) => { const { setShowHiddenComments, showHiddenComments } = useHiddenCommentFeedStore(); const isStaff = useFlag(FeatureFlag.Staff); @@ -66,14 +63,14 @@ const FullPublication: FC = ({
- +
- + {targetPublication.isHidden ? ( - + ) : ( <> - @@ -84,13 +81,13 @@ const FullPublication: FC = ({ · Posted via {getAppName(publishedOn.id)} ) : null}
-
- + {hasHiddenComments ? (