Skip to content

Commit

Permalink
[web] Remove admins tab when there are no admins
Browse files Browse the repository at this point in the history
Summary:
In thick threads there are no admins, so it doesn't make sense to show an empty tab. Instead of hiding the tab just for thick threads, we can hide the tab every time there are no admins.

{F2726583}

{F2726584}

https://linear.app/comm/issue/ENG-9258/remove-admins-tab-in-thick-threads

Test Plan: Open a members menu in a thread with some admins and check if both tabs appear. Open it in a thick thread and check if only the members tab is present.

Reviewers: kamil, will

Reviewed By: will

Differential Revision: https://phab.comm.dev/D13359
  • Loading branch information
palys-swm committed Sep 18, 2024
1 parent a80f96b commit ab389ba
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions web/modals/threads/members/members-modal.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,25 @@ function ThreadMembersModalContent(props: ContentProps): React.Node {
);
}, [adminMembers, allMembers, tab, threadInfo]);

const threadMembersModalContent = React.useMemo(
() => (
const threadMembersModalContent = React.useMemo(() => {
if (adminMembers.length === 0) {
return (
<div className={css.modalContentContainer}>
<ThreadMembersList
threadInfo={threadInfo}
threadMembers={allMembers}
/>
</div>
);
}

return (
<div className={css.modalContentContainer}>
{tabs}
<div className={css.membersListTabsContent}>{tabContent}</div>
</div>
),
[tabContent, tabs],
);
);
}, [tabContent, tabs, adminMembers.length, allMembers, threadInfo]);

return threadMembersModalContent;
}
Expand Down

0 comments on commit ab389ba

Please sign in to comment.