Introduce Membership type

This commit is contained in:
Stanislav Demydiuk 2024-03-11 17:16:53 +00:00 committed by Andy Balaam
parent 3c6fd58628
commit da99bad7b9
115 changed files with 582 additions and 526 deletions

View file

@ -99,7 +99,7 @@ export const SpaceButton = <T extends keyof JSX.IntrinsicElements>({
let notifBadge;
if (spaceKey && notificationState) {
let ariaLabel = _t("a11y_jump_first_unread_room");
if (space?.getMyMembership() === "invite") {
if (space?.getMyMembership() === Membership.Invite) {
ariaLabel = _t("a11y|jump_first_invite");
}
@ -325,7 +325,7 @@ export class SpaceItem extends React.PureComponent<IItemProps, IItemState> {
hasSubSpaces: this.state.childSpaces?.length,
});
const isInvite = space.getMyMembership() === "invite";
const isInvite = space.getMyMembership() === Membership.Invite;
const notificationState = isInvite
? StaticNotificationState.forSymbol("!", NotificationLevel.Highlight)
@ -378,7 +378,9 @@ export class SpaceItem extends React.PureComponent<IItemProps, IItemState> {
isNarrow={isPanelCollapsed}
size={isNested ? "24px" : "32px"}
onKeyDown={this.onKeyDown}
ContextMenuComponent={this.props.space.getMyMembership() === "join" ? SpaceContextMenu : undefined}
ContextMenuComponent={
this.props.space.getMyMembership() === Membership.Join ? SpaceContextMenu : undefined
}
>
{toggleCollapseButton}
</SpaceButton>