Skip to content

A free and open source instant messaging and VoIP chat app built for friends, groups, and communities.

TypeScript fluxerfluxerapp

fix(app): tidy expression card, favorites and sticker copy

Hampus81f494381c76
diff --git a/fluxer_app/src/features/expressions/components/ExpressionInfoCard.tsx b/fluxer_app/src/features/expressions/components/ExpressionInfoCard.tsx
index 148521e74..f466e0dc2 100644
--- a/fluxer_app/src/features/expressions/components/ExpressionInfoCard.tsx
+++ b/fluxer_app/src/features/expressions/components/ExpressionInfoCard.tsx
@@ -110,7 +110,7 @@ const JOIN_COMMUNITY_REASON_DESCRIPTORS: Record<ExpressionKind, MessageDescripto
const JOIN_COMMUNITY_CONFIRMATION_DESCRIPTOR = msg({
message: 'Do you want to join {communityName}?',
comment:
- 'Body of the confirmation shown before joining a discoverable community from an expression info card. {communityName} is the community name.',
+ 'Body of the confirmation shown before joining a community listed in Explore from an expression info card. {communityName} is the community name.',
});
const GUILD_ICON_SIZE_PX = 40;
@@ -130,7 +130,7 @@ interface ExpressionInfoCardCommonProps {
onClose?: () => void;
}
-export type ExpressionInfoCardProps = ExpressionInfoCardCommonProps &
+type ExpressionInfoCardProps = ExpressionInfoCardCommonProps &
({kind: 'default_emoji'} | {kind: ExpressionKind; expressionId: string; guildId: string | null});
function toSourceGuild(guild: Guild): ExpressionSourceGuild {
@@ -248,7 +248,7 @@ const ExpressionSourceGuildRow = observer(function ExpressionSourceGuildRow({
onClose,
}: ExpressionSourceGuildRowProps) {
const {i18n} = useLingui();
- const isDiscoverable = guild.features.includes(GuildFeatures.DISCOVERABLE);
+ const isDiscoverable = guild.features.includes(GuildFeatures.DISCOVERABLE) && RuntimeConfig.discoveryAvailable;
const handleJump = useCallback(() => {
NavigationCommands.selectGuild(guild.id);
onClose?.();
@@ -281,8 +281,12 @@ const ExpressionSourceGuildRow = observer(function ExpressionSourceGuildRow({
modalKey,
);
}, [guild, kind, expressionName, i18n, onClose]);
- const canJoin = isDiscoverable && RuntimeConfig.discoveryAvailable;
- const activate = isMember ? handleJump : canJoin ? handleJoin : null;
+ let activate: (() => void) | null = null;
+ if (isMember) {
+ activate = handleJump;
+ } else if (isDiscoverable) {
+ activate = handleJoin;
+ }
const accessibleName = isMember
? i18n._(GO_TO_NAMED_COMMUNITY_DESCRIPTOR, {communityName: guild.name})
: i18n._(JOIN_NAMED_COMMUNITY_DESCRIPTOR, {communityName: guild.name});
diff --git a/fluxer_app/src/features/expressions/components/FavoritesWelcomeSection.tsx b/fluxer_app/src/features/expressions/components/FavoritesWelcomeSection.tsx
index 94b3eea02..5914c104d 100644
--- a/fluxer_app/src/features/expressions/components/FavoritesWelcomeSection.tsx
+++ b/fluxer_app/src/features/expressions/components/FavoritesWelcomeSection.tsx
@@ -1,6 +1,7 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
import {Routes} from '@app/app/Routes';
+import RuntimeConfig from '@app/features/app/state/RuntimeConfig';
import styles from '@app/features/expressions/components/FavoritesWelcomeSection.module.css';
import * as FavoritesCommands from '@app/features/messaging/commands/FavoritesCommands';
import * as RouterUtils from '@app/features/navigation/utils/RouterUtils';
@@ -29,10 +30,17 @@ export const FavoritesWelcomeSection = observer(() => {
<Trans>Welcome to favorites</Trans>
</h1>
<p className={styles.description} data-flx="expressions.favorites-welcome-section.description">
- <Trans>
- Your personal space for quick access to channels, DMs, and groups you love. Press the star on any channel to
- add it here.
- </Trans>
+ {RuntimeConfig.directMessagesDisabled ? (
+ <Trans>
+ Your personal space for quick access to the channels you love. Press the star on any channel to add it
+ here.
+ </Trans>
+ ) : (
+ <Trans>
+ Your personal space for quick access to channels, DMs, and groups you love. Press the star on any channel
+ to add it here.
+ </Trans>
+ )}
</p>
<p className={styles.tip} data-flx="expressions.favorites-welcome-section.tip">
<Trans>Not for you? Turn it off anytime.</Trans>
diff --git a/fluxer_app/src/features/expressions/components/modals/AddGuildStickerModal.tsx b/fluxer_app/src/features/expressions/components/modals/AddGuildStickerModal.tsx
index e75cb89a6..dbe1110a4 100644
--- a/fluxer_app/src/features/expressions/components/modals/AddGuildStickerModal.tsx
+++ b/fluxer_app/src/features/expressions/components/modals/AddGuildStickerModal.tsx
@@ -182,9 +182,7 @@ export const AddGuildStickerModal = observer(function AddGuildStickerModal({
<ConfirmModal
title={title}
description={renderStickerSizeErrorDescription(message, file.name, i18n)}
- primaryText={i18n._(BACK_TO_STICKER_DESCRIPTOR)}
- onPrimary={() => {}}
- secondaryText={false}
+ secondaryText={i18n._(BACK_TO_STICKER_DESCRIPTOR)}
data-flx="expressions.add-guild-sticker-modal.create.size-error-modal"
/>
)),