mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-04-21 11:42:05 +00:00
feat(Settings): added blurUnwatchedImage prop to profile settings
This commit is contained in:
parent
45f8afea91
commit
baf3a92693
3 changed files with 29 additions and 0 deletions
|
|
@ -31,6 +31,7 @@ const Settings = () => {
|
||||||
const toast = useToast();
|
const toast = useToast();
|
||||||
const {
|
const {
|
||||||
interfaceLanguageSelect,
|
interfaceLanguageSelect,
|
||||||
|
blurUnwatchedImageToggle,
|
||||||
subtitlesLanguageSelect,
|
subtitlesLanguageSelect,
|
||||||
subtitlesSizeSelect,
|
subtitlesSizeSelect,
|
||||||
subtitlesTextColorInput,
|
subtitlesTextColorInput,
|
||||||
|
|
@ -502,6 +503,16 @@ const Settings = () => {
|
||||||
{...playInExternalPlayerSelect}
|
{...playInExternalPlayerSelect}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
<div className={styles['option-container']}>
|
||||||
|
<div className={styles['option-name-container']}>
|
||||||
|
<div className={styles['label']}>{ t('SETTINGS_BLUR_UNWATCHED_IMAGE') }</div>
|
||||||
|
</div>
|
||||||
|
<Toggle
|
||||||
|
className={classnames(styles['option-input-container'], styles['toggle-container'])}
|
||||||
|
tabIndex={-1}
|
||||||
|
{...blurUnwatchedImageToggle}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
{
|
{
|
||||||
shell.active &&
|
shell.active &&
|
||||||
<div className={styles['option-container']}>
|
<div className={styles['option-container']}>
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,22 @@ const useProfileSettingsInputs = (profile) => {
|
||||||
}
|
}
|
||||||
}), [profile.settings]);
|
}), [profile.settings]);
|
||||||
|
|
||||||
|
const blurUnwatchedImageToggle = React.useMemo(() => ({
|
||||||
|
checked: profile.settings.blurUnwatchedImage,
|
||||||
|
onClick: () => {
|
||||||
|
core.transport.dispatch({
|
||||||
|
action: 'Ctx',
|
||||||
|
args: {
|
||||||
|
action: 'UpdateSettings',
|
||||||
|
args: {
|
||||||
|
...profile.settings,
|
||||||
|
blurUnwatchedImage: !profile.settings.blurUnwatchedImage
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}), [profile.settings]);
|
||||||
|
|
||||||
const quitOnCloseToggle = React.useMemo(() => ({
|
const quitOnCloseToggle = React.useMemo(() => ({
|
||||||
checked: profile.settings.quitOnClose,
|
checked: profile.settings.quitOnClose,
|
||||||
onClick: () => {
|
onClick: () => {
|
||||||
|
|
@ -325,6 +341,7 @@ const useProfileSettingsInputs = (profile) => {
|
||||||
}), [profile.settings]);
|
}), [profile.settings]);
|
||||||
return {
|
return {
|
||||||
interfaceLanguageSelect,
|
interfaceLanguageSelect,
|
||||||
|
blurUnwatchedImageToggle,
|
||||||
subtitlesLanguageSelect,
|
subtitlesLanguageSelect,
|
||||||
subtitlesSizeSelect,
|
subtitlesSizeSelect,
|
||||||
subtitlesTextColorInput,
|
subtitlesTextColorInput,
|
||||||
|
|
|
||||||
1
src/types/models/Ctx.d.ts
vendored
1
src/types/models/Ctx.d.ts
vendored
|
|
@ -21,6 +21,7 @@ type Settings = {
|
||||||
hardwareDecoding: boolean,
|
hardwareDecoding: boolean,
|
||||||
escExitFullscreen: boolean,
|
escExitFullscreen: boolean,
|
||||||
interfaceLanguage: string,
|
interfaceLanguage: string,
|
||||||
|
blurUnwatchedImage: boolean,
|
||||||
nextVideoNotificationDuration: number,
|
nextVideoNotificationDuration: number,
|
||||||
playInBackground: boolean,
|
playInBackground: boolean,
|
||||||
playerType: string | null,
|
playerType: string | null,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue