diff --git a/.eslintrc.js b/.eslintrc.js index a067e275..14f816be 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -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: { diff --git a/src/components/main/Header/index.tsx b/src/components/main/Header/index.tsx index 8200056d..0d4302dc 100644 --- a/src/components/main/Header/index.tsx +++ b/src/components/main/Header/index.tsx @@ -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 mapDispatchToProps & {}; -const HeaderUnconnected: React.FunctionComponent = ({ - username, - is_user -}) => ( +const HeaderUnconnected: React.FunctionComponent = ({ username, is_user }) => (
@@ -36,10 +33,19 @@ const HeaderUnconnected: React.FunctionComponent = ({ - -
username
-
- + {is_user && ( + +
{username}
+
+ + )} + + {!is_user && ( + +
ВДОХНУТЬ
+
+ + )}
); diff --git a/src/redux/auth/selectors.ts b/src/redux/auth/selectors.ts index bd379d2b..e1f8ad29 100644 --- a/src/redux/auth/selectors.ts +++ b/src/redux/auth/selectors.ts @@ -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; diff --git a/src/redux/node/constants.ts b/src/redux/node/constants.ts index 9f0760a9..331c2934 100644 --- a/src/redux/node/constants.ts +++ b/src/redux/node/constants.ts @@ -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, - } + }, }, };