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

Function useViewSize

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

Source from the content-addressed store, hash-verified

42};
43
44const useViewSize = (size: ViewSize): boolean => {
45 const check = useMedia(
46 [viewSizeToQuery[size].replace('@media ', '')],
47 [true],
48 false,
49 false,
50 );
51
52 return useMemo(() => {
53 return reversedEvaluatedSizes.includes(size) ? !check : check;
54 }, [check, size]);
55};
56
57export const useViewSizeClient = (size: ViewSize): boolean => {
58 const check = useMediaClient(

Callers 15

GrowthBookProviderFunction · 0.90
LogoWithPlusFunction · 0.90
UpgradeToPlusFunction · 0.90
CommentFeedFunction · 0.90
MainLayoutComponentFunction · 0.90
BookmarkFeedLayoutFunction · 0.90
ScrollToTopButtonFunction · 0.90
MainFeedLayoutFunction · 0.90
GiftPlusModalComponentFunction · 0.90
PlusMarketingModalFunction · 0.90
NotificationsBellFunction · 0.90
MainLayoutHeaderFunction · 0.90

Calls 2

useMediaFunction · 0.90
replaceMethod · 0.80

Tested by

no test coverage detected