Hide electron-only settings

This commit is contained in:
jeffvli
2022-11-20 05:20:19 -08:00
parent 44ffe1984b
commit 2cb54a068a
2 changed files with 8 additions and 5 deletions
@@ -1,4 +1,5 @@
import { Divider, Stack } from '@mantine/core'; import { Divider, Stack } from '@mantine/core';
import isElectron from 'is-electron';
import { Switch, Select } from '@/renderer/components'; import { Switch, Select } from '@/renderer/components';
import { SettingsOptions } from '@/renderer/features/settings/components/settings-option'; import { SettingsOptions } from '@/renderer/features/settings/components/settings-option';
import { THEME_DATA } from '@/renderer/hooks'; import { THEME_DATA } from '@/renderer/hooks';
@@ -41,7 +42,7 @@ export const GeneralTab = () => {
<Select disabled data={['Windows', 'macOS']} defaultValue="Windows" /> <Select disabled data={['Windows', 'macOS']} defaultValue="Windows" />
), ),
description: 'Adjust the style of the titlebar', description: 'Adjust the style of the titlebar',
isHidden: false, isHidden: !isElectron(),
title: 'Titlebar style', title: 'Titlebar style',
}, },
{ {
@@ -172,9 +173,11 @@ export const GeneralTab = () => {
return ( return (
<Stack spacing="xl"> <Stack spacing="xl">
{options.map((option) => ( {options
<SettingsOptions key={`general-${option.title}`} {...option} /> .filter((o) => !o.isHidden)
))} .map((option) => (
<SettingsOptions key={`general-${option.title}`} {...option} />
))}
<Divider /> <Divider />
{themeOptions {themeOptions
.filter((o) => !o.isHidden) .filter((o) => !o.isHidden)
@@ -290,7 +290,7 @@ export const PlaybackTab = () => {
), ),
description: description:
'Enable or disable the usage of your system media hotkeys to control the audio player (desktop only)', 'Enable or disable the usage of your system media hotkeys to control the audio player (desktop only)',
isHidden: false, isHidden: !isElectron(),
title: 'Global media hotkeys', title: 'Global media hotkeys',
}, },
]; ];