mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
* feat(settings): add expanded video auto-unmute preference * fix(translations): add missing unmute labels * fix(translations): localize unmute label
26 lines
750 B
TypeScript
26 lines
750 B
TypeScript
import { create } from 'zustand';
|
|
import { persist } from 'zustand/middleware';
|
|
|
|
interface ExpandedMediaState {
|
|
fitExpandedImagesToScreen: boolean;
|
|
unmuteExpandedVideoSound: boolean;
|
|
setFitExpandedImagesToScreen: (fit: boolean) => void;
|
|
setUnmuteExpandedVideoSound: (unmute: boolean) => void;
|
|
}
|
|
|
|
const useExpandedMediaStore = create<ExpandedMediaState>()(
|
|
persist(
|
|
(set) => ({
|
|
fitExpandedImagesToScreen: false,
|
|
unmuteExpandedVideoSound: false,
|
|
setFitExpandedImagesToScreen: (fit) => set({ fitExpandedImagesToScreen: fit }),
|
|
setUnmuteExpandedVideoSound: (unmute) => set({ unmuteExpandedVideoSound: unmute }),
|
|
}),
|
|
{
|
|
name: 'expanded-media-store',
|
|
},
|
|
),
|
|
);
|
|
|
|
export default useExpandedMediaStore;
|