From c939dcbce84d8e3a1169265852369110efc453cc Mon Sep 17 00:00:00 2001 From: Fedor Katurov Date: Fri, 19 Mar 2021 16:35:24 +0700 Subject: [PATCH] #23 lost fixes --- package.json | 1 + src/components/boris/BorisComments/index.tsx | 40 +++++++ .../boris/BorisComments/styles.module.scss | 18 +++ src/components/boris/BorisUIDemo/index.tsx | 51 +++++++++ .../boris/BorisUIDemo/styles.module.scss | 11 ++ .../EditorPublicSwitch/styles.module.scss | 108 +++++++++--------- src/components/input/Button/index.tsx | 68 +++-------- .../input/Button/styles.module.scss | 92 ++++++--------- src/containers/dialogs/EditorDialog/index.tsx | 2 +- .../node/BorisLayout/styles.module.scss | 16 --- src/sprites/Sprites.tsx | 4 +- yarn.lock | 20 ++++ 12 files changed, 254 insertions(+), 177 deletions(-) create mode 100644 src/components/boris/BorisComments/index.tsx create mode 100644 src/components/boris/BorisComments/styles.module.scss create mode 100644 src/components/boris/BorisUIDemo/index.tsx create mode 100644 src/components/boris/BorisUIDemo/styles.module.scss diff --git a/package.json b/package.json index 5ca469e5..512261d1 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,7 @@ "@testing-library/jest-dom": "^5.11.4", "@testing-library/react": "^11.1.0", "@testing-library/user-event": "^12.1.10", + "@tippy.js/react": "^3.1.1", "autosize": "^4.0.2", "axios": "^0.21.1", "body-scroll-lock": "^2.6.4", diff --git a/src/components/boris/BorisComments/index.tsx b/src/components/boris/BorisComments/index.tsx new file mode 100644 index 00000000..7cddfd67 --- /dev/null +++ b/src/components/boris/BorisComments/index.tsx @@ -0,0 +1,40 @@ +import React, { FC } from 'react'; +import styles from './styles.module.scss'; +import { Group } from '~/components/containers/Group'; +import { NodeCommentForm } from '~/components/node/NodeCommentForm'; +import { NodeNoComments } from '~/components/node/NodeNoComments'; +import { NodeComments } from '~/components/node/NodeComments'; +import { Footer } from '~/components/main/Footer'; +import { Card } from '~/components/containers/Card'; +import { useShallowSelect } from '~/utils/hooks/useShallowSelect'; +import { selectAuthUser } from '~/redux/auth/selectors'; +import { IComment, INode } from '~/redux/types'; + +interface IProps { + isLoadingComments: boolean; + commentCount: number; + node: INode; + comments: IComment[]; +} + +const BorisComments: FC = ({ isLoadingComments, node, commentCount, comments }) => { + const user = useShallowSelect(selectAuthUser); + + return ( + + + {user.is_user && } + + {isLoadingComments ? ( + + ) : ( + + )} + + +