Skip to content

Commit

Permalink
Remove "reader width" and "page gap" reset button in global settings
Browse files Browse the repository at this point in the history
  • Loading branch information
schroda committed Dec 16, 2024
1 parent b9ea7ab commit b9f512b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { MultiValueButtonDefaultableProps } from '@/modules/core/Core.types.ts';
export const ReaderSettingPageGap = ({
pageGap,
readingMode,
isDefaultable,
onDefault,
updateSetting,
}: Pick<IReaderSettingsWithDefaultFlag, 'pageGap' | 'readingMode'> &
Expand All @@ -33,7 +34,7 @@ export const ReaderSettingPageGap = ({
<SliderInput
label={t('reader.settings.label.page_gap')}
value={t('global.value', { value: pageGap.value, unit: t('global.unit.px') })}
onDefault={onDefault}
onDefault={isDefaultable ? onDefault : undefined}
slotProps={{
slider: {
defaultValue: DEFAULT_READER_SETTINGS.readerWidth.value,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import { ResetButton } from '@/modules/core/components/buttons/ResetButton.tsx';
export const ReaderSettingWidth = ({
readerWidth,
pageScaleMode,
isDefaultable,
onDefault,
updateSetting,
}: Pick<IReaderSettings, 'readerWidth' | 'pageScaleMode'> &
Expand All @@ -40,7 +41,7 @@ export const ReaderSettingWidth = ({
checked={readerWidth.enabled}
onChange={(_, checked) => updateSetting('readerWidth', { ...readerWidth, enabled: checked }, true)}
/>
{onDefault && <ResetButton onClick={onDefault} variant="outlined" />}
{isDefaultable && <ResetButton onClick={onDefault} variant="outlined" />}
</Stack>
{readerWidth.enabled && (
<SliderInput
Expand Down

0 comments on commit b9f512b

Please sign in to comment.