diff --git a/stylesheets/components/ConversationDetails.scss b/stylesheets/components/ConversationDetails.scss index 49cf804df578..54c989da0c80 100644 --- a/stylesheets/components/ConversationDetails.scss +++ b/stylesheets/components/ConversationDetails.scss @@ -118,24 +118,8 @@ } &__tabs { - display: flex; - justify-content: space-around; - } - - &__tab { - @include font-body-1; - cursor: pointer; - padding: 15px; - - &:focus { - @include mouse-mode { - outline: none; - } - } - - &--selected { - @include font-body-1-bold; - border-bottom: 2px solid $color-black; + &#{&} { + border-bottom: none; } } diff --git a/ts/components/conversation/conversation-details/PendingInvites.tsx b/ts/components/conversation/conversation-details/PendingInvites.tsx index fc80c832f8db..24bc2a3ad228 100644 --- a/ts/components/conversation/conversation-details/PendingInvites.tsx +++ b/ts/components/conversation/conversation-details/PendingInvites.tsx @@ -2,7 +2,6 @@ // SPDX-License-Identifier: AGPL-3.0-only import React from 'react'; -import classNames from 'classnames'; import _ from 'lodash'; import type { ConversationType } from '../../../state/ducks/conversations'; @@ -15,6 +14,7 @@ import { PanelSection } from './PanelSection'; import { PanelRow } from './PanelRow'; import { ConversationDetailsIcon, IconType } from './ConversationDetailsIcon'; import { isAccessControlEnabled } from '../../../groups/util'; +import { Tabs } from '../../Tabs'; import { assertDev } from '../../../util/assert'; export type PropsDataType = { @@ -84,78 +84,56 @@ export function PendingInvites({ ); } - const [selectedTab, setSelectedTab] = React.useState(Tab.Requests); const [stagedMemberships, setStagedMemberships] = React.useState | null>(null); return (
-
-
{ - setSelectedTab(Tab.Requests); - }} - onKeyUp={(e: React.KeyboardEvent) => { - if (e.target === e.currentTarget && e.keyCode === 13) { - setSelectedTab(Tab.Requests); - } - }} - role="tab" - tabIndex={0} - > - {i18n('icu:PendingInvites--tab-requests', { - count: pendingApprovalMemberships.length, - })} -
- -
{ - setSelectedTab(Tab.Pending); - }} - onKeyUp={(e: React.KeyboardEvent) => { - if (e.target === e.currentTarget && e.keyCode === 13) { - setSelectedTab(Tab.Pending); - } - }} - role="tab" - tabIndex={0} - > - {i18n('icu:PendingInvites--tab-invites', { - count: pendingMemberships.length, - })} -
-
- - {selectedTab === Tab.Requests ? ( - - ) : null} - {selectedTab === Tab.Pending ? ( - - ) : null} + + {({ selectedTab }) => ( + <> + {selectedTab === Tab.Requests ? ( + + ) : null} + {selectedTab === Tab.Pending ? ( + + ) : null} + + )} + {stagedMemberships && stagedMemberships.length && ( > text=Invites (1)') + .locator('.ConversationDetails__tabs__tab >> text=Invites (1)') .click(); await conversationStack .locator(