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

Function Feed

packages/shared/src/components/Feed.tsx:190–884  ·  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,
}: FeedProps<T>)

Source from the content-addressed store, hash-verified

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

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