refactor: move user-related data to appStore

This commit is contained in:
VardanHakobyan
2021-06-16 17:00:13 +04:00
parent 018251838c
commit c897199d33
5 changed files with 10 additions and 31 deletions

View File

@@ -2,19 +2,19 @@ import { observer } from 'mobx-react-lite';
import { AppState } from '@/ui_models/app_state';
import { PasswordWizardType } from '@/types';
import { WebApplication } from '@/ui_models/application';
import { User } from '@standardnotes/snjs/dist/@types/services/api/responses';
type Props = {
email: string;
appState: AppState;
application: WebApplication;
}
const User = observer(({
email,
appState,
application,
}: Props) => {
const { server, closeAccountMenu } = appState.accountMenu;
const user = application.getUser();
const openPasswordWizard = () => {
closeAccountMenu();
@@ -48,7 +48,7 @@ const User = observer(({
<div className="sk-panel-row">
<div className="sk-panel-column">
<div className="sk-h1 sk-bold wrap">
{email}
{(user as User).email}
</div>
<div className="sk-subtitle neutral">
{server}