[skip ci] feat: prepare for public release

This commit is contained in:
Hampus Kraft
2026-01-02 19:27:51 +00:00
parent 197b23757f
commit 5ae825fc7d
199 changed files with 38391 additions and 33358 deletions

View File

@@ -242,6 +242,11 @@
opacity: 0.5;
}
.channelItemDisabled {
opacity: 0.6;
cursor: not-allowed;
}
.hoverAffordance {
display: none;
}

View File

@@ -76,6 +76,7 @@ import ReadStateStore from '~/stores/ReadStateStore';
import SelectedChannelStore from '~/stores/SelectedChannelStore';
import TrustedDomainStore from '~/stores/TrustedDomainStore';
import UserGuildSettingsStore from '~/stores/UserGuildSettingsStore';
import UserStore from '~/stores/UserStore';
import MediaEngineStore from '~/stores/voice/MediaEngineFacade';
import * as ChannelUtils from '~/utils/ChannelUtils';
@@ -194,10 +195,18 @@ export const ChannelItem = observer(
const showKeyboardAffordances = keyboardModeEnabled && isFocused;
const currentUserId = AuthenticationStore.currentUserId;
const currentUser = UserStore.getCurrentUser();
const isUnclaimed = !(currentUser?.isClaimed() ?? false);
const isGuildOwner = currentUser ? guild.isOwner(currentUser.id) : false;
const currentMember = currentUserId ? GuildMemberStore.getMember(guild.id, currentUserId) : null;
const isCurrentUserTimedOut = Boolean(currentMember?.isTimedOut());
const voiceBlockedForUnclaimed = channelIsVoice && isUnclaimed && !isGuildOwner;
const voiceTooltipText =
channelIsVoice && isCurrentUserTimedOut ? t`You can't join while you're on timeout.` : undefined;
channelIsVoice && isCurrentUserTimedOut
? t`You can't join while you're on timeout.`
: channelIsVoice && voiceBlockedForUnclaimed
? t`Claim your account to join this voice channel.`
: undefined;
const isVoiceSelected =
channel.type === ChannelTypes.GUILD_VOICE &&
@@ -367,6 +376,13 @@ export const ChannelItem = observer(
});
return;
}
if (channel.type === ChannelTypes.GUILD_VOICE && voiceBlockedForUnclaimed) {
ToastActionCreators.createToast({
type: 'error',
children: t`Claim your account to join this voice channel.`,
});
return;
}
if (channel.type === ChannelTypes.GUILD_CATEGORY) {
onToggle?.();
return;
@@ -512,6 +528,7 @@ export const ChannelItem = observer(
contextMenuOpen && styles.contextMenuOpen,
showKeyboardAffordances && styles.keyboardFocus,
channelIsVoice && styles.channelItemVoice,
voiceBlockedForUnclaimed && styles.channelItemDisabled,
)}
onClick={handleSelect}
onContextMenu={handleContextMenu}

View File

@@ -200,6 +200,10 @@ export const GuildLayout = observer(({children}: {children: React.ReactNode}) =>
if (nagbarState.forceHideInvitesDisabled) return false;
if (nagbarState.forceInvitesDisabled) return true;
if (user && !user.isClaimed() && guild.ownerId === user.id) {
return false;
}
const hasInvitesDisabled = guild.features.has(GuildFeatures.INVITES_DISABLED);
if (!hasInvitesDisabled) return false;
@@ -218,6 +222,7 @@ export const GuildLayout = observer(({children}: {children: React.ReactNode}) =>
invitesDisabledDismissed,
nagbarState.forceInvitesDisabled,
nagbarState.forceHideInvitesDisabled,
user,
]);
const shouldShowStaffOnlyGuild = React.useMemo(() => {

View File

@@ -28,11 +28,9 @@ import {clsx} from 'clsx';
import {observer} from 'mobx-react-lite';
import React from 'react';
import * as DimensionActionCreators from '~/actions/DimensionActionCreators';
import * as ModalActionCreators from '~/actions/ModalActionCreators';
import {modal} from '~/actions/ModalActionCreators';
import * as UserSettingsActionCreators from '~/actions/UserSettingsActionCreators';
import {ChannelTypes} from '~/Constants';
import {ClaimAccountModal} from '~/components/modals/ClaimAccountModal';
import {openClaimAccountModal} from '~/components/modals/ClaimAccountModal';
import {Tooltip} from '~/components/uikit/Tooltip/Tooltip';
import {ComponentDispatch} from '~/lib/ComponentDispatch';
import {Platform} from '~/lib/Platform';
@@ -330,7 +328,7 @@ export const GuildsLayout = observer(({children}: {children: React.ReactNode}) =
if (accountAgeMs < THIRTY_MINUTES_MS) return;
NagbarStore.markClaimAccountModalShown();
ModalActionCreators.push(modal(() => <ClaimAccountModal />));
openClaimAccountModal();
}, [isReady, user, location.pathname]);
const shouldShowSidebarDivider = !mobileLayout.enabled;

View File

@@ -19,12 +19,10 @@
import {Trans} from '@lingui/react/macro';
import {observer} from 'mobx-react-lite';
import * as ModalActionCreators from '~/actions/ModalActionCreators';
import {modal} from '~/actions/ModalActionCreators';
import {Nagbar} from '~/components/layout/Nagbar';
import {NagbarButton} from '~/components/layout/NagbarButton';
import {NagbarContent} from '~/components/layout/NagbarContent';
import {ClaimAccountModal} from '~/components/modals/ClaimAccountModal';
import {openClaimAccountModal} from '~/components/modals/ClaimAccountModal';
import UserStore from '~/stores/UserStore';
export const UnclaimedAccountNagbar = observer(({isMobile}: {isMobile: boolean}) => {
@@ -34,7 +32,7 @@ export const UnclaimedAccountNagbar = observer(({isMobile}: {isMobile: boolean})
}
const handleClaimAccount = () => {
ModalActionCreators.push(modal(() => <ClaimAccountModal />));
openClaimAccountModal({force: true});
};
return (