Skip to content

Commit 6814cc1

Browse files
committed
fix(problems): 去掉提示
目前默认选项是关闭的,要使用需要手动开启,那么启用的人肯定是知道这个选项的,所以提示就没必要了。
1 parent 64483fa commit 6814cc1

File tree

1 file changed

+1
-32
lines changed

1 file changed

+1
-32
lines changed

src/content/pages/problems/OptimizedContestProblemsPage.tsx

+1-32
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
import { createGlobalStyle } from 'styled-components/macro'
2-
import { useAppDispatch, useAppSelector, useEffectMount } from '@/hooks'
2+
import { useAppDispatch, useAppSelector } from '@/hooks'
33
import { useCallback, useEffect, useState } from 'react'
44
import {
55
selectOptions,
66
setContestProblemViewWidth,
77
} from '@/pages/global/optionsSlice'
88
import { Portal } from '@/components/Portal'
99
import { withPage } from '@/hoc'
10-
import { findElement } from '@/utils'
11-
import { HelpIcon } from '@/components/icons'
1210

1311
const GlobalStyle = createGlobalStyle`
1412
body {
@@ -111,34 +109,6 @@ const Variables = createGlobalStyle<{
111109
}
112110
`
113111

114-
const FeatureTips = () => {
115-
const [root, setRoot] = useState<HTMLElement | null>(null)
116-
117-
useEffectMount(async state => {
118-
const languageSelectWrapper = await findElement('.language-select-wrapper')
119-
if (!state.isMount) return
120-
const root = document.createElement('div')
121-
root.style.margin = '15px 0'
122-
const control = languageSelectWrapper.parentElement?.parentElement
123-
if (control) {
124-
control.parentElement?.insertBefore(root, control)
125-
}
126-
setRoot(root)
127-
state.unmount.push(() => root.remove())
128-
}, [])
129-
130-
if (!root) return null
131-
132-
return (
133-
<Portal container={root}>
134-
<div style={{ display: 'flex', alignItems: 'center' }}>
135-
<HelpIcon width={'16px'} /> 提示:此布局由 Refined LeetCode
136-
扩展提供,如需关闭,可以在扩展的配置选项中关闭。
137-
</div>
138-
</Portal>
139-
)
140-
}
141-
142112
const OptimizedContestProblemsPage = (): JSX.Element => {
143113
const options = useAppSelector(selectOptions)
144114
const dispatch = useAppDispatch()
@@ -226,7 +196,6 @@ const OptimizedContestProblemsPage = (): JSX.Element => {
226196
return (
227197
<>
228198
{modifyPageLayout && <GlobalStyle />}
229-
{modifyPageLayout && <FeatureTips />}
230199
<Variables
231200
$layoutDirection={reverseLayout ? 'row-reverse' : 'row'}
232201
$problemViewWidth={

0 commit comments

Comments
 (0)