|
1 | 1 | import { createGlobalStyle } from 'styled-components/macro'
|
2 |
| -import { useAppDispatch, useAppSelector, useEffectMount } from '@/hooks' |
| 2 | +import { useAppDispatch, useAppSelector } from '@/hooks' |
3 | 3 | import { useCallback, useEffect, useState } from 'react'
|
4 | 4 | import {
|
5 | 5 | selectOptions,
|
6 | 6 | setContestProblemViewWidth,
|
7 | 7 | } from '@/pages/global/optionsSlice'
|
8 | 8 | import { Portal } from '@/components/Portal'
|
9 | 9 | import { withPage } from '@/hoc'
|
10 |
| -import { findElement } from '@/utils' |
11 |
| -import { HelpIcon } from '@/components/icons' |
12 | 10 |
|
13 | 11 | const GlobalStyle = createGlobalStyle`
|
14 | 12 | body {
|
@@ -111,34 +109,6 @@ const Variables = createGlobalStyle<{
|
111 | 109 | }
|
112 | 110 | `
|
113 | 111 |
|
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 |
| - |
142 | 112 | const OptimizedContestProblemsPage = (): JSX.Element => {
|
143 | 113 | const options = useAppSelector(selectOptions)
|
144 | 114 | const dispatch = useAppDispatch()
|
@@ -226,7 +196,6 @@ const OptimizedContestProblemsPage = (): JSX.Element => {
|
226 | 196 | return (
|
227 | 197 | <>
|
228 | 198 | {modifyPageLayout && <GlobalStyle />}
|
229 |
| - {modifyPageLayout && <FeatureTips />} |
230 | 199 | <Variables
|
231 | 200 | $layoutDirection={reverseLayout ? 'row-reverse' : 'row'}
|
232 | 201 | $problemViewWidth={
|
|
0 commit comments