From c03123fdc5a0cb1d7600576517ef81c2c02cfcf0 Mon Sep 17 00:00:00 2001 From: nikk gitanes Date: Sun, 6 Jun 2021 20:27:09 +0300 Subject: [PATCH] remove unneded no-unused-vars --- web/src/App/Sidebar.jsx | 1 - web/src/components/About.jsx | 3 +-- web/src/components/Add/AddDialog.jsx | 4 +--- web/src/components/Add/index.jsx | 3 +-- web/src/components/TorrentList.jsx | 3 +-- web/src/components/Upload.jsx | 3 +-- 6 files changed, 5 insertions(+), 12 deletions(-) diff --git a/web/src/App/Sidebar.jsx b/web/src/App/Sidebar.jsx index 577539b..1ecec1b 100644 --- a/web/src/App/Sidebar.jsx +++ b/web/src/App/Sidebar.jsx @@ -19,7 +19,6 @@ import { useTranslation } from 'react-i18next' import { AppSidebarStyle } from './style' export default function Sidebar({ isDrawerOpen, setIsDonationDialogOpen }) { - // eslint-disable-next-line no-unused-vars const { t } = useTranslation() return ( diff --git a/web/src/components/About.jsx b/web/src/components/About.jsx index 9327ee9..58cae8a 100644 --- a/web/src/components/About.jsx +++ b/web/src/components/About.jsx @@ -13,9 +13,8 @@ import { useTranslation } from 'react-i18next' import { echoHost } from 'utils/Hosts' export default function AboutDialog() { - const [open, setOpen] = useState(false) - // eslint-disable-next-line no-unused-vars const { t } = useTranslation() + const [open, setOpen] = useState(false) const [torrServerVersion, setTorrServerVersion] = useState('') useEffect(() => { axios.get(echoHost()).then(({ data }) => setTorrServerVersion(data)) diff --git a/web/src/components/Add/AddDialog.jsx b/web/src/components/Add/AddDialog.jsx index 174ec2d..a1dd0c2 100644 --- a/web/src/components/Add/AddDialog.jsx +++ b/web/src/components/Add/AddDialog.jsx @@ -10,6 +10,7 @@ import axios from 'axios' import { useTranslation } from 'react-i18next' export default function AddDialog({ handleClose }) { + const { t } = useTranslation() const [link, setLink] = useState('') const [title, setTitle] = useState('') const [poster, setPoster] = useState('') @@ -18,9 +19,6 @@ export default function AddDialog({ handleClose }) { const inputTitle = ({ target: { value } }) => setTitle(value) const inputPoster = ({ target: { value } }) => setPoster(value) - // eslint-disable-next-line no-unused-vars - const { t } = useTranslation() - const handleSave = () => { axios.post(torrentsHost(), { action: 'add', link, title, poster, save_to_db: true }).finally(() => handleClose()) } diff --git a/web/src/components/Add/index.jsx b/web/src/components/Add/index.jsx index e3f5eaa..5a92c86 100644 --- a/web/src/components/Add/index.jsx +++ b/web/src/components/Add/index.jsx @@ -8,11 +8,10 @@ import { useTranslation } from 'react-i18next' import AddDialog from './AddDialog' export default function AddDialogButton() { + const { t } = useTranslation() const [isDialogOpen, setIsDialogOpen] = useState(false) const handleClickOpen = () => setIsDialogOpen(true) const handleClose = () => setIsDialogOpen(false) - // eslint-disable-next-line no-unused-vars - const { t } = useTranslation() return (
diff --git a/web/src/components/TorrentList.jsx b/web/src/components/TorrentList.jsx index 0639375..4168b22 100644 --- a/web/src/components/TorrentList.jsx +++ b/web/src/components/TorrentList.jsx @@ -8,12 +8,11 @@ import { TorrentListWrapper, CenteredGrid } from 'App/style' import { useTranslation } from 'react-i18next' export default function TorrentList() { + const { t } = useTranslation() const [torrents, setTorrents] = useState([]) const [isLoading, setIsLoading] = useState(true) const [isOffline, setIsOffline] = useState(true) const timerID = useRef(-1) - // eslint-disable-next-line no-unused-vars - const { t } = useTranslation() useEffect(() => { timerID.current = setInterval(() => { diff --git a/web/src/components/Upload.jsx b/web/src/components/Upload.jsx index 14707d4..8f460d8 100644 --- a/web/src/components/Upload.jsx +++ b/web/src/components/Upload.jsx @@ -7,6 +7,7 @@ import axios from 'axios' import { useTranslation } from 'react-i18next' export default function UploadDialog() { + const { t } = useTranslation() const handleCapture = ({ target: { files } }) => { const [file] = files const data = new FormData() @@ -14,8 +15,6 @@ export default function UploadDialog() { data.append('file', file) axios.post(torrentUploadHost(), data) } - // eslint-disable-next-line no-unused-vars - const { t } = useTranslation() return (