Skip to content

Commit 7ce540c

Browse files
Fix plus menu on home screen (#8560) (#8561)
* fix plus menu on home screen * fix snapshot tests * Update index.test.tsx.snap * Update index.test.tsx.snap (cherry picked from commit 1207b0e) Co-authored-by: Elias Nahum <[email protected]>
1 parent 2499e48 commit 7ce540c

File tree

1 file changed

+3
-5
lines changed
  • app/screens/home/channel_list/categories_list/header

1 file changed

+3
-5
lines changed

app/screens/home/channel_list/categories_list/header/header.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,11 @@ import {PUSH_PROXY_STATUS_NOT_AVAILABLE, PUSH_PROXY_STATUS_VERIFIED} from '@cons
1414
import {HOME_PADDING} from '@constants/view';
1515
import {useServerDisplayName, useServerUrl} from '@context/server';
1616
import {useTheme} from '@context/theme';
17-
import {useIsTablet} from '@hooks/device';
17+
import {usePreventDoubleTap} from '@hooks/utils';
1818
import {bottomSheet} from '@screens/navigation';
1919
import {bottomSheetSnapPoint} from '@utils/helpers';
2020
import {alertPushProxyError, alertPushProxyUnknown} from '@utils/push_proxy';
2121
import {alertServerLogout} from '@utils/server';
22-
import {preventDoubleTap} from '@utils/tap';
2322
import {changeOpacity, makeStyleSheetFromTheme} from '@utils/theme';
2423
import {typography} from '@utils/typography';
2524

@@ -112,7 +111,6 @@ const ChannelListHeader = ({
112111
pushProxyStatus,
113112
}: Props) => {
114113
const theme = useTheme();
115-
const isTablet = useIsTablet();
116114
const intl = useIntl();
117115
const serverDisplayName = useServerDisplayName();
118116
const marginLeft = useSharedValue(iconPad ? 50 : 0);
@@ -125,7 +123,7 @@ const ChannelListHeader = ({
125123
marginLeft.value = iconPad ? 50 : 0;
126124
}, [iconPad]);
127125

128-
const onPress = useCallback(preventDoubleTap(() => {
126+
const onPress = usePreventDoubleTap(useCallback(() => {
129127
const renderContent = () => {
130128
return (
131129
<PlusMenu
@@ -160,7 +158,7 @@ const ChannelListHeader = ({
160158
theme,
161159
title: intl.formatMessage({id: 'home.header.plus_menu', defaultMessage: 'Options'}),
162160
});
163-
}), [intl, isTablet, theme]);
161+
}, [intl, theme, canCreateChannels, canInvitePeople, canJoinChannels]));
164162

165163
const onPushAlertPress = useCallback(() => {
166164
if (pushProxyStatus === PUSH_PROXY_STATUS_NOT_AVAILABLE) {

0 commit comments

Comments
 (0)