refactor: migrate account-menu to react - initial UI

This commit is contained in:
VardanHakobyan
2021-05-26 22:30:32 +04:00
parent d738594a9c
commit 844b43e2fb
11 changed files with 739 additions and 4 deletions

View File

@@ -0,0 +1,33 @@
import { action, makeObservable, observable } from "mobx";
import { WebApplication } from '@/ui_models/application';
export class AccountMenuState2 {
show = false;
signingOut = false;
constructor(
// private application: WebApplication,
// appEventListeners: (() => void)[]
) {
makeObservable(this, {
show: observable,
signingOut: observable,
setShow: action,
toggleShow: action,
setSigningOut: action,
});
}
setShow = (show: boolean): void => {
this.show = show;
}
setSigningOut = (signingOut: boolean): void => {
this.signingOut = signingOut;
}
toggleShow = (): void => {
this.show = !this.show;
}
}

View File

@@ -21,6 +21,7 @@ import { SyncState } from './sync_state';
import { SearchOptionsState } from './search_options_state';
import { NotesState } from './notes_state';
import { TagsState } from './tags_state';
import { AccountMenuState2 } from '@/ui_models/app_state/account_menu_2_state';
export enum AppStateEvent {
TagChanged,
@@ -61,6 +62,8 @@ export class AppState {
selectedTag?: SNTag;
showBetaWarning: boolean;
readonly accountMenu = new AccountMenuState();
// readonly accountMenu2 = new AccountMenu_2_State();
readonly accountMenu2: AccountMenuState2;
readonly actionsMenu = new ActionsMenuState();
readonly noAccountWarning: NoAccountWarningState;
readonly sync = new SyncState();
@@ -96,6 +99,10 @@ export class AppState {
application,
this.appEventObserverRemovers
);
this.accountMenu2 = new AccountMenuState2(
// application,
// this.appEventObserverRemovers
);
this.searchOptions = new SearchOptionsState(
application,
this.appEventObserverRemovers