1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-04-24 20:36:40 +07:00
This commit is contained in:
muerwre 2019-08-09 14:35:35 +07:00
parent d9a56255c5
commit 9a8e5efd1a
4 changed files with 27 additions and 12 deletions

View file

@ -49,6 +49,13 @@ module.exports = {
// 'max-len': { "code": 100 }, // 'max-len': { "code": 100 },
'max-len': ["warn", { "code": 100 }], 'max-len': ["warn", { "code": 100 }],
"template-curly-spacing": "off", "template-curly-spacing": "off",
"comma-dangle": ["warn", {
"arrays": "never",
"objects": "always",
"imports": "never",
"exports": "never",
"functions": "never"
}],
indent: "off" indent: "off"
}, },
globals: { globals: {

View file

@ -6,7 +6,7 @@ import { Logo } from '~/components/main/Logo';
import * as style from './style.scss'; import * as style from './style.scss';
import { Filler } from '~/components/containers/Filler'; import { Filler } from '~/components/containers/Filler';
import { selectUser } from '~/redux/auth/selectors'; import { selectUser, selectAuthLogin } from '~/redux/auth/selectors';
import { Group } from '~/components/containers/Group'; import { Group } from '~/components/containers/Group';
const mapStateToProps = selectUser; const mapStateToProps = selectUser;
@ -17,10 +17,7 @@ const mapDispatchToProps = {
type IProps = ReturnType<typeof mapStateToProps> & typeof mapDispatchToProps & {}; type IProps = ReturnType<typeof mapStateToProps> & typeof mapDispatchToProps & {};
const HeaderUnconnected: React.FunctionComponent<IProps> = ({ const HeaderUnconnected: React.FunctionComponent<IProps> = ({ username, is_user }) => (
username,
is_user
}) => (
<div className="default_container head_container"> <div className="default_container head_container">
<div className={style.container}> <div className={style.container}>
<Logo /> <Logo />
@ -36,10 +33,19 @@ const HeaderUnconnected: React.FunctionComponent<IProps> = ({
<Filler /> <Filler />
<Group horizontal className={style.user_button}> {is_user && (
<div>username</div> <Group horizontal className={style.user_button}>
<div className={style.user_avatar} /> <div>{username}</div>
</Group> <div className={style.user_avatar} />
</Group>
)}
{!is_user && (
<Group horizontal className={style.user_button}>
<div>ВДОХНУТЬ</div>
<div className={style.user_avatar} />
</Group>
)}
</div> </div>
</div> </div>
); );

View file

@ -1,5 +1,6 @@
import { IState } from '~/redux/store'; import { IState } from '~/redux/store';
export const selectAuth = (state: IState): IState['auth'] => state.auth;
export const selectUser = (state: IState): IState['auth']['user'] => state.auth.user; export const selectUser = (state: IState): IState['auth']['user'] => state.auth.user;
export const selectToken = (state: IState): IState['auth']['token'] => state.auth.token; export const selectToken = (state: IState): IState['auth']['token'] => state.auth.token;
export const selectAuthLogin = (state: IState): IState['auth']['login'] => state.auth.login; export const selectAuthLogin = (state: IState): IState['auth']['login'] => state.auth.login;

View file

@ -2,8 +2,9 @@ import { IBlock, INode } from '../types';
export const EMPTY_BLOCK: IBlock = { export const EMPTY_BLOCK: IBlock = {
type: null, type: null,
temp_ids: [], files: [],
attaches: [], content: null,
embeds: [],
}; };
export const EMPTY_NODE: INode = { export const EMPTY_NODE: INode = {
@ -23,6 +24,6 @@ export const EMPTY_NODE: INode = {
flow: { flow: {
display: 'single', display: 'single',
show_description: false, show_description: false,
} },
}, },
}; };