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

Function Feed

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

Source from the content-addressed store, hash-verified

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

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