mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-24 20:36:40 +07:00
eslint
This commit is contained in:
parent
d9a56255c5
commit
9a8e5efd1a
4 changed files with 27 additions and 12 deletions
|
@ -49,6 +49,13 @@ module.exports = {
|
|||
// 'max-len': { "code": 100 },
|
||||
'max-len': ["warn", { "code": 100 }],
|
||||
"template-curly-spacing": "off",
|
||||
"comma-dangle": ["warn", {
|
||||
"arrays": "never",
|
||||
"objects": "always",
|
||||
"imports": "never",
|
||||
"exports": "never",
|
||||
"functions": "never"
|
||||
}],
|
||||
indent: "off"
|
||||
},
|
||||
globals: {
|
||||
|
|
|
@ -6,7 +6,7 @@ import { Logo } from '~/components/main/Logo';
|
|||
|
||||
import * as style from './style.scss';
|
||||
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';
|
||||
|
||||
const mapStateToProps = selectUser;
|
||||
|
@ -17,10 +17,7 @@ const mapDispatchToProps = {
|
|||
|
||||
type IProps = ReturnType<typeof mapStateToProps> & typeof mapDispatchToProps & {};
|
||||
|
||||
const HeaderUnconnected: React.FunctionComponent<IProps> = ({
|
||||
username,
|
||||
is_user
|
||||
}) => (
|
||||
const HeaderUnconnected: React.FunctionComponent<IProps> = ({ username, is_user }) => (
|
||||
<div className="default_container head_container">
|
||||
<div className={style.container}>
|
||||
<Logo />
|
||||
|
@ -36,10 +33,19 @@ const HeaderUnconnected: React.FunctionComponent<IProps> = ({
|
|||
|
||||
<Filler />
|
||||
|
||||
<Group horizontal className={style.user_button}>
|
||||
<div>username</div>
|
||||
<div className={style.user_avatar} />
|
||||
</Group>
|
||||
{is_user && (
|
||||
<Group horizontal className={style.user_button}>
|
||||
<div>{username}</div>
|
||||
<div className={style.user_avatar} />
|
||||
</Group>
|
||||
)}
|
||||
|
||||
{!is_user && (
|
||||
<Group horizontal className={style.user_button}>
|
||||
<div>ВДОХНУТЬ</div>
|
||||
<div className={style.user_avatar} />
|
||||
</Group>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
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 selectToken = (state: IState): IState['auth']['token'] => state.auth.token;
|
||||
export const selectAuthLogin = (state: IState): IState['auth']['login'] => state.auth.login;
|
||||
|
|
|
@ -2,8 +2,9 @@ import { IBlock, INode } from '../types';
|
|||
|
||||
export const EMPTY_BLOCK: IBlock = {
|
||||
type: null,
|
||||
temp_ids: [],
|
||||
attaches: [],
|
||||
files: [],
|
||||
content: null,
|
||||
embeds: [],
|
||||
};
|
||||
|
||||
export const EMPTY_NODE: INode = {
|
||||
|
@ -23,6 +24,6 @@ export const EMPTY_NODE: INode = {
|
|||
flow: {
|
||||
display: 'single',
|
||||
show_description: false,
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue