feat(OneClient-SettingsRow): optional settings icon (#475)
* feat(OneClient-SettingsRow): optional settings icon * fix: building
This commit is contained in:
parent
682a08765b
commit
29adbbc541
2 changed files with 7 additions and 12 deletions
|
|
@ -3,7 +3,7 @@ import type { JSX } from 'react';
|
|||
export interface SettingsRowProps {
|
||||
title: JSX.Element | string;
|
||||
description: JSX.Element | string;
|
||||
icon: JSX.Element;
|
||||
icon?: JSX.Element;
|
||||
disabled?: boolean;
|
||||
children?: JSX.Element;
|
||||
}
|
||||
|
|
@ -16,9 +16,11 @@ export function SettingsRow({ disabled, description, icon, title, children }: Se
|
|||
${disabled ? 'bg-component-bg-disabled' : 'bg-page-elevated hover:bg-component-bg-hover'}
|
||||
`}
|
||||
>
|
||||
<div className="flex h-8 w-8 items-center justify-center">
|
||||
{icon}
|
||||
</div>
|
||||
{icon && (
|
||||
<div className="flex h-8 w-8 items-center justify-center">
|
||||
{icon}
|
||||
</div>
|
||||
)}
|
||||
|
||||
<div className="flex flex-1 flex-col gap-2">
|
||||
<p className="text-lg capitalize leading-tight">{title}</p>
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@ import { bindings } from '@/main';
|
|||
import { Sidebar } from '@/routes/app/settings/route';
|
||||
import { Button } from '@onelauncher/common/components';
|
||||
import { createFileRoute, Link } from '@tanstack/react-router';
|
||||
import { BatteryEmptyIcon, BatteryFullIcon, Code02Icon, FileHeart02Icon, Truck01Icon } from '@untitled-theme/icons-react';
|
||||
|
||||
export const Route = createFileRoute('/app/settings/developer')({
|
||||
component: RouteComponent,
|
||||
|
|
@ -20,7 +19,6 @@ function RouteComponent() {
|
|||
|
||||
<SettingsRow
|
||||
description="Open Debug Info"
|
||||
icon={<FileHeart02Icon />}
|
||||
title="Open Debug Info"
|
||||
>
|
||||
<Overlay.Trigger>
|
||||
|
|
@ -35,14 +33,12 @@ function RouteComponent() {
|
|||
<SettingsRow.Header>Dev Tools</SettingsRow.Header>
|
||||
<SettingsRow
|
||||
description="Enable The Tanstack Dev Tools"
|
||||
icon={<Code02Icon />}
|
||||
title="Tanstack Dev Tools"
|
||||
>
|
||||
<SettingsSwitch setting={createSetting('show_tanstack_dev_tools')} />
|
||||
</SettingsRow>
|
||||
<SettingsRow
|
||||
description="Open Dev Tools"
|
||||
icon={<Code02Icon />}
|
||||
title="Open Dev Tools"
|
||||
>
|
||||
<Button onPress={bindings.debug.openDevTools} size="normal">Open</Button>
|
||||
|
|
@ -51,7 +47,6 @@ function RouteComponent() {
|
|||
<SettingsRow.Header>Onboarding</SettingsRow.Header>
|
||||
<SettingsRow
|
||||
description="Open Onboarding"
|
||||
icon={<Truck01Icon />}
|
||||
title="Open Onboarding"
|
||||
>
|
||||
<Link to="/onboarding">
|
||||
|
|
@ -60,21 +55,19 @@ function RouteComponent() {
|
|||
</SettingsRow>
|
||||
<SettingsRow
|
||||
description="Seen onboarding"
|
||||
icon={<Truck01Icon />}
|
||||
title="Seen Onboarding"
|
||||
>
|
||||
<SettingsSwitch setting={createSetting('seen_onboarding')} />
|
||||
</SettingsRow>
|
||||
<SettingsRow
|
||||
description="Use Grid On Mods List"
|
||||
icon={<BatteryFullIcon />}
|
||||
title="Use Grid On Mods List"
|
||||
>
|
||||
<SettingsSwitch setting={createSetting('mod_list_use_grid')} />
|
||||
</SettingsRow>
|
||||
|
||||
<SettingsRow.Header>Mod Downloading</SettingsRow.Header>
|
||||
<SettingsRow description="Use Parallel Mod Downloading for speed. This can create some issues sometimes" icon={<BatteryEmptyIcon />} title="Use Parallel Mod Downloading">
|
||||
<SettingsRow description="Use Parallel Mod Downloading for speed. This can create some issues sometimes" title="Use Parallel Mod Downloading">
|
||||
<SettingsSwitch setting={createSetting('parallel_mod_downloading')} />
|
||||
</SettingsRow>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue