Skip to content

Commit

Permalink
fix: fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
XYShaoKang committed Sep 15, 2024
1 parent d0d179e commit ae42c5e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 17 deletions.
27 changes: 12 additions & 15 deletions src/content/pages/ranking/BetaApp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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 (
Expand Down
4 changes: 2 additions & 2 deletions src/content/pages/ranking/Predict.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { memo, useEffect } from 'react'
import { FC, memo, useEffect } from 'react'

import { fetchPrediction } from './rankSlice'
import { Portal } from '@/components/Portal'
Expand Down Expand Up @@ -83,7 +83,7 @@ type TDWrapProps = React.HTMLAttributes<HTMLElement> & {
children?: React.ReactNode
}

export const TDWrap = ({ beta, children, ...props }: TDWrapProps) => {
export const TDWrap: FC<TDWrapProps> = ({ beta, children, ...props }) => {
if (beta) {
return <div {...props}>{children}</div>
}
Expand Down

0 comments on commit ae42c5e

Please sign in to comment.