From 5cb0791752dea8b00cbeb96032152fe648521dc1 Mon Sep 17 00:00:00 2001 From: Fedor Katurov Date: Mon, 2 Dec 2019 15:49:09 +0700 Subject: [PATCH] fixed boris comments --- src/components/main/Header/index.tsx | 4 +- src/components/main/Logo/index.tsx | 2 +- src/components/node/CommentForm/index.tsx | 8 +- src/containers/node/BorisLayout/index.tsx | 2 +- src/redux/node/actions.ts | 3 +- src/redux/node/sagas.ts | 9 +- src/sprites/lost.svg | 225 ++++++++++++++-------- 7 files changed, 163 insertions(+), 90 deletions(-) diff --git a/src/components/main/Header/index.tsx b/src/components/main/Header/index.tsx index 2010cd28..21fdf43f 100644 --- a/src/components/main/Header/index.tsx +++ b/src/components/main/Header/index.tsx @@ -63,11 +63,11 @@ const HeaderUnconnected: FC = memo( {is_user && (
- FLOW + ФЛОУ - BORIS + БОРИС
diff --git a/src/components/main/Logo/index.tsx b/src/components/main/Logo/index.tsx index 639ba981..c7a9c787 100644 --- a/src/components/main/Logo/index.tsx +++ b/src/components/main/Logo/index.tsx @@ -4,6 +4,6 @@ import { Link } from 'react-router-dom'; export const Logo = () => ( - VAULT + УБЕЖИЩЕ ); diff --git a/src/components/node/CommentForm/index.tsx b/src/components/node/CommentForm/index.tsx index 3b852a70..d9c86db7 100644 --- a/src/components/node/CommentForm/index.tsx +++ b/src/components/node/CommentForm/index.tsx @@ -18,9 +18,7 @@ import { selectUploads } from '~/redux/uploads/selectors'; import { IState } from '~/redux/store'; import { getFileType } from '~/utils/uploader'; import { selectUser } from '~/redux/auth/selectors'; -import { getURL } from '~/utils/dom'; import { ButtonGroup } from '~/components/input/ButtonGroup'; -import { AudioPlayer } from '~/components/media/AudioPlayer'; import { SortableImageGrid } from '~/components/editors/SortableImageGrid'; import { moveArrItem } from '~/utils/fn'; import { SortEnd } from 'react-sortable-hoc'; @@ -41,6 +39,7 @@ const mapDispatchToProps = { type IProps = ReturnType & typeof mapDispatchToProps & { id: number; + is_before?: boolean; }; const CommentFormUnconnected: FC = ({ @@ -48,6 +47,7 @@ const CommentFormUnconnected: FC = ({ uploads: { statuses, files }, user, id, + is_before = false, nodePostComment, nodeSetCommentData, uploadUploadFiles, @@ -89,9 +89,9 @@ const CommentFormUnconnected: FC = ({ const onSubmit = useCallback( event => { if (event) event.preventDefault(); - nodePostComment(id); + nodePostComment(id, is_before); }, - [nodePostComment, id] + [nodePostComment, id, is_before] ); const onKeyDown = useCallback>( diff --git a/src/containers/node/BorisLayout/index.tsx b/src/containers/node/BorisLayout/index.tsx index 9e45985b..9397d6f4 100644 --- a/src/containers/node/BorisLayout/index.tsx +++ b/src/containers/node/BorisLayout/index.tsx @@ -77,7 +77,7 @@ const BorisLayoutUnconnected: FC = ({
- {is_user && } + {is_user && } {is_loading_comments && !comments.length ? ( diff --git a/src/redux/node/actions.ts b/src/redux/node/actions.ts index b4c54a8b..2e063fe4 100644 --- a/src/redux/node/actions.ts +++ b/src/redux/node/actions.ts @@ -39,8 +39,9 @@ export const nodeSetCurrent = (current: INodeState['current']) => ({ type: NODE_ACTIONS.SET_CURRENT, }); -export const nodePostComment = (id: number) => ({ +export const nodePostComment = (id: number, is_before: boolean) => ({ id, + is_before, type: NODE_ACTIONS.POST_COMMENT, }); diff --git a/src/redux/node/sagas.ts b/src/redux/node/sagas.ts index af03a204..e701b9fe 100644 --- a/src/redux/node/sagas.ts +++ b/src/redux/node/sagas.ts @@ -151,7 +151,7 @@ function* onNodeLoad({ id, order = 'ASC' }: ReturnType) { return; } -function* onPostComment({ id }: ReturnType) { +function* onPostComment({ id, is_before }: ReturnType) { const { current, comment_data } = yield select(selectNode); yield put(nodeSetSendingComment(true)); @@ -170,8 +170,13 @@ function* onPostComment({ id }: ReturnType) { if (current_node && current_node.id === current.id) { // if user still browsing that node const { comments } = yield select(selectNode); - yield put(nodeSetComments([...comments, comment])); yield put(nodeSetCommentData(0, { ...EMPTY_COMMENT })); + + if (is_before) { + yield put(nodeSetComments([comment, ...comments])); + } else { + yield put(nodeSetComments([...comments, comment])); + } } } diff --git a/src/sprites/lost.svg b/src/sprites/lost.svg index 0e27f4a5..f5b9004b 100644 --- a/src/sprites/lost.svg +++ b/src/sprites/lost.svg @@ -19,6 +19,18 @@ sodipodi:docname="lost.svg"> + + + + @@ -31,27 +43,6 @@ offset="1" style="stop-color:#061613;stop-opacity:1" /> - - - - - + gradientTransform="translate(0,5.2916633)" /> + + + transform="translate(0,-11.249975)" + style="display:inline"> + + + + + + - - - - - @@ -192,36 +204,91 @@ d="m 445.4922,202.213 c -0.0662,0.33073 -1.25677,1.85208 -1.25677,1.85208 l 0.79375,1.52136 1.78594,-0.46302 0.39687,-1.25677 z" style="opacity:1;fill:#800000;fill-opacity:1;stroke:none;stroke-width:0.26458335;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - - - - - + + + + + + +