aboutsummaryrefslogtreecommitdiff
path: root/vnext/src/ui
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2022-11-06 03:30:40 +0300
committerGravatar Vitaly Takmazov2023-01-13 10:37:58 +0300
commit7b14a8f3faf7672f0aefbf93d5c37f62a169b535 (patch)
treeb027f687d286316afd493c3cf3cbbbc7aedd7396 /vnext/src/ui
parent00ff146fb45b64aa3a4278c05e4a4c476152e2b4 (diff)
Cleanup ESLint warnings
Diffstat (limited to 'vnext/src/ui')
-rw-r--r--vnext/src/ui/Contact.js5
-rw-r--r--vnext/src/ui/Header.js3
-rw-r--r--vnext/src/ui/Icon.js3
-rw-r--r--vnext/src/ui/Login.js2
-rw-r--r--vnext/src/ui/SearchBox.js10
-rw-r--r--vnext/src/ui/UploadButton.js1
-rw-r--r--vnext/src/ui/UserInfo.js7
7 files changed, 17 insertions, 14 deletions
diff --git a/vnext/src/ui/Contact.js b/vnext/src/ui/Contact.js
index 2d009738..a0d32e84 100644
--- a/vnext/src/ui/Contact.js
+++ b/vnext/src/ui/Contact.js
@@ -3,13 +3,14 @@ import { memo } from 'react';
import Avatar from './Avatar';
/**
- * @typedef {Object} ContactProps
+ * @typedef {object} ContactProps
* @property {import('../api').Chat} user
- * @property {React.CSSProperties} style
+ * @property {import('react').CSSProperties} style
*/
/**
* Contact component
+ *
* @param {ContactProps} props
*/
function Contact({ user, style }) {
diff --git a/vnext/src/ui/Header.js b/vnext/src/ui/Header.js
index 4a665605..6cf07844 100644
--- a/vnext/src/ui/Header.js
+++ b/vnext/src/ui/Header.js
@@ -2,11 +2,8 @@ import { memo, useCallback } from 'react';
import { Link, useNavigate } from 'react-router-dom';
import SearchBox from './SearchBox';
-import { useVisitor } from './VisitorContext';
-import Avatar from './Avatar';
function Header() {
- const [visitor] = useVisitor();
const navigate = useNavigate();
/**
* @param {string} searchString
diff --git a/vnext/src/ui/Icon.js b/vnext/src/ui/Icon.js
index 3255346f..acf7bccf 100644
--- a/vnext/src/ui/Icon.js
+++ b/vnext/src/ui/Icon.js
@@ -5,7 +5,7 @@ import PropTypes from 'prop-types';
import evilIcons from 'evil-icons/assets/sprite.svg';
/**
- * @typedef {Object} IconProps
+ * @typedef {object} IconProps
* @property {string} size
* @property {string=} className
* @property {string} name
@@ -14,6 +14,7 @@ import evilIcons from 'evil-icons/assets/sprite.svg';
/**
* Icon inner component
+ *
* @param {IconProps} props - icon props
*/
function IconElement(props) {
diff --git a/vnext/src/ui/Login.js b/vnext/src/ui/Login.js
index 98f9328b..07b0a2a3 100644
--- a/vnext/src/ui/Login.js
+++ b/vnext/src/ui/Login.js
@@ -32,7 +32,7 @@ function Login({ onAuth }) {
}
}, [navigate, location.state, visitor]);
- const { register, handleSubmit, formState: { errors }, } = useForm();
+ const { register, handleSubmit } = useForm();
/** @type { import('react-hook-form').SubmitHandler<import('react-hook-form').FieldValues> } */
let onSubmit = (values) => {
diff --git a/vnext/src/ui/SearchBox.js b/vnext/src/ui/SearchBox.js
index e6085fdc..636967b1 100644
--- a/vnext/src/ui/SearchBox.js
+++ b/vnext/src/ui/SearchBox.js
@@ -1,19 +1,19 @@
import { useForm } from 'react-hook-form';
/**
- * @typedef {Object} SearchBoxPropsFields
- * @property {function} onSearch
+ * @typedef {object} SearchBoxPropsFields
+ * @property {Function} onSearch
*/
/**
-* @typedef {SearchBoxPropsFields} SearchBoxProps
-*/
+ * @typedef {SearchBoxPropsFields} SearchBoxProps
+ */
/**
* @param {SearchBoxProps} props
*/
function SearchBox({ onSearch }) {
- const { register, handleSubmit, formState: { errors }, } = useForm();
+ const { register, handleSubmit } = useForm();
/** @type { import('react-hook-form').SubmitHandler<import('react-hook-form').FieldValues> } */
let onSubmit = ( values ) => {
onSearch(values.search);
diff --git a/vnext/src/ui/UploadButton.js b/vnext/src/ui/UploadButton.js
index b652e522..f07501de 100644
--- a/vnext/src/ui/UploadButton.js
+++ b/vnext/src/ui/UploadButton.js
@@ -9,6 +9,7 @@ import Icon from './Icon';
/**
* Upload button
+ *
* @param {UploadButtonProps} props
*/
export default function UploadButton(props) {
diff --git a/vnext/src/ui/UserInfo.js b/vnext/src/ui/UserInfo.js
index bcf5c20e..91e3b5cf 100644
--- a/vnext/src/ui/UserInfo.js
+++ b/vnext/src/ui/UserInfo.js
@@ -13,7 +13,8 @@ let isMounted;
/**
* User info component
- * @param {{uname: string, onUpdate?: function, children?: import('react').ReactElement}} props
+ *
+ * @param {{uname: string, onUpdate?: Function, children?: import('react').ReactElement}} props
*/
export default function UserInfo({ uname, onUpdate, children }) {
const [user, setUser] = useState({
@@ -66,6 +67,7 @@ export default function UserInfo({ uname, onUpdate, children }) {
/**
* User summary component
+ *
* @param {{user: import('../api').User}} props
*/
function Summary({ user }) {
@@ -90,6 +92,7 @@ const UserSummary = memo(Summary);
/**
* Link to user
+ *
* @param {{ user: import('../api').User}} props
*/
export function UserLink(props) {
@@ -107,7 +110,7 @@ export function UserLink(props) {
uri: userRef.current.uri
});
}
- }).catch(reason => {
+ }).catch(() => {
setUser({
uid: 0,
uname: userRef.current.uri,