MCPcopy Create free account
hub / github.com/dailydotdev/apps / Feed

Function Feed

packages/shared/src/components/Feed.tsx:198–908  ·  view source on GitHub ↗
({
  feedName,
  feedQueryKey,
  query,
  variables,
  className,
  header,
  inlineHeader,
  onEmptyFeed,
  emptyScreen,
  options,
  allowPin,
  showSearch = true,
  shortcuts,
  actionButtons,
  disableAds,
  staticAd,
  disableAdRefresh = false,
  allowFetchMore,
  pageSize,
  isHorizontal = false,
  feedContainerRef,
  disableListFrame = false,
  excludePinnedPosts = false,
  hideSource = false,
  hideTags = false,
  topContent: topContentProp,
  searchId,
  searchVersion,
}: FeedProps<T>)

Source from the content-addressed store, hash-verified

196 };
197
198export default function Feed<T>({
199 feedName,
200 feedQueryKey,
201 query,
202 variables,
203 className,
204 header,
205 inlineHeader,
206 onEmptyFeed,
207 emptyScreen,
208 options,
209 allowPin,
210 showSearch = true,
211 shortcuts,
212 actionButtons,
213 disableAds,
214 staticAd,
215 disableAdRefresh = false,
216 allowFetchMore,
217 pageSize,
218 isHorizontal = false,
219 feedContainerRef,
220 disableListFrame = false,
221 excludePinnedPosts = false,
222 hideSource = false,
223 hideTags = false,
224 topContent: topContentProp,
225 searchId,
226 searchVersion,
227}: FeedProps<T>): ReactElement {
228 const origin = Origin.Feed;
229 const { logEvent } = useLogContext();
230 const currentSettings = useContext(FeedContext);
231 const { user } = useContext(AuthContext);
232 const { isFallback, query: routerQuery } = useRouter();
233 const { openNewTab, loadedSettings } = useContext(SettingsContext);
234 const { isListMode, shouldUseListFeedLayout } = useFeedLayout();
235 const numCards = currentSettings.numCards.eco;
236 const isSquadFeed = feedName === OtherFeedPage.Squad;
237 const trackedFeedFinish = useRef(false);
238 const isMyFeed = feedName === SharedFeedPage.MyFeed;
239 const showAcquisitionForm =
240 isMyFeed &&
241 (routerQuery?.[acquisitionKey] as string)?.toLocaleLowerCase() === 'true' &&
242 !user?.acquisitionChannel;
243 const { getMarketingCta } = useBoot();
244 const { isActionsFetched, checkHasCompleted } = useActions();
245 const marketingCta =
246 getMarketingCta(MarketingCtaVariant.Card) ||
247 getMarketingCta(MarketingCtaVariant.BriefCard) ||
248 getMarketingCta(MarketingCtaVariant.YearInReview) ||
249 getMarketingCta(MarketingCtaVariant.Video);
250 const { plusEntryFeed } = usePlusEntry();
251 const hasDismissBriefCta =
252 isActionsFetched && checkHasCompleted(ActionType.DisableBriefCardCta);
253 const showMarketingCta =
254 !!marketingCta &&
255 (marketingCta?.variant !== MarketingCtaVariant.BriefCard ||

Callers

nothing calls this directly

Calls 15

useLogContextFunction · 0.90
useFeedLayoutFunction · 0.90
useBootFunction · 0.90
useActionsFunction · 0.90
useSearchResultsLayoutFunction · 0.90
useProfileCompletionCardFunction · 0.90
useConditionalFeatureFunction · 0.90
useHasIntroQuestsFunction · 0.90
useQuestDashboardFunction · 0.90
useUpdateQueryFunction · 0.90
getProductsQueryOptionsFunction · 0.90
useLayoutVariantFunction · 0.90

Tested by

no test coverage detected