From f20eb313375251487189169f30b2c2ec0590c274 Mon Sep 17 00:00:00 2001 From: Eric Bailey Date: Thu, 16 Jan 2025 19:03:16 -0600 Subject: [PATCH] Replace types --- src/components/VideoPostCard.tsx | 16 ++-------------- src/components/feeds/PostFeedVideoGridRow.tsx | 4 ++-- src/lib/routes/types.ts | 2 +- 3 files changed, 5 insertions(+), 17 deletions(-) diff --git a/src/components/VideoPostCard.tsx b/src/components/VideoPostCard.tsx index 97633dc13e..cc4d3124cd 100644 --- a/src/components/VideoPostCard.tsx +++ b/src/components/VideoPostCard.tsx @@ -6,9 +6,9 @@ import {msg} from '@lingui/macro' import {useLingui} from '@lingui/react' import {sanitizeHandle} from '#/lib/strings/handles' -import {AuthorFilter} from '#/state/queries/post-feed' import {formatCount} from '#/view/com/util/numeric/format' import {PreviewableUserAvatar} from '#/view/com/util/UserAvatar' +import {VideoFeedSourceContext} from '#/screens/VideoFeed/types' import {atoms as a, useTheme} from '#/alf' import {BLUE_HUE} from '#/alf/util/colorGeneration' import {select} from '#/alf/util/themeSelector' @@ -19,24 +19,12 @@ import {Link} from '#/components/Link' import {MediaInsetBorder} from '#/components/MediaInsetBorder' import {Text} from '#/components/Typography' -/** - * Kind of like `FeedDescriptor` but not - */ -export type SourceContext = - | {type: 'feedgen'; uri: string; initialPostUri?: string} - | { - type: 'author' - did: string - filter: AuthorFilter - initialPostUri?: string - } - export function VideoPostCard({ post, sourceContext, }: { post: AppBskyFeedDefs.PostView - sourceContext: SourceContext + sourceContext: VideoFeedSourceContext }) { const t = useTheme() const {_, i18n} = useLingui() diff --git a/src/components/feeds/PostFeedVideoGridRow.tsx b/src/components/feeds/PostFeedVideoGridRow.tsx index d9e2833dfa..d708dc95bf 100644 --- a/src/components/feeds/PostFeedVideoGridRow.tsx +++ b/src/components/feeds/PostFeedVideoGridRow.tsx @@ -2,9 +2,9 @@ import {View} from 'react-native' import {AppBskyEmbedVideo} from '@atproto/api' import {FeedPostSliceItem} from '#/state/queries/post-feed' +import {VideoFeedSourceContext} from '#/screens/VideoFeed/types' import {atoms as a, useGutters} from '#/alf' import { - SourceContext, VideoPostCard, VideoPostCardPlaceholder, } from '#/components/VideoPostCard' @@ -14,7 +14,7 @@ export function PostFeedVideoGridRow({ sourceContext, }: { slices: FeedPostSliceItem[] - sourceContext: SourceContext + sourceContext: VideoFeedSourceContext }) { const gutters = useGutters(['base', 'base', 0, 'base']) const posts = slices diff --git a/src/lib/routes/types.ts b/src/lib/routes/types.ts index 954eb30bef..fbade8223d 100644 --- a/src/lib/routes/types.ts +++ b/src/lib/routes/types.ts @@ -1,7 +1,7 @@ import {NavigationState, PartialState} from '@react-navigation/native' import type {NativeStackNavigationProp} from '@react-navigation/native-stack' -import {SourceContext as VideoFeedSourceContext} from '#/components/VideoPostCard' +import {VideoFeedSourceContext} from '#/screens/VideoFeed/types' export type {NativeStackScreenProps} from '@react-navigation/native-stack'