refactor: read the required data from appState instead of passing by parent component

This commit is contained in:
VardanHakobyan
2021-06-16 16:20:23 +04:00
parent 17515848b4
commit 018251838c
4 changed files with 8 additions and 27 deletions

View File

@@ -18,16 +18,12 @@ import { AppState } from '@/ui_models/app_state';
type Props = {
application: WebApplication;
appState: AppState;
closeAccountMenu: () => void;
notesAndTagsCount: number;
user: User | undefined;
}
const Authentication = observer(({
application,
appState,
closeAccountMenu,
notesAndTagsCount,
user
}: Props) => {
@@ -45,11 +41,13 @@ const Authentication = observer(({
const {
server,
notesAndTagsCount,
showLogin,
showRegister,
setShowLogin,
setShowRegister,
setServer
setServer,
closeAccountMenu
} = appState.accountMenu;
useEffect(() => {