Skip to content

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

TypeScript fluxerfluxerapp

fix(app): call discovery Explore everywhere, align its tag field

Hampus7c105f13ef54
diff --git a/fluxer_app/src/features/channel/components/guild_members_page/MemberTableRow.tsx b/fluxer_app/src/features/channel/components/guild_members_page/MemberTableRow.tsx
index 3bafcc5d9..0b9f385fc 100644
--- a/fluxer_app/src/features/channel/components/guild_members_page/MemberTableRow.tsx
+++ b/fluxer_app/src/features/channel/components/guild_members_page/MemberTableRow.tsx
@@ -54,9 +54,8 @@ const PLATFORM_ADMIN_DESCRIPTOR = msg({
comment: 'Join source label on the community members page. Shown when a platform admin force-added the member.',
});
const DISCOVERY_DESCRIPTOR = msg({
- message: 'Discovery',
- comment:
- 'Join source label on the community members page. Shown when the member found the community via the Discovery surface.',
+ message: 'Explore',
+ comment: 'Join source label on the community members page. Shown when the member found the community in Explore.',
});
const UNKNOWN_USER_DESCRIPTOR = msg({
message: 'Unknown user',
diff --git a/fluxer_app/src/features/discovery/commands/DiscoveryJoinCommands.tsx b/fluxer_app/src/features/discovery/commands/DiscoveryJoinCommands.tsx
index 9882821fd..caad2b697 100644
--- a/fluxer_app/src/features/discovery/commands/DiscoveryJoinCommands.tsx
+++ b/fluxer_app/src/features/discovery/commands/DiscoveryJoinCommands.tsx
@@ -2,6 +2,7 @@
import i18n from '@app/app/I18n';
import {GenericErrorModal} from '@app/features/app/components/alerts/GenericErrorModal';
+import {promptForAccountTier} from '@app/features/auth/utils/AccountTierPrompt';
import * as DiscoveryCommands from '@app/features/discovery/commands/DiscoveryCommands';
import * as NavigationCommands from '@app/features/navigation/commands/NavigationCommands';
import {failureCode, failureMessage} from '@app/features/platform/utils/ResponseInspection';
@@ -13,19 +14,19 @@ import {msg} from '@lingui/core/macro';
const COULDN_T_JOIN_DESCRIPTOR = msg({
message: "Couldn't join this community",
- comment: 'Title of the generic fallback error modal shown when joining a discovery community fails.',
+ comment: 'Title of the generic fallback error modal shown when joining a community from Explore fails.',
});
const COULDN_T_JOIN_GENERIC_DESCRIPTOR = msg({
message: 'Something went wrong. Please try again in a moment.',
- comment: 'Body of the generic fallback error modal shown when joining a discovery community fails.',
+ comment: 'Body of the generic fallback error modal shown when joining a community from Explore fails.',
});
const SERVER_FULL_TITLE_DESCRIPTOR = msg({
message: 'This community is full',
- comment: 'Title of the error modal shown when a discovery community has reached its member limit.',
+ comment: 'Title of the error modal shown when a community from Explore has reached its member limit.',
});
const SERVER_FULL_MESSAGE_DESCRIPTOR = msg({
message: "This community has reached its member limit, so you can't join right now.",
- comment: 'Body of the error modal shown when a discovery community has reached its member limit.',
+ comment: 'Body of the error modal shown when a community from Explore has reached its member limit.',
});
const TOO_MANY_SERVERS_TITLE_DESCRIPTOR = msg({
message: "You've reached the community limit",
@@ -37,29 +38,29 @@ const TOO_MANY_SERVERS_MESSAGE_DESCRIPTOR = msg({
});
const BANNED_TITLE_DESCRIPTOR = msg({
message: "You can't join this community",
- comment: 'Title of the error modal shown when the user is banned from a discovery community.',
+ comment: 'Title of the error modal shown when the user is banned from a community in Explore.',
});
const BANNED_MESSAGE_DESCRIPTOR = msg({
message: 'You have been banned from this community.',
- comment: 'Body of the error modal shown when the user is banned from a discovery community.',
+ comment: 'Body of the error modal shown when the user is banned from a community in Explore.',
});
const NOT_AVAILABLE_TITLE_DESCRIPTOR = msg({
message: 'This community is no longer available',
comment:
- 'Title of the error modal shown when a discovery community is no longer joinable (delisted, invites off, or discovery disabled).',
+ 'Title of the error modal shown when a community from Explore is no longer joinable (removed from Explore, invites off, or Explore turned off on the instance).',
});
const NOT_AVAILABLE_MESSAGE_DESCRIPTOR = msg({
- message: "It may have left discovery or turned off new joins. Refresh the page and you won't see it again.",
+ message: "It may have left Explore or turned off new joins. Refresh the page and you won't see it again.",
comment:
- 'Body of the error modal shown when a discovery community is no longer joinable (delisted, invites off, or discovery disabled).',
+ 'Body of the error modal shown when a community from Explore is no longer joinable (removed from Explore, invites off, or Explore turned off on the instance).',
});
const GOING_TOO_FAST_TITLE_DESCRIPTOR = msg({
message: "You're going too fast",
- comment: 'Title of the error modal shown when joining a discovery community is rate limited.',
+ comment: 'Title of the error modal shown when joining a community from Explore is rate limited.',
});
const GOING_TOO_FAST_MESSAGE_DESCRIPTOR = msg({
message: 'Please wait a moment and try again.',
- comment: 'Body of the error modal shown when joining a discovery community is rate limited.',
+ comment: 'Body of the error modal shown when joining a community from Explore is rate limited.',
});
function resolveJoinGuildErrorContent(code: string | undefined): {title: string; message: string} {
@@ -126,7 +127,9 @@ export async function joinDiscoveryGuild(
}
return true;
} catch (error) {
- showJoinGuildErrorModal(error);
+ if (!promptForAccountTier(error, () => void joinDiscoveryGuild(guildId, target))) {
+ showJoinGuildErrorModal(error);
+ }
return false;
}
}
diff --git a/fluxer_app/src/features/discovery/components/modals/DiscoveryGuildPreviewModal.tsx b/fluxer_app/src/features/discovery/components/modals/DiscoveryGuildPreviewModal.tsx
index 55d5e8ce8..d39848bc6 100644
--- a/fluxer_app/src/features/discovery/components/modals/DiscoveryGuildPreviewModal.tsx
+++ b/fluxer_app/src/features/discovery/components/modals/DiscoveryGuildPreviewModal.tsx
@@ -21,20 +21,20 @@ import {useCallback, useMemo, useState} from 'react';
const COMMUNITY_PREVIEW_DESCRIPTOR = msg({
message: 'Community preview',
- comment: 'Accessible title of the modal that previews a Discovery community before joining it.',
+ comment: 'Accessible title of the modal that previews a community from Explore before joining it.',
});
const OPEN_COMMUNITY_DESCRIPTOR = msg({
message: 'Open community',
- comment: 'Button label in the Discovery community preview modal shown when the user is already a member.',
+ comment: 'Button label in the Explore community preview modal shown when the user is already a member.',
});
const NO_DESCRIPTION_DESCRIPTOR = msg({
message: 'No description.',
- comment: 'Empty-state text shown in the Discovery community preview modal when a community has no description.',
+ comment: 'Empty-state text shown in the Explore community preview modal when a community has no description.',
});
const PUBLIC_COMMUNITY_DESCRIPTOR = msg({
message: 'Public community',
comment:
- 'Line shown above the community name in the Discovery community preview modal. The user found this community in the public directory rather than being invited to it.',
+ 'Line shown above the community name in the Explore community preview modal. The user found this community in the public directory rather than being invited to it.',
});
interface DiscoveryGuildPreviewModalProps {
@@ -69,7 +69,7 @@ export const DiscoveryGuildPreviewModal = observer(function DiscoveryGuildPrevie
}
setJoining(false);
}, [guild.id, isAlreadyMember, joining]);
- const canJoin = !RuntimeConfig.singleCommunityEnabled;
+ const canJoin = RuntimeConfig.discoveryAvailable;
return (
<Modal.Root
size="large"
diff --git a/fluxer_app/src/features/discovery/discovery/DiscoveryEmptyState.tsx b/fluxer_app/src/features/discovery/discovery/DiscoveryEmptyState.tsx
index 71e9bc211..3d161ce87 100644
--- a/fluxer_app/src/features/discovery/discovery/DiscoveryEmptyState.tsx
+++ b/fluxer_app/src/features/discovery/discovery/DiscoveryEmptyState.tsx
@@ -11,27 +11,27 @@ import {observer} from 'mobx-react-lite';
const NO_COMMUNITIES_MATCH_DESCRIPTOR = msg({
message: 'No communities match.',
- comment: 'Empty-state text in the discovery page.',
+ comment: 'Empty-state text in the Explore page.',
});
const NO_MATCHING_COMMUNITIES_HINT_DESCRIPTOR = msg({
message: 'Try another search term, or pick a different category or language.',
- comment: 'Empty-state hint in Discovery shown under the heading when a search returns no communities.',
+ comment: 'Empty-state hint in Explore shown under the heading when a search returns no communities.',
});
const NOTHING_TO_EXPLORE_DESCRIPTOR = msg({
message: 'Nothing to explore yet',
- comment: 'Empty-state heading in Discovery shown when no communities are listed at all.',
+ comment: 'Empty-state heading in Explore shown when no communities are listed at all.',
});
const NOTHING_TO_EXPLORE_HINT_DESCRIPTOR = msg({
message: 'No communities are listed right now. Check back a little later.',
- comment: 'Empty-state hint in Discovery shown under the heading when no communities are listed at all.',
+ comment: 'Empty-state hint in Explore shown under the heading when no communities are listed at all.',
});
const COULD_NOT_LOAD_COMMUNITIES_DESCRIPTOR = msg({
message: "Couldn't load communities",
- comment: 'Empty-state heading in Discovery shown when the request for communities failed.',
+ comment: 'Empty-state heading in Explore shown when the request for communities failed.',
});
const COULD_NOT_LOAD_COMMUNITIES_HINT_DESCRIPTOR = msg({
message: 'Check your connection, then try again.',
- comment: 'Empty-state hint in Discovery shown under the heading when the request for communities failed.',
+ comment: 'Empty-state hint in Explore shown under the heading when the request for communities failed.',
});
interface DiscoveryEmptyStateContent {
diff --git a/fluxer_app/src/features/discovery/discovery/DiscoveryGuildCard.tsx b/fluxer_app/src/features/discovery/discovery/DiscoveryGuildCard.tsx
index 3e226dda0..759e6db98 100644
--- a/fluxer_app/src/features/discovery/discovery/DiscoveryGuildCard.tsx
+++ b/fluxer_app/src/features/discovery/discovery/DiscoveryGuildCard.tsx
@@ -4,8 +4,10 @@ import type {DiscoveryGuild} from '@app/features/discovery/commands/DiscoveryCom
import {DiscoveryGuildPreviewModal} from '@app/features/discovery/components/modals/DiscoveryGuildPreviewModal';
import styles from '@app/features/discovery/discovery/DiscoveryGuildCard.module.css';
import {resolveBannerTintClassName} from '@app/features/discovery/utils/DiscoveryBannerTint';
+import {visitFromDiscovery} from '@app/features/guild/commands/GuildVisitCommands';
import {GuildBadge} from '@app/features/guild/components/GuildBadge';
import {GuildIcon} from '@app/features/guild/components/popouts/GuildIcon';
+import Guilds from '@app/features/guild/state/Guilds';
import {formatNumber} from '@app/features/i18n/utils/IntlCache';
import {DiscoveryGuildContextMenu} from '@app/features/ui/action_menu/DiscoveryGuildContextMenu';
import * as ContextMenuCommands from '@app/features/ui/commands/ContextMenuCommands';
@@ -23,16 +25,17 @@ import {useCallback, useId, useMemo} from 'react';
const NO_DESCRIPTION_PROVIDED_DESCRIPTOR = msg({
message: 'No description.',
- comment: 'Empty-state text in the discovery guild card.',
+ comment: 'Empty-state text in the Explore community card.',
});
const ONLINE_DESCRIPTOR = msg({
message: '{onlineCount} online',
- comment: 'Short label in the discovery guild card. Keep it concise. Preserve {onlineCount}; it is inserted by code.',
+ comment:
+ 'Short label in the Explore community card. Keep it concise. Preserve {onlineCount}; it is inserted by code.',
});
const PREVIEW_NAMED_COMMUNITY_DESCRIPTOR = msg({
message: 'Preview {communityName}',
comment:
- 'Accessible label for a Discovery community card, which opens a preview of the community. {communityName} is the public community name.',
+ 'Accessible label for a community card in Explore, which opens a preview of the community. {communityName} is the public community name.',
});
const DISCOVERY_NAME_BADGE_IGNORED_FEATURES = new Set<string>([GuildFeatures.DISCOVERABLE]);
@@ -63,15 +66,21 @@ export const DiscoveryGuildCard = observer(function DiscoveryGuildCard({
return AvatarUtils.getGuildBannerURL({id: guild.id, banner: guild.banner}) || null;
}, [guild.banner, guild.id]);
const handleActivate = useCallback(() => {
- ModalCommands.pushWithKey(
- modal(() => (
- <DiscoveryGuildPreviewModal
- guild={guild}
- data-flx="discovery.discovery.discovery-guild-card.handle-activate.discovery-guild-preview-modal"
- />
- )),
- `discovery-guild-preview-${guild.id}`,
- );
+ const openPreview = () =>
+ ModalCommands.pushWithKey(
+ modal(() => (
+ <DiscoveryGuildPreviewModal
+ guild={guild}
+ data-flx="discovery.discovery.discovery-guild-card.handle-activate.discovery-guild-preview-modal"
+ />
+ )),
+ `discovery-guild-preview-${guild.id}`,
+ );
+ if (guild.visits_enabled === true || Guilds.getGuild(guild.id)?.visiting === true) {
+ void visitFromDiscovery(guild.id, openPreview);
+ return;
+ }
+ openPreview();
}, [guild]);
const handleContextMenu = useCallback(
(event: React.MouseEvent) => {
diff --git a/fluxer_app/src/features/discovery/discovery/DiscoveryLanguageButton.tsx b/fluxer_app/src/features/discovery/discovery/DiscoveryLanguageButton.tsx
index 367727e74..4e463c0fb 100644
--- a/fluxer_app/src/features/discovery/discovery/DiscoveryLanguageButton.tsx
+++ b/fluxer_app/src/features/discovery/discovery/DiscoveryLanguageButton.tsx
@@ -15,12 +15,12 @@ import {useCallback} from 'react';
const FILTER_BY_LANGUAGE_DESCRIPTOR = msg({
message: 'Filter by language',
- comment: 'Label for the discovery language filter button. Keep it concise.',
+ comment: 'Label for the Explore language filter button. Keep it concise.',
});
const FILTERING_BY_LANGUAGE_DESCRIPTOR = msg({
message: 'Filtering by {language}',
comment:
- 'Label for the discovery language filter button once a language is chosen. Preserve {language}; it is inserted by code.',
+ 'Label for the Explore language filter button once a language is chosen. Preserve {language}; it is inserted by code.',
});
export const DiscoveryLanguageButton = observer(() => {
diff --git a/fluxer_app/src/features/discovery/discovery/DiscoveryLanguageDropdown.tsx b/fluxer_app/src/features/discovery/discovery/DiscoveryLanguageDropdown.tsx
index 64351988c..88cf97936 100644
--- a/fluxer_app/src/features/discovery/discovery/DiscoveryLanguageDropdown.tsx
+++ b/fluxer_app/src/features/discovery/discovery/DiscoveryLanguageDropdown.tsx
@@ -13,7 +13,7 @@ import {useCallback, useMemo} from 'react';
const ALL_LANGUAGES_DESCRIPTOR = msg({
message: 'All languages',
- comment: 'Option in the discovery language filter that clears the filter. Keep it concise.',
+ comment: 'Option in the Explore language filter that clears the filter. Keep it concise.',
});
interface Props {
diff --git a/fluxer_app/src/features/discovery/discovery/DiscoveryNavbar.tsx b/fluxer_app/src/features/discovery/discovery/DiscoveryNavbar.tsx
index e14d52bd8..a1da961b1 100644
--- a/fluxer_app/src/features/discovery/discovery/DiscoveryNavbar.tsx
+++ b/fluxer_app/src/features/discovery/discovery/DiscoveryNavbar.tsx
@@ -10,34 +10,34 @@ import {DiscoveryMotionKind, DiscoveryTransition} from '@app/features/discovery/
import Discovery from '@app/features/discovery/state/Discovery';
import {CLEAR_SEARCH_DESCRIPTOR, GO_BACK_DESCRIPTOR} from '@app/features/i18n/utils/CommonMessageDescriptors';
import FocusRing from '@app/features/ui/focus_ring/FocusRing';
+import {ArrowLeftIcon} from '@app/features/ui/icons/DirectionalIcons';
import {getNextTabIndex, getTabNavigationDirection} from '@app/features/ui/tabs/TabKeyboardNavigation';
import {msg} from '@lingui/core/macro';
import {useLingui} from '@lingui/react/macro';
-import {ArrowLeftIcon, MagnifyingGlassIcon, XIcon} from '@phosphor-icons/react';
+import {MagnifyingGlassIcon, XIcon} from '@phosphor-icons/react';
import {clsx} from 'clsx';
import {observer} from 'mobx-react-lite';
import {type KeyboardEvent, type SubmitEvent, useCallback, useEffect, useRef, useState} from 'react';
const ALL_DESCRIPTOR = msg({
message: 'All',
- comment: 'Label for the all-categories tab in the Discovery page.',
+ comment: 'Label for the all-categories tab in the Explore page.',
});
const DISCOVERY_CATEGORIES_DESCRIPTOR = msg({
- message: 'Discovery categories',
- comment: 'Accessible label for the category tabs in the Discovery page.',
+ message: 'Explore categories',
+ comment: 'Accessible label for the category tabs in the Explore page.',
});
const SEARCH_COMMUNITIES_DESCRIPTOR = msg({
message: 'Search communities',
- comment: 'Accessible label and placeholder for the community search field in the Discovery page.',
+ comment: 'Accessible label and placeholder for the community search field in the Explore page.',
});
const DISCOVERY_SEARCH_DESCRIPTOR = msg({
- message: 'Discovery search',
- comment: 'Accessible label for the search form in the Discovery navigation bar.',
+ message: 'Search Explore',
+ comment: 'Accessible label for the search form in the Explore navigation bar.',
});
const SEARCH_RESULTS_FOR_DESCRIPTOR = msg({
message: 'Search results for “{query}”',
- comment:
- 'Heading in the Discovery navigation bar when a search is active. {query} is the text the user searched for.',
+ comment: 'Heading in the Explore navigation bar when a search is active. {query} is the text the user searched for.',
});
function resolveLeftSectionTransitionKey(searchActive: boolean): string {
diff --git a/fluxer_app/src/features/discovery/discovery/DiscoverySearchFilters.tsx b/fluxer_app/src/features/discovery/discovery/DiscoverySearchFilters.tsx
index 351dac99a..d4ad9ef64 100644
--- a/fluxer_app/src/features/discovery/discovery/DiscoverySearchFilters.tsx
+++ b/fluxer_app/src/features/discovery/discovery/DiscoverySearchFilters.tsx
@@ -16,28 +16,28 @@ import {type ReactNode, useCallback, useId, useLayoutEffect, useMemo, useRef} fr
const SEARCH_FILTERS_DESCRIPTOR = msg({
message: 'Search filters',
- comment: 'Accessible label for the filter sidebar shown beside the Discovery search results.',
+ comment: 'Accessible label for the filter sidebar shown beside the Explore search results.',
});
const CATEGORIES_DESCRIPTOR = msg({
message: 'Categories',
- comment: 'Heading above the category filter list in the Discovery search sidebar.',
+ comment: 'Heading above the category filter list in the Explore search sidebar.',
});
const ALL_DESCRIPTOR = msg({
message: 'All',
- comment: 'Label for the all-categories tab in the Discovery page.',
+ comment: 'Label for the all-categories tab in the Explore page.',
});
const ALL_LANGUAGES_DESCRIPTOR = msg({
message: 'All languages',
- comment: 'Short label in the discovery page. Keep it concise.',
+ comment: 'Short label in the Explore page. Keep it concise.',
});
const FILTER_BY_LANGUAGE_DESCRIPTOR = msg({
message: 'Filter by language',
- comment: 'Short label in the discovery page. Keep it concise.',
+ comment: 'Short label in the Explore page. Keep it concise.',
});
const CATEGORY_FILTER_DESCRIPTOR = msg({
message: '{categoryLabel}, {count, plural, one {# community} other {# communities}}',
comment:
- 'Accessible label for a category row in the Discovery search sidebar. {categoryLabel} is the category name and {count} is how many communities match the current search in it. Both are inserted by code.',
+ 'Accessible label for a category row in the Explore search sidebar. {categoryLabel} is the category name and {count} is how many communities match the current search in it. Both are inserted by code.',
});
const FILTERS_ENTER_TRANSLATE_Y_PX = 8;
diff --git a/fluxer_app/src/features/discovery/discovery/DiscoverySidebar.tsx b/fluxer_app/src/features/discovery/discovery/DiscoverySidebar.tsx
index 01ae98f6a..e596ee010 100644
--- a/fluxer_app/src/features/discovery/discovery/DiscoverySidebar.tsx
+++ b/fluxer_app/src/features/discovery/discovery/DiscoverySidebar.tsx
@@ -13,24 +13,24 @@ import {clsx} from 'clsx';
import {observer} from 'mobx-react-lite';
const DISCOVERY_NAVIGATION_DESCRIPTOR = msg({
- message: 'Discovery navigation',
- comment: 'Accessible label for the section navigation in the Discovery page sidebar.',
+ message: 'Explore navigation',
+ comment: 'Accessible label for the section navigation in the Explore page sidebar.',
});
const APPS_DESCRIPTOR = msg({
message: 'Apps',
- comment: 'Short label in the Discovery page sidebar. Keep it concise.',
+ comment: 'Short label in the Explore page sidebar. Keep it concise.',
});
const THEMES_DESCRIPTOR = msg({
message: 'Themes',
- comment: 'Short label in the Discovery page sidebar. Keep it concise.',
+ comment: 'Short label in the Explore page sidebar. Keep it concise.',
});
const COMING_SOON_DESCRIPTOR = msg({
message: 'Coming soon',
- comment: 'Small badge on disabled Discovery sidebar navigation items for sections not available yet.',
+ comment: 'Small badge on disabled Explore sidebar navigation items for sections not available yet.',
});
const COMING_SOON_NAV_ITEM_DESCRIPTOR = msg({
message: '{itemLabel}, coming soon',
- comment: 'Accessible label for a disabled Discovery sidebar navigation item. {itemLabel} is the section name.',
+ comment: 'Accessible label for a disabled Explore sidebar navigation item. {itemLabel} is the section name.',
});
interface DiscoveryNavigationItem {
diff --git a/fluxer_app/src/features/guild/components/GuildBadge.tsx b/fluxer_app/src/features/guild/components/GuildBadge.tsx
index e5da884ca..eb4b56e22 100644
--- a/fluxer_app/src/features/guild/components/GuildBadge.tsx
+++ b/fluxer_app/src/features/guild/components/GuildBadge.tsx
@@ -1,5 +1,6 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
+import RuntimeConfig from '@app/features/app/state/RuntimeConfig';
import styles from '@app/features/guild/components/GuildBadge.module.css';
import {DISCOVERABLE_COMMUNITY_DESCRIPTOR} from '@app/features/i18n/utils/CommonMessageDescriptors';
import {DiscoverableBadgeIcon} from '@app/features/ui/components/icons/DiscoverableBadgeIcon';
@@ -9,6 +10,7 @@ import {Tooltip} from '@app/features/ui/tooltip/Tooltip';
import {GuildFeatures} from '@fluxer/constants/src/GuildConstants';
import {msg} from '@lingui/core/macro';
import {useLingui} from '@lingui/react/macro';
+import {observer} from 'mobx-react-lite';
const VERIFIED_PARTNERED_COMMUNITY_DESCRIPTOR = msg({
message: 'Verified & partnered community',
@@ -39,7 +41,7 @@ function hasFeature(features: ReadonlySet<string> | ReadonlyArray<string>, featu
return (features as ReadonlySet<string>).has(feature);
}
-export function GuildBadge({
+export const GuildBadge = observer(function GuildBadge({
features,
variant = 'default',
tooltipPosition = 'top',
@@ -50,19 +52,17 @@ export function GuildBadge({
const {i18n} = useLingui();
const isVerified = hasFeature(features, GuildFeatures.VERIFIED);
const isPartnered = hasFeature(features, GuildFeatures.PARTNERED);
- const isDiscoverable = hasFeature(features, GuildFeatures.DISCOVERABLE);
+ const isDiscoverable = hasFeature(features, GuildFeatures.DISCOVERABLE) && RuntimeConfig.discoveryAvailable;
if (!isVerified && !isPartnered && !isDiscoverable) {
return null;
}
const badgeSize = variant === 'large' ? 24 : 20;
- const badgeClassName =
- variant === 'banner'
- ? forceDarkTheme
- ? styles.badgeBannerDark
- : styles.badgeBanner
- : onLightSurface
- ? styles.badgeOnLightSurface
- : styles.badge;
+ let badgeClassName: string;
+ if (variant === 'banner') {
+ badgeClassName = forceDarkTheme ? styles.badgeBannerDark : styles.badgeBanner;
+ } else {
+ badgeClassName = onLightSurface ? styles.badgeOnLightSurface : styles.badge;
+ }
let tooltipText: string;
let icon: React.JSX.Element;
if (isPartnered) {
@@ -99,4 +99,4 @@ export function GuildBadge({
</span>
</Tooltip>
);
-}
+});
diff --git a/fluxer_app/src/features/guild/components/modals/guild_tabs/GuildDiscoveryTab.module.css b/fluxer_app/src/features/guild/components/modals/guild_tabs/GuildDiscoveryTab.module.css
index 179528a9e..1e75a3457 100644
--- a/fluxer_app/src/features/guild/components/modals/guild_tabs/GuildDiscoveryTab.module.css
+++ b/fluxer_app/src/features/guild/components/modals/guild_tabs/GuildDiscoveryTab.module.css
@@ -138,6 +138,7 @@
}
.warningIcon {
+ display: flex;
margin-top: 0.125rem;
color: var(--status-warning);
}
@@ -174,7 +175,7 @@
}
.infoIcon {
- margin-top: 0.125rem;
+ display: flex;
color: var(--alert-note-color);
}
@@ -232,7 +233,7 @@
.tagsInputRow {
display: flex;
- align-items: center;
+ align-items: stretch;
gap: 0.5rem;
}
diff --git a/fluxer_app/src/features/guild/components/modals/guild_tabs/GuildDiscoveryTab.tsx b/fluxer_app/src/features/guild/components/modals/guild_tabs/GuildDiscoveryTab.tsx
index 96c99d749..5ceb137c5 100644
--- a/fluxer_app/src/features/guild/components/modals/guild_tabs/GuildDiscoveryTab.tsx
+++ b/fluxer_app/src/features/guild/components/modals/guild_tabs/GuildDiscoveryTab.tsx
@@ -41,103 +41,103 @@ import {Controller, useForm} from 'react-hook-form';
const PENDING_DESCRIPTOR = msg({
message: 'Pending',
comment:
- 'Discovery application status badge in the community Discovery settings tab. The application is awaiting staff review.',
+ 'Status badge for the application to Explore, shown in the "Explore" tab in community settings. The application is awaiting staff review.',
});
const APPROVED_DESCRIPTOR = msg({
message: 'Approved',
comment:
- 'Discovery application status badge in the community Discovery settings tab. The community has been approved and is listed.',
+ 'Status badge for the application to Explore, shown in the "Explore" tab in community settings. The community has been approved and is listed.',
});
const REJECTED_DESCRIPTOR = msg({
message: 'Rejected',
comment:
- 'Discovery application status badge in the community Discovery settings tab. The application was declined by staff.',
+ 'Status badge for the application to Explore, shown in the "Explore" tab in community settings. The application was declined by staff.',
});
const REMOVED_DESCRIPTOR = msg({
message: 'Removed',
comment:
- 'Discovery application status badge in the community Discovery settings tab. The community was delisted from Discovery.',
+ 'Status badge for the application to Explore, shown in the "Explore" tab in community settings. The community was removed from Explore.',
});
const DISCOVERY_TAG_REQUIREMENTS_DESCRIPTOR = msg({
message: 'Tags must be 2 to {maxLength} characters and alphanumeric.',
- comment: 'Discovery custom-tag validation error. maxLength is the maximum allowed tag length.',
+ comment: 'Explore custom-tag validation error. maxLength is the maximum allowed tag length.',
});
const DISCOVERY_TAG_LIMIT_DESCRIPTOR = msg({
message: 'You can only add up to {maxTags} tags.',
- comment: 'Discovery custom-tag validation error. maxTags is the maximum number of custom tags.',
+ comment: 'Explore custom-tag validation error. maxTags is the maximum number of custom tags.',
});
const COULDN_T_WITHDRAW_DISCOVERY_APPLICATION_DESCRIPTOR = msg({
message: "Couldn't withdraw application",
- comment: 'Error modal title shown when withdrawing a community Discovery application fails.',
+ comment: 'Error modal title shown when withdrawing an application to Explore fails.',
});
const COULDN_T_ADD_DISCOVERY_TAG_DESCRIPTOR = msg({
message: "Couldn't add tag",
- comment: 'Error modal title shown when a custom Discovery tag cannot be added.',
+ comment: 'Error modal title shown when a custom Explore tag cannot be added.',
});
const GAMING_DESCRIPTOR = msg({
message: 'Gaming',
- comment: 'Discovery category dropdown option in the community Discovery settings tab.',
+ comment: 'Category dropdown option in the "Explore" tab in community settings.',
});
const MUSIC_DESCRIPTOR = msg({
message: 'Music',
- comment: 'Discovery category dropdown option in the community Discovery settings tab.',
+ comment: 'Category dropdown option in the "Explore" tab in community settings.',
});
const ENTERTAINMENT_DESCRIPTOR = msg({
message: 'Entertainment',
- comment: 'Discovery category dropdown option in the community Discovery settings tab.',
+ comment: 'Category dropdown option in the "Explore" tab in community settings.',
});
const EDUCATION_DESCRIPTOR = msg({
message: 'Education',
- comment: 'Discovery category dropdown option in the community Discovery settings tab.',
+ comment: 'Category dropdown option in the "Explore" tab in community settings.',
});
const SCIENCE_TECHNOLOGY_DESCRIPTOR = msg({
message: 'Science & technology',
- comment: 'Discovery category dropdown option in the community Discovery settings tab.',
+ comment: 'Category dropdown option in the "Explore" tab in community settings.',
});
const CONTENT_CREATOR_DESCRIPTOR = msg({
message: 'Content creator',
comment:
- 'Discovery category dropdown option in the community Discovery settings tab. Communities run by an individual creator.',
+ 'Category dropdown option in the "Explore" tab in community settings. Communities run by an individual creator.',
});
const ANIME_MANGA_DESCRIPTOR = msg({
message: 'Anime & manga',
- comment: 'Discovery category dropdown option in the community Discovery settings tab.',
+ comment: 'Category dropdown option in the "Explore" tab in community settings.',
});
const MOVIES_TV_DESCRIPTOR = msg({
message: 'Movies & TV',
comment:
- 'Discovery category dropdown option in the community Discovery settings tab. "TV" is the abbreviation for television.',
+ 'Category dropdown option in the "Explore" tab in community settings. "TV" is the abbreviation for television.',
});
const OTHER_DESCRIPTOR = msg({
message: 'Other',
- comment: 'Catch-all Discovery category dropdown option in the community Discovery settings tab.',
+ comment: 'Catch-all category dropdown option in the "Explore" tab in community settings.',
});
const A_DESCRIPTION_IS_REQUIRED_DESCRIPTOR = msg({
message: 'A description is required.',
- comment: 'Inline validation error on the Discovery application form when the description field is empty.',
+ comment: 'Inline validation error on the form for applying to Explore when the description field is empty.',
});
const DESCRIPTION_MUST_BE_AT_LEAST_CHARACTERS_DESCRIPTOR = msg({
message: 'Description must be at least {discoveryDescriptionMinLength} characters.',
comment:
- 'Inline validation error on the Discovery application form when the description is too short. {discoveryDescriptionMinLength} is an integer.',
+ 'Inline validation error on the form for applying to Explore when the description is too short. {discoveryDescriptionMinLength} is an integer.',
});
const DESCRIPTION_MUST_BE_NO_MORE_THAN_CHARACTERS_DESCRIPTOR = msg({
message: 'Description must be no more than {discoveryDescriptionMaxLength} characters.',
comment:
- 'Inline validation error on the Discovery application form when the description is too long. {discoveryDescriptionMaxLength} is an integer.',
+ 'Inline validation error on the form for applying to Explore when the description is too long. {discoveryDescriptionMaxLength} is an integer.',
});
const DESCRIBE_WHAT_YOUR_COMMUNITY_IS_ABOUT_DESCRIPTOR = msg({
message: 'Describe what your community is about',
- comment: 'Placeholder in the description textarea on the Discovery application form.',
+ comment: 'Placeholder in the description textarea on the form for applying to Explore.',
});
const REMOVE_TAG_DESCRIPTOR = msg({
message: 'Remove tag {tag}',
comment:
- 'Accessible label for the per-tag X button in the Discovery tag list. {tag} is the tag text. Used by screen readers.',
+ 'Accessible label for the per-tag X button in the Explore tag list. {tag} is the tag text. Used by screen readers.',
});
const ADD_A_TAG_AND_PRESS_ENTER_DESCRIPTOR = msg({
message: 'Add a tag and press Enter',
- comment: 'Placeholder in the tag input on the Discovery application form. "Enter" refers to the Enter/Return key.',
+ comment: 'Placeholder in the tag input on the form for applying to Explore. "Enter" refers to the Enter/Return key.',
});
const logger = new Logger('GuildDiscoveryTab');
@@ -275,7 +275,7 @@ const GuildDiscoveryTab: React.FC<{guildId: string}> = ({guildId}) => {
commitRemoteValues(getDiscoveryApplicationFormValues(result));
ToastCommands.createToast({
type: 'success',
- children: <Trans>Discovery listing updated</Trans>,
+ children: <Trans>Explore listing updated</Trans>,
});
} else {
const result = await GuildCommands.applyForDiscovery(guildId, payload);
@@ -283,7 +283,7 @@ const GuildDiscoveryTab: React.FC<{guildId: string}> = ({guildId}) => {
commitRemoteValues(getDiscoveryApplicationFormValues(result));
ToastCommands.createToast({
type: 'success',
- children: <Trans>Discovery application sent</Trans>,
+ children: <Trans>Application to Explore sent</Trans>,
});
}
},
@@ -302,7 +302,7 @@ const GuildDiscoveryTab: React.FC<{guildId: string}> = ({guildId}) => {
commitRemoteValues(getEmptyDiscoveryFormValues());
ToastCommands.createToast({
type: 'success',
- children: <Trans>Discovery application withdrawn</Trans>,
+ children: <Trans>Application to Explore withdrawn</Trans>,
});
} catch (err) {
logger.error('Failed to withdraw discovery application', err);
@@ -329,10 +329,10 @@ const GuildDiscoveryTab: React.FC<{guildId: string}> = ({guildId}) => {
<div className={styles.container} data-flx="guild.guild-tabs.guild-discovery-tab.container">
<div className={styles.header} data-flx="guild.guild-tabs.guild-discovery-tab.header">
<h2 className={styles.title} data-flx="guild.guild-tabs.guild-discovery-tab.title">
- <Trans>Discovery</Trans>
+ <Trans>Explore</Trans>
</h2>
<p className={styles.subtitle} data-flx="guild.guild-tabs.guild-discovery-tab.subtitle">
- <Trans>List your community in Discovery so others can find and join it.</Trans>
+ <Trans>List your community in Explore so others can find and join it.</Trans>
</p>
</div>
{!eligible && canApply && (
@@ -350,7 +350,7 @@ const GuildDiscoveryTab: React.FC<{guildId: string}> = ({guildId}) => {
<Trans>Not enough members</Trans>
</p>
<p className={styles.warningText} data-flx="guild.guild-tabs.guild-discovery-tab.warning-text">
- <Trans comment="Warning in the community Discovery settings tab when the community is below the minimum size. The plural count is the minimum number of members required to be listed.">
+ <Trans comment="Warning in the Explore tab in community settings when the community is below the minimum size. The plural count is the minimum number of members required to be listed.">
Your community needs at least{' '}
<Plural
value={minMemberCount}
@@ -358,7 +358,7 @@ const GuildDiscoveryTab: React.FC<{guildId: string}> = ({guildId}) => {
other="# members"
data-flx="guild.guild-tabs.guild-discovery-tab.min-member-count.plural"
/>{' '}
- before it can be listed in Discovery.
+ before it can be listed in Explore.
</Trans>
</p>
</div>
@@ -392,8 +392,7 @@ const GuildDiscoveryTab: React.FC<{guildId: string}> = ({guildId}) => {
</div>
<p className={styles.infoText} data-flx="guild.guild-tabs.guild-discovery-tab.info-text">
<Trans>
- Your community is listed in Discovery. You can update your listing details below or withdraw to remove
- it.
+ Your community is listed in Explore. You can update your listing details below or withdraw to remove it.
</Trans>
</p>
</div>
@@ -507,7 +506,7 @@ const GuildDiscoveryTab: React.FC<{guildId: string}> = ({guildId}) => {
data-flx="guild.guild-tabs.guild-discovery-tab.controller--3"
/>
<p className={styles.helpText} data-flx="guild.guild-tabs.guild-discovery-tab.help-text--2">
- <Trans>The language most of your community speaks. Used to filter Discovery results.</Trans>
+ <Trans>The language most of your community speaks. It's used to filter results in Explore.</Trans>
</p>
</div>
<div data-flx="guild.guild-tabs.guild-discovery-tab.div--4">
@@ -555,27 +554,29 @@ const GuildDiscoveryTab: React.FC<{guildId: string}> = ({guildId}) => {
};
return (
<div className={styles.tagsField} data-flx="guild.guild-tabs.guild-discovery-tab.tags-field">
- <div className={styles.tagsList} data-flx="guild.guild-tabs.guild-discovery-tab.tags-list">
- {tags.map((tag) => (
- <span
- key={tag}
- className={styles.tagChip}
- data-flx="guild.guild-tabs.guild-discovery-tab.tag-chip"
- >
- {tag}
- <button
- type="button"
- aria-label={i18n._(REMOVE_TAG_DESCRIPTOR, {tag})}
- className={styles.tagChipRemove}
- onClick={() => removeTag(tag)}
- disabled={!eligible && canApply}
- data-flx="guild.guild-tabs.guild-discovery-tab.tag-chip-remove.remove-tag.button"
+ {tags.length > 0 && (
+ <div className={styles.tagsList} data-flx="guild.guild-tabs.guild-discovery-tab.tags-list">
+ {tags.map((tag) => (
+ <span
+ key={tag}
+ className={styles.tagChip}
+ data-flx="guild.guild-tabs.guild-discovery-tab.tag-chip"
>
- ×
- </button>
- </span>
- ))}
- </div>
+ {tag}
+ <button
+ type="button"
+ aria-label={i18n._(REMOVE_TAG_DESCRIPTOR, {tag})}
+ className={styles.tagChipRemove}
+ onClick={() => removeTag(tag)}
+ disabled={!eligible && canApply}
+ data-flx="guild.guild-tabs.guild-discovery-tab.tag-chip-remove.remove-tag.button"
+ >
+ ×
+ </button>
+ </span>
+ ))}
+ </div>
+ )}
<div
className={styles.tagsInputRow}
data-flx="guild.guild-tabs.guild-discovery-tab.tags-input-row"
@@ -598,7 +599,6 @@ const GuildDiscoveryTab: React.FC<{guildId: string}> = ({guildId}) => {
/>
<Button
type="button"
- small
variant="secondary"
onClick={() => addTag(tagInput)}
disabled={
@@ -616,7 +616,8 @@ const GuildDiscoveryTab: React.FC<{guildId: string}> = ({guildId}) => {
/>
<p className={styles.helpText} data-flx="guild.guild-tabs.guild-discovery-tab.help-text--3">
<Trans>
- Up to {DISCOVERY_MAX_TAGS} tags help people find your community. They show up in Discovery search.
+ Up to {DISCOVERY_MAX_TAGS} tags help people find your community. They show up when people search in
+ Explore.
</Trans>
</p>
</div>
diff --git a/fluxer_app/src/features/guild/components/modals/guild_tabs/GuildModerationTab.tsx b/fluxer_app/src/features/guild/components/modals/guild_tabs/GuildModerationTab.tsx
index 02ed15bb1..0a146f04c 100644
--- a/fluxer_app/src/features/guild/components/modals/guild_tabs/GuildModerationTab.tsx
+++ b/fluxer_app/src/features/guild/components/modals/guild_tabs/GuildModerationTab.tsx
@@ -320,8 +320,8 @@ const GuildModerationTab: React.FC<{guildId: string}> = observer(({guildId}) =>
data-flx="guild.guild-tabs.guild-moderation-tab.section-description--verification-discovery"
>
<Trans>
- Communities listed in Discovery require at least email verification. None cannot be selected while
- Discovery is enabled.
+ Communities listed in Explore need at least email verification. You can't pick "None" while your
+ community is listed in Explore.
</Trans>
</p>
)}
@@ -360,8 +360,8 @@ const GuildModerationTab: React.FC<{guildId: string}> = observer(({guildId}) =>
data-flx="guild.guild-tabs.guild-moderation-tab.section-description--2"
>
<Trans>
- Communities listed in Discovery are required to scan messages from all members. This setting cannot be
- changed while Discovery is enabled.
+ Communities listed in Explore must scan messages from all members. You can't change this setting while
+ your community is listed in Explore.
</Trans>
</p>
)}