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

Function useViewSize

packages/shared/src/hooks/useViewSize.ts:46–57  ·  view source on GitHub ↗
(size: ViewSize)

Source from the content-addressed store, hash-verified

44};
45
46const useViewSize = (size: ViewSize): boolean => {
47 const check = useMedia(
48 [viewSizeToQuery[size].replace('@media ', '')],
49 [true],
50 false,
51 false,
52 );
53
54 return useMemo(() => {
55 return reversedEvaluatedSizes.includes(size) ? !check : check;
56 }, [check, size]);
57};
58
59// The phone shell swaps markup by viewport, so the server and the first
60// client render must agree: both say "not a phone" and the answer lands

Callers 15

TagStepFrameFunction · 0.90
FeedGridFunction · 0.90
SetupScreenFunction · 0.90
FullPagePreviewFunction · 0.90
GrowthBookProviderFunction · 0.90
LogoWithPlusFunction · 0.90
PromotionalBannerViewFunction · 0.90
UpgradeToPlusFunction · 0.90
ScrollToTopButtonFunction · 0.90
MainFeedLayoutFunction · 0.90
GiftPlusModalComponentFunction · 0.90
PlusMarketingModalFunction · 0.90

Calls 2

useMediaFunction · 0.90
replaceMethod · 0.80

Tested by

no test coverage detected