typed some components

This commit is contained in:
muerwre 2019-02-21 14:54:00 +07:00
parent a3f7fd9b46
commit a5126aff4a
7 changed files with 23 additions and 31 deletions

View file

@ -3,7 +3,7 @@ import * as React from 'react';
import { Icon } from '$components/panels/Icon';
type Props = {
onClick: Function,
onClick: () => void,
}
export const GuestButton = ({ onClick }: Props) => (

View file

@ -1,17 +1,17 @@
// @flow
import * as React from 'react';
import { UserPicture } from '$components/user/UserPicture';
import { IUser } from '$constants/auth';
import { IUser } from "$constants/auth";
type Props = {
interface Props {
user: IUser,
setMenuOpened: Function,
};
setMenuOpened: () => void,
}
export const UserButton = ({
setMenuOpened,
user: {
_id,
id,
photo,
first_name,
}
@ -21,8 +21,8 @@ export const UserButton = ({
<UserPicture photo={photo} />
<div className="user-button-fields">
<div className="user-button-name">{(first_name || _id || '...')}</div>
<div className="user-button-text">{(_id || 'пользователь')}</div>
<div className="user-button-name">{(first_name || id || '...')}</div>
<div className="user-button-text">{(id || 'пользователь')}</div>
</div>
</div>
</div>

View file

@ -1,9 +1,10 @@
import * as React from 'react';
import { APP_INFO } from '$constants/app_info';
import { userLogout } from "$redux/user/actions";
type Props = {
userLogout: Function,
openAppInfoDialog: Function,
interface Props {
userLogout: typeof userLogout,
openAppInfoDialog: () => void,
}
export const UserMenu = ({ userLogout, openAppInfoDialog }: Props) => (
@ -13,7 +14,7 @@ export const UserMenu = ({ userLogout, openAppInfoDialog }: Props) => (
<br />
MAP
<span className="user-panel-ver">
- {(APP_INFO.VERSION || 1)}.{(APP_INFO.RELEASE.length || 0)}
- {(APP_INFO.VERSION || 1)}.{(Object.keys(APP_INFO.CHANGELOG).length || 0)}
</span>
</div>
<div className="user-panel-item" onClick={openAppInfoDialog}>