mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-04-05 16:51:01 +00:00
feat(Settings): added gamepad support toggle
This commit is contained in:
parent
3ef25d0346
commit
c97c41f11c
3 changed files with 29 additions and 0 deletions
|
|
@ -31,6 +31,7 @@ const Settings = () => {
|
|||
const toast = useToast();
|
||||
const {
|
||||
interfaceLanguageSelect,
|
||||
gamepadSupportToggle,
|
||||
hideSpoilersToggle,
|
||||
subtitlesLanguageSelect,
|
||||
subtitlesSizeSelect,
|
||||
|
|
@ -352,6 +353,16 @@ const Settings = () => {
|
|||
{...hideSpoilersToggle}
|
||||
/>
|
||||
</div>
|
||||
<div className={styles['option-container']}>
|
||||
<div className={styles['option-name-container']}>
|
||||
<div className={styles['label']}>{ t('SETTINGS_GAMEPAD') }</div>
|
||||
</div>
|
||||
<Toggle
|
||||
className={classnames(styles['option-input-container'], styles['toggle-container'])}
|
||||
tabIndex={-1}
|
||||
{...gamepadSupportToggle}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div ref={playerSectionRef} className={styles['section-container']}>
|
||||
<div className={styles['section-title']}>{ t('SETTINGS_NAV_PLAYER') }</div>
|
||||
|
|
|
|||
|
|
@ -32,6 +32,22 @@ const useProfileSettingsInputs = (profile) => {
|
|||
}
|
||||
}), [profile.settings]);
|
||||
|
||||
const gamepadSupportToggle = React.useMemo(() => ({
|
||||
checked: profile.settings.gamepadSupport,
|
||||
onClick: () => {
|
||||
core.transport.dispatch({
|
||||
action: 'Ctx',
|
||||
args: {
|
||||
action: 'UpdateSettings',
|
||||
args: {
|
||||
...profile.settings,
|
||||
gamepadSupport: !profile.settings.gamepadSupport
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}), [profile.settings]);
|
||||
|
||||
const hideSpoilersToggle = React.useMemo(() => ({
|
||||
checked: profile.settings.hideSpoilers,
|
||||
onClick: () => {
|
||||
|
|
@ -341,6 +357,7 @@ const useProfileSettingsInputs = (profile) => {
|
|||
}), [profile.settings]);
|
||||
return {
|
||||
interfaceLanguageSelect,
|
||||
gamepadSupportToggle,
|
||||
hideSpoilersToggle,
|
||||
subtitlesLanguageSelect,
|
||||
subtitlesSizeSelect,
|
||||
|
|
|
|||
1
src/types/models/Ctx.d.ts
vendored
1
src/types/models/Ctx.d.ts
vendored
|
|
@ -22,6 +22,7 @@ type Settings = {
|
|||
escExitFullscreen: boolean,
|
||||
interfaceLanguage: string,
|
||||
hideSpoilers: boolean,
|
||||
gamepadSupport: boolean,
|
||||
nextVideoNotificationDuration: number,
|
||||
playInBackground: boolean,
|
||||
playerType: string | null,
|
||||
|
|
|
|||
Loading…
Reference in a new issue