feat: Nativize "No distraction" theme as "Focus Mode" (#758)
Co-authored-by: Mo Bitar <me@bitar.io>
This commit is contained in:
@@ -3,14 +3,17 @@ import { action, makeObservable, observable } from 'mobx';
|
||||
export class QuickSettingsState {
|
||||
open = false;
|
||||
shouldAnimateCloseMenu = false;
|
||||
focusModeEnabled = false;
|
||||
|
||||
constructor() {
|
||||
makeObservable(this, {
|
||||
open: observable,
|
||||
shouldAnimateCloseMenu: observable,
|
||||
focusModeEnabled: observable,
|
||||
|
||||
setOpen: action,
|
||||
setShouldAnimateCloseMenu: action,
|
||||
setFocusModeEnabled: action,
|
||||
toggle: action,
|
||||
closeQuickSettingsMenu: action,
|
||||
});
|
||||
@@ -24,6 +27,10 @@ export class QuickSettingsState {
|
||||
this.shouldAnimateCloseMenu = shouldAnimate;
|
||||
};
|
||||
|
||||
setFocusModeEnabled = (enabled: boolean): void => {
|
||||
this.focusModeEnabled = enabled;
|
||||
};
|
||||
|
||||
toggle = (): void => {
|
||||
if (this.open) {
|
||||
this.closeQuickSettingsMenu();
|
||||
|
||||
Reference in New Issue
Block a user