From ae42c5e0e1e345d391d89f86e37a82e18656a3e2 Mon Sep 17 00:00:00 2001 From: XYShaoKang <38753204+XYShaoKang@users.noreply.github.com> Date: Mon, 16 Sep 2024 00:25:52 +0800 Subject: [PATCH] fix: fix lint --- src/content/pages/ranking/BetaApp.tsx | 27 ++++++++++++--------------- src/content/pages/ranking/Predict.tsx | 4 ++-- 2 files changed, 14 insertions(+), 17 deletions(-) diff --git a/src/content/pages/ranking/BetaApp.tsx b/src/content/pages/ranking/BetaApp.tsx index fe5d72a..0f6d5c0 100644 --- a/src/content/pages/ranking/BetaApp.tsx +++ b/src/content/pages/ranking/BetaApp.tsx @@ -4,7 +4,7 @@ import { useAppDispatch, useAppSelector, useEffectMount } from '@/hooks' import { selectOptions } from '../global/optionsSlice' import { Portal } from '@/components/Portal' -import { findElement, findAllElement, findElementByXPath } from '@/utils' +import { findElementByXPath } from '@/utils' import Predict from './Predict' import { useUrlChange } from './Item' import Title from './Title' @@ -123,21 +123,18 @@ export const BetaApp: FC = () => { (showPredict || realTimePredict) && (showPredictordelta || showNewRating || showOldRating) - useEffectMount( - async state => { - if (!widescreen) return - let p = titleRoot - while (p && p !== document.body) { - if (getComputedStyle(p).maxWidth !== 'none') { - p.style.maxWidth = 'unset' - p.style.alignItems = 'center' - break - } - p = p.parentElement! + useEffectMount(async () => { + if (!widescreen) return + let p = titleRoot + while (p && p !== document.body) { + if (getComputedStyle(p).maxWidth !== 'none') { + p.style.maxWidth = 'unset' + p.style.alignItems = 'center' + break } - }, - [widescreen, titleRoot] - ) + p = p.parentElement! + } + }, [widescreen, titleRoot]) if (!contestInfo || !rows) return null return ( diff --git a/src/content/pages/ranking/Predict.tsx b/src/content/pages/ranking/Predict.tsx index f47fe47..9f93bba 100644 --- a/src/content/pages/ranking/Predict.tsx +++ b/src/content/pages/ranking/Predict.tsx @@ -1,4 +1,4 @@ -import { memo, useEffect } from 'react' +import { FC, memo, useEffect } from 'react' import { fetchPrediction } from './rankSlice' import { Portal } from '@/components/Portal' @@ -83,7 +83,7 @@ type TDWrapProps = React.HTMLAttributes & { children?: React.ReactNode } -export const TDWrap = ({ beta, children, ...props }: TDWrapProps) => { +export const TDWrap: FC = ({ beta, children, ...props }) => { if (beta) { return
{children}
}