From e5ef9c1ef297b9d4af354e3e52715ae5bca01b6b Mon Sep 17 00:00:00 2001 From: Gabriel Henriques Date: Wed, 24 Mar 2021 12:01:34 -0300 Subject: [PATCH 1/2] Add onclick --- client/views/teams/info/TeamsInfo.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/client/views/teams/info/TeamsInfo.js b/client/views/teams/info/TeamsInfo.js index ef1ad6b331057..9f7c5dfeab064 100644 --- a/client/views/teams/info/TeamsInfo.js +++ b/client/views/teams/info/TeamsInfo.js @@ -1,4 +1,4 @@ -import React, { useMemo } from 'react'; +import React, { useMemo, useCallback } from 'react'; import { Box, Button, Callout, Option, Menu } from '@rocket.chat/fuselage'; import { useMutableCallback } from '@rocket.chat/fuselage-hooks'; @@ -9,7 +9,7 @@ import DeleteTeamModal from './Delete'; import LeaveTeamModal from './Leave'; import InfoPanel, { RetentionPolicyCallout } from '../../InfoPanel'; import { roomTypes, UiTextContext } from '../../../../app/utils'; -import { useTabBarClose } from '../../room/providers/ToolboxProvider'; +import { useTabBarClose, useTabBarOpen } from '../../room/providers/ToolboxProvider'; import { useEndpointActionExperimental } from '../../../hooks/useEndpointAction'; import { GenericModalDoNotAskAgain } from '../../../components/GenericModal'; import { useTranslation } from '../../../contexts/TranslationContext'; @@ -50,6 +50,7 @@ export const TeamsInfo = ({ onClickLeave, onClickEdit, onClickDelete, + onClickViewChannels, }) => { const t = useTranslation(); @@ -162,7 +163,7 @@ export const TeamsInfo = ({ {t('Teams_channels')} - + @@ -182,6 +183,7 @@ export default function TeamsInfoWithLogic({ openEditing, }) { const onClickClose = useTabBarClose(); + const openTabbar = useTabBarOpen(); const t = useTranslation(); room.type = room.t; @@ -273,6 +275,8 @@ export default function TeamsInfoWithLogic({ ); }); + const onClickViewChannels = useCallback(() => openTabbar('team-channels'), []); + return ( } description={room.description && } From 3e90c754eeae240827453b21492b2853a49c1b36 Mon Sep 17 00:00:00 2001 From: dougfabris Date: Wed, 24 Mar 2021 16:06:58 -0300 Subject: [PATCH 2/2] fix lint --- client/views/teams/info/TeamsInfo.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/client/views/teams/info/TeamsInfo.js b/client/views/teams/info/TeamsInfo.js index 9f7c5dfeab064..7f673fed986ef 100644 --- a/client/views/teams/info/TeamsInfo.js +++ b/client/views/teams/info/TeamsInfo.js @@ -160,12 +160,12 @@ export const TeamsInfo = ({ {topic} } - + {onClickViewChannels && {t('Teams_channels')} - + } {retentionPolicyEnabled && ( @@ -275,7 +275,7 @@ export default function TeamsInfoWithLogic({ ); }); - const onClickViewChannels = useCallback(() => openTabbar('team-channels'), []); + const onClickViewChannels = useCallback(() => openTabbar('team-channels'), [openTabbar]); return (