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

Function Feed

packages/shared/src/components/Feed.tsx:182–846  ·  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

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