From 5a56557eb67ef2422b85c4ef3943fb59c8590de6 Mon Sep 17 00:00:00 2001 From: Eric Bailey Date: Thu, 27 Jun 2024 15:00:02 -0500 Subject: [PATCH] Use shared hook --- src/screens/Home/EmptyTimeline.tsx | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/src/screens/Home/EmptyTimeline.tsx b/src/screens/Home/EmptyTimeline.tsx index 90f756a706..0d84cc4ad4 100644 --- a/src/screens/Home/EmptyTimeline.tsx +++ b/src/screens/Home/EmptyTimeline.tsx @@ -1,33 +1,19 @@ import React from 'react' -import {useWindowDimensions, View} from 'react-native' +import {View} from 'react-native' import {msg, Trans} from '@lingui/macro' import {useLingui} from '@lingui/react' -import {useWebMediaQueries} from 'lib/hooks/useWebMediaQueries' import {CenteredView} from '#/view/com/util/Views' import {atoms as a} from '#/alf' import {Button, ButtonIcon, ButtonText} from '#/components/Button' import {Divider} from '#/components/Divider' import {FeedSuggestedFollowsCards} from '#/components/FeedSuggestedFollows' +import {useHeaderOffset} from '#/components/hooks/useHeaderOffset' import {IconCircle} from '#/components/IconCircle' import {ArrowRotateCounterClockwise_Stroke2_Corner0_Rounded as Refresh} from '#/components/icons/ArrowRotateCounterClockwise' import {FilterTimeline_Stroke2_Corner0_Rounded as FilterTimeline} from '#/components/icons/FilterTimeline' import {Text} from '#/components/Typography' -// TODO replace this with new shared hook -function useHeaderOffset() { - const {isDesktop, isTablet} = useWebMediaQueries() - const {fontScale} = useWindowDimensions() - if (isDesktop || isTablet) { - return 0 - } - const navBarHeight = 42 - const tabBarPad = 10 + 10 + 3 // padding + border - const normalLineHeight = 1.2 - const tabBarText = 16 * normalLineHeight * fontScale - return navBarHeight + tabBarPad + tabBarText -} - export function EmptyTimeline() { const {_} = useLingui() const offset = useHeaderOffset()