From 204f3762eedd8028f7d79826dc625eb31bbcb909 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Fri, 28 Oct 2022 15:15:03 +0300 Subject: Merge `eslint` configuration from Next version --- vnext/src/ui/Avatar.js | 6 +++--- vnext/src/ui/Button.js | 2 +- vnext/src/ui/Thread.css | 14 -------------- vnext/src/ui/Thread.js | 11 ++++------- vnext/src/ui/helpers/BubbleStyle.js | 2 +- 5 files changed, 9 insertions(+), 26 deletions(-) delete mode 100644 vnext/src/ui/Thread.css (limited to 'vnext/src/ui') diff --git a/vnext/src/ui/Avatar.js b/vnext/src/ui/Avatar.js index b7ffb102..0ec679df 100644 --- a/vnext/src/ui/Avatar.js +++ b/vnext/src/ui/Avatar.js @@ -6,11 +6,11 @@ import Icon from './Icon'; import './Avatar.css'; /** - * @typedef {Object} AvatarProps + * @typedef {object} AvatarProps * @property {import('../api').User} user - * @property {React.CSSProperties=} style + * @property {import('react').CSSProperties=} style * @property {string=} link - * @property {React.ReactNode=} children + * @property {import('react').ReactNode=} children */ /** diff --git a/vnext/src/ui/Button.js b/vnext/src/ui/Button.js index 62e772b9..3e49224d 100644 --- a/vnext/src/ui/Button.js +++ b/vnext/src/ui/Button.js @@ -3,7 +3,7 @@ import { memo } from 'react'; import './Button.css'; /** - * @param {React.ClassAttributes & React.ButtonHTMLAttributes} props + * @param {import('react').ClassAttributes & import('react').ButtonHTMLAttributes} props */ function Button(props) { return ( diff --git a/vnext/src/ui/Thread.css b/vnext/src/ui/Thread.css deleted file mode 100644 index 300d56ff..00000000 --- a/vnext/src/ui/Thread.css +++ /dev/null @@ -1,14 +0,0 @@ -#replies { - background: var(--main-background-color); - border: 1px solid var(--border-color); - padding: 12px; -} - -.msg-bubble { - background: rgb(238, 238, 238); - color: rgb(34, 34, 34); - padding: 6px 12px; - margin-left: 48px; - margin-bottom: 12px; - display: inline-block; -} diff --git a/vnext/src/ui/Thread.js b/vnext/src/ui/Thread.js index 52a2baf1..20ea0a3c 100644 --- a/vnext/src/ui/Thread.js +++ b/vnext/src/ui/Thread.js @@ -7,11 +7,9 @@ import MessageInput from './MessageInput'; import Spinner from './Spinner'; import { getMessages, comment, update } from '../api'; - -import './Thread.css'; /** - * @type import('../api').Message - */ + * @type import('../api').Message + */ const emptyMessage = {}; /** @@ -29,7 +27,7 @@ export default function Thread(props) { const [active, setActive] = useState(0); const [editing, setEditing] = useState(emptyMessage); - const [hash, setHash] = useState(props.visitor.hash); + const [hash] = useState(props.visitor.hash); const { mid } = params; let loadReplies = useCallback(() => { @@ -67,7 +65,7 @@ export default function Thread(props) { let postComment = useCallback((template) => { const { mid, rid, body, attach } = template; let commentAction = editing.rid ? update(mid, editing.rid, body) : comment(mid, rid, body, attach); - commentAction.then(res => { + commentAction.then(() => { setEditing(emptyMessage); loadReplies(); }) @@ -116,7 +114,6 @@ export default function Thread(props) { )) : ( <> { - // @ts-ignore Array(loaders).fill().map((it, i) => ) } diff --git a/vnext/src/ui/helpers/BubbleStyle.js b/vnext/src/ui/helpers/BubbleStyle.js index f784e1e3..23c2df13 100644 --- a/vnext/src/ui/helpers/BubbleStyle.js +++ b/vnext/src/ui/helpers/BubbleStyle.js @@ -1,7 +1,7 @@ /** * @param {import('../../api').User} me * @param {import('../../api').Message} msg - * @returns {React.CSSProperties} + * @returns { import('react').CSSProperties} CSS properties */ export function chatItemStyle(me, msg) { const isMe = me.uid === msg.user.uid; -- cgit v1.2.3