mirror of
https://github.com/EnixCoda/Gitako.git
synced 2026-03-11 08:54:44 +00:00
feat: disable auto expand in float mode
This commit is contained in:
parent
e7745e10c9
commit
1507206e4a
2 changed files with 6 additions and 2 deletions
|
|
@ -9,6 +9,7 @@ export type SimpleField<Key extends keyof Config> = {
|
|||
wikiLink?: string
|
||||
tooltip?: string
|
||||
description?: string
|
||||
disabled?: boolean
|
||||
overwrite?: {
|
||||
value: (value: Config[Key]) => boolean
|
||||
onChange: (checked: boolean) => Config[Key]
|
||||
|
|
@ -54,6 +55,7 @@ export function SimpleToggleField<Key extends keyof Config>({ field, onChange }:
|
|||
<input
|
||||
id={field.key}
|
||||
name={field.key}
|
||||
disabled={field.disabled}
|
||||
type={'checkbox'}
|
||||
onChange={async e => {
|
||||
const enabled = e.currentTarget.checked
|
||||
|
|
|
|||
|
|
@ -104,10 +104,12 @@ export function SidebarSettings(props: React.PropsWithChildren<Props>) {
|
|||
field={{
|
||||
key: 'intelligentToggle',
|
||||
label: 'Auto expand',
|
||||
disabled: configContext.value.sidebarToggleMode === 'float',
|
||||
tooltip:
|
||||
'Gitako will expand when exploring source files, pull requests, etc. And collapse otherwise.',
|
||||
'Gitako will expand when exploring source files, pull requests, etc. And collapse otherwise. Will be disabled when "Dock sidebar on expand" is disabled.',
|
||||
overwrite: {
|
||||
value: enabled => enabled === null,
|
||||
value: enabled =>
|
||||
configContext.value.sidebarToggleMode === 'float' ? false : enabled === null,
|
||||
onChange: checked => (checked ? null : true),
|
||||
},
|
||||
}}
|
||||
|
|
|
|||
Loading…
Reference in a new issue