feat: Nativize "No distraction" theme as "Focus Mode" (#758)

Co-authored-by: Mo Bitar <me@bitar.io>
This commit is contained in:
Aman Harwara
2021-12-02 22:34:57 +05:30
committed by GitHub
parent fbafc136e8
commit 9730006cba
17 changed files with 488 additions and 141 deletions

View File

@@ -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();