aboutsummaryrefslogtreecommitdiff
path: root/vnext/src
diff options
context:
space:
mode:
Diffstat (limited to 'vnext/src')
-rw-r--r--vnext/src/ui/Avatar.js6
-rw-r--r--vnext/src/ui/Button.js2
-rw-r--r--vnext/src/ui/Thread.css14
-rw-r--r--vnext/src/ui/Thread.js11
-rw-r--r--vnext/src/ui/helpers/BubbleStyle.js2
5 files changed, 9 insertions, 26 deletions
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<HTMLButtonElement> & React.ButtonHTMLAttributes<HTMLButtonElement>} props
+ * @param {import('react').ClassAttributes<HTMLButtonElement> & import('react').ButtonHTMLAttributes<HTMLButtonElement>} 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) => <Spinner key={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;