mirror of
https://github.com/fluxerapp/fluxer
synced 2026-10-17 13:05:32 +09:00
fix(app): let hidden sidebar buttons be shown again (#3061)
This commit is contained in:
1 parent
12bfaa83ba
commit
ab4069ed0e
39 files changed
+3471
-2315
No files matched your search
@@ -8,7 +8,9 @@ import {
|
||||
VideoSeekThumbnailsControl,
|
||||
} from '@app/features/user/components/modals/tabs/advanced_settings_tab/AdvancedAccessibilityControls';
|
||||
import {
|
||||
DownloadButtonControl,
|
||||
FavoritesControl,
|
||||
HelpCenterButtonControl,
|
||||
HideKeyboardHintsControl,
|
||||
KeepNekoStillControl,
|
||||
ShowNekoControl,
|
||||
@@ -67,6 +69,8 @@ export const DIRECT_CONTROL_ITEM_IDS = new Set([
|
||||
'appearance-hide-keyboard-hints',
|
||||
'appearance-voice-channel-join-behavior',
|
||||
'appearance-enable-favorites',
|
||||
'appearance-show-help-center-button',
|
||||
'appearance-show-download-button',
|
||||
'chat-settings-auto-send-gifs',
|
||||
'chat-settings-save-gif-favorites',
|
||||
'chat-settings-message-action-bar',
|
||||
@@ -114,6 +118,8 @@ export const COMPACT_SWITCH_CONTROL_ITEM_IDS = new Set([
|
||||
'appearance-keep-neko-still',
|
||||
'appearance-hide-keyboard-hints',
|
||||
'appearance-enable-favorites',
|
||||
'appearance-show-help-center-button',
|
||||
'appearance-show-download-button',
|
||||
'chat-settings-auto-send-gifs',
|
||||
'chat-settings-save-gif-favorites',
|
||||
'chat-settings-strip-tracking',
|
||||
@@ -175,6 +181,14 @@ export const AdvancedSettingControl = observer(({item}: {item: SearchableSetting
|
||||
return (
|
||||
<FavoritesControl data-flx="user.advanced-setting-direct-controls.advanced-setting-control.favorites-control" />
|
||||
);
|
||||
case 'appearance-show-help-center-button':
|
||||
return (
|
||||
<HelpCenterButtonControl data-flx="user.advanced-setting-direct-controls.advanced-setting-control.help-center-button-control" />
|
||||
);
|
||||
case 'appearance-show-download-button':
|
||||
return (
|
||||
<DownloadButtonControl data-flx="user.advanced-setting-direct-controls.advanced-setting-control.download-button-control" />
|
||||
);
|
||||
case 'chat-settings-auto-send-gifs':
|
||||
return (
|
||||
<AutoSendGifsControl data-flx="user.advanced-setting-direct-controls.advanced-setting-control.auto-send-gifs-control" />
|
||||
|
||||
+31
@@ -2,12 +2,15 @@
|
||||
|
||||
import * as AccessibilityCommands from '@app/features/accessibility/commands/AccessibilityCommands';
|
||||
import Accessibility from '@app/features/accessibility/state/Accessibility';
|
||||
import HiddenGuildListButtons from '@app/features/guild/state/HiddenGuildListButtons';
|
||||
import {Switch} from '@app/features/ui/components/form/FormSwitch';
|
||||
import {SwitchGroup, SwitchGroupItem} from '@app/features/ui/components/SwitchGroup';
|
||||
import {
|
||||
ENABLE_FAVORITES_DESCRIPTOR,
|
||||
KEEP_NEKO_STILL_DESCRIPTOR,
|
||||
KEYBOARD_HINTS_DESCRIPTOR,
|
||||
SHOW_DOWNLOAD_BUTTON_DESCRIPTOR,
|
||||
SHOW_HELP_CENTER_BUTTON_DESCRIPTOR,
|
||||
SHOW_NEKO_DESCRIPTOR,
|
||||
} from '@app/features/user/components/settings_utils/section_registry/SharedDescriptors';
|
||||
import {msg} from '@lingui/core/macro';
|
||||
@@ -95,3 +98,31 @@ export const FavoritesControl = observer(() => {
|
||||
/>
|
||||
);
|
||||
});
|
||||
|
||||
export const HelpCenterButtonControl = observer(() => {
|
||||
const {i18n} = useLingui();
|
||||
return (
|
||||
<Switch
|
||||
ariaLabel={i18n._(SHOW_HELP_CENTER_BUTTON_DESCRIPTOR)}
|
||||
value={!HiddenGuildListButtons.helpButtonHidden}
|
||||
onChange={(value) => (value ? HiddenGuildListButtons.showHelpButton() : HiddenGuildListButtons.hideHelpButton())}
|
||||
compact
|
||||
data-flx="user.advanced-settings-tab.switch.help-center-button"
|
||||
/>
|
||||
);
|
||||
});
|
||||
|
||||
export const DownloadButtonControl = observer(() => {
|
||||
const {i18n} = useLingui();
|
||||
return (
|
||||
<Switch
|
||||
ariaLabel={i18n._(SHOW_DOWNLOAD_BUTTON_DESCRIPTOR)}
|
||||
value={!HiddenGuildListButtons.downloadButtonHidden}
|
||||
onChange={(value) =>
|
||||
value ? HiddenGuildListButtons.showDownloadButton() : HiddenGuildListButtons.hideDownloadButton()
|
||||
}
|
||||
compact
|
||||
data-flx="user.advanced-settings-tab.switch.download-button"
|
||||
/>
|
||||
);
|
||||
});
|
||||
+40
@@ -1,6 +1,7 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
import {VOICE_CHANNEL_DESCRIPTOR} from '@app/features/i18n/utils/CommonMessageDescriptors';
|
||||
import {Platform} from '@app/features/platform/types/Platform';
|
||||
import type {SearchableSettingDescriptor} from '@app/features/user/components/settings_utils/search_index/SearchIndexTypes';
|
||||
import {
|
||||
CHAT_INPUT_DESCRIPTOR,
|
||||
@@ -8,6 +9,8 @@ import {
|
||||
KEEP_NEKO_STILL_DESCRIPTOR,
|
||||
KEYBOARD_HINTS_DESCRIPTOR,
|
||||
NEKO_DESCRIPTOR,
|
||||
SHOW_DOWNLOAD_BUTTON_DESCRIPTOR,
|
||||
SHOW_HELP_CENTER_BUTTON_DESCRIPTOR,
|
||||
SHOW_NEKO_DESCRIPTOR,
|
||||
} from '@app/features/user/components/settings_utils/section_registry/SharedDescriptors';
|
||||
import {msg} from '@lingui/core/macro';
|
||||
@@ -88,6 +91,22 @@ const CHOOSE_WHETHER_FAVORITES_ARE_VISIBLE_THROUGHOUT_THE_APP_DESCRIPTOR = msg({
|
||||
message: 'Show favorites throughout the app',
|
||||
comment: 'Settings search entry description. One-line summary of what the setting controls.',
|
||||
});
|
||||
const HELP_BUTTON_DESCRIPTOR = msg({
|
||||
message: 'Help button',
|
||||
comment: 'Settings search synonym. Used to match this term when the user types it in the settings search bar.',
|
||||
});
|
||||
const DOWNLOAD_APP_DESCRIPTOR = msg({
|
||||
message: 'Download app',
|
||||
comment: 'Settings search synonym. Used to match this term when the user types it in the settings search bar.',
|
||||
});
|
||||
const HELP_CENTER_BUTTON_IN_THE_SIDEBAR_DESCRIPTOR = msg({
|
||||
message: 'Help center button in the sidebar',
|
||||
comment: 'Settings search entry description. One-line summary of what the setting controls.',
|
||||
});
|
||||
const DOWNLOAD_BUTTON_IN_THE_SIDEBAR_DESCRIPTOR = msg({
|
||||
message: 'Download app button in the sidebar',
|
||||
comment: 'Settings search entry description. One-line summary of what the setting controls.',
|
||||
});
|
||||
export const appearanceIndex: Array<SearchableSettingDescriptor> = [
|
||||
{
|
||||
id: 'appearance-show-neko',
|
||||
@@ -129,6 +148,27 @@ export const appearanceIndex: Array<SearchableSettingDescriptor> = [
|
||||
audience: 'advanced',
|
||||
tags: ['appearance'],
|
||||
},
|
||||
{
|
||||
id: 'appearance-show-help-center-button',
|
||||
tabType: 'appearance',
|
||||
sectionId: 'interface',
|
||||
label: SHOW_HELP_CENTER_BUTTON_DESCRIPTOR,
|
||||
keywords: [HELP_BUTTON_DESCRIPTOR],
|
||||
description: HELP_CENTER_BUTTON_IN_THE_SIDEBAR_DESCRIPTOR,
|
||||
audience: 'advanced',
|
||||
tags: ['appearance'],
|
||||
},
|
||||
{
|
||||
id: 'appearance-show-download-button',
|
||||
tabType: 'appearance',
|
||||
sectionId: 'interface',
|
||||
label: SHOW_DOWNLOAD_BUTTON_DESCRIPTOR,
|
||||
keywords: [DOWNLOAD_APP_DESCRIPTOR],
|
||||
description: DOWNLOAD_BUTTON_IN_THE_SIDEBAR_DESCRIPTOR,
|
||||
audience: 'advanced',
|
||||
tags: ['appearance'],
|
||||
isVisible: () => !Platform.isElectron && !Platform.isPWA,
|
||||
},
|
||||
{
|
||||
id: 'appearance-voice-channel-join-behavior',
|
||||
tabType: 'appearance',
|
||||
|
||||
+8
@@ -59,6 +59,14 @@ export const ENABLE_FAVORITES_DESCRIPTOR = msg({
|
||||
message: 'Enable favorites',
|
||||
comment: 'Toggle label and settings search entry for controlling whether favorites are visible throughout the app.',
|
||||
});
|
||||
export const SHOW_HELP_CENTER_BUTTON_DESCRIPTOR = msg({
|
||||
message: 'Show help center button',
|
||||
comment: 'Toggle label and settings search entry for showing the help center button in the sidebar.',
|
||||
});
|
||||
export const SHOW_DOWNLOAD_BUTTON_DESCRIPTOR = msg({
|
||||
message: 'Show download button',
|
||||
comment: 'Toggle label and settings search entry for showing the download app button in the sidebar.',
|
||||
});
|
||||
export const NEKO_DESCRIPTOR = msg({
|
||||
message: 'Neko',
|
||||
comment: 'Settings search synonym. Proper name of the optional cat sprite that chases the cursor.',
|
||||
|
||||
Reference in new issue
Block a user