refactor: migrate account-menu to react - initial UI
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user