diff --git a/.eslintrc.cjs b/.eslintrc.cjs index d44787e..f139323 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -10,8 +10,8 @@ module.exports = { 'plugin:@typescript-eslint/stylistic', 'prettier', ], - rules: { - '@typescript-eslint/no-unused-vars': 'off', - }, + // rules: { + // '@typescript-eslint/no-unused-vars': 'off', + // }, ignorePatterns: ['public', '.eslintrc.cjs'], }; diff --git a/src/app/(info)/about/page.tsx b/src/app/(info)/about/page.tsx index f2635a4..e633646 100644 --- a/src/app/(info)/about/page.tsx +++ b/src/app/(info)/about/page.tsx @@ -1,7 +1,4 @@ -import { - SubtitleComponent, - TitleComponent, -} from '@/app/_libs/components/title'; +import { TitleComponent } from '@/app/_libs/components/title'; import type { Metadata } from 'next'; export const metadata: Metadata = { diff --git a/src/app/_libs/components/header/header.tsx b/src/app/_libs/components/header/header.tsx index ee8fad3..a9c3e1d 100644 --- a/src/app/_libs/components/header/header.tsx +++ b/src/app/_libs/components/header/header.tsx @@ -38,8 +38,8 @@ export default function Header() { href="https://github.com/lcandy2/webvpn-converter" target="_blank" > - - + + diff --git a/src/app/_libs/components/home-status.tsx b/src/app/_libs/components/home-status.tsx index ac2fd39..0abda46 100644 --- a/src/app/_libs/components/home-status.tsx +++ b/src/app/_libs/components/home-status.tsx @@ -63,11 +63,11 @@ export default function HomeStatus() { onClick={handleEditButtonClicked} prefetch={true} > - + {editButtonClicked ? ( ) : ( - + )} diff --git a/src/app/_libs/components/init-select-school.tsx b/src/app/_libs/components/init-select-school.tsx index 7cb5f3e..5d18eec 100644 --- a/src/app/_libs/components/init-select-school.tsx +++ b/src/app/_libs/components/init-select-school.tsx @@ -1,6 +1,6 @@ 'use client'; -import { useAtomValue, useSetAtom } from 'jotai'; +import { useAtomValue } from 'jotai'; import { selectedSchoolAtom } from '@/app/_libs/atoms'; import { useEffect, useState } from 'react'; import Link from 'next/link'; diff --git a/src/app/_libs/components/url-converter/converted-url-input.tsx b/src/app/_libs/components/url-converter/converted-url-input.tsx index b1dad92..c96fa10 100644 --- a/src/app/_libs/components/url-converter/converted-url-input.tsx +++ b/src/app/_libs/components/url-converter/converted-url-input.tsx @@ -41,7 +41,7 @@ export default function ConvertedUrlInput({ } }, [isDecryptMode, encryptedUrl, decryptedUrl, originalUrl]); - const { copy, reset, error, copied } = useCopy({ + const { copy, error, copied } = useCopy({ onCopyError: (message) => { enqueueSnackbar(message, { variant: 'error', @@ -62,13 +62,16 @@ export default function ConvertedUrlInput({ const InputAdornmentComponents = () => { return (
- + {error ? ( - + ) : copied ? ( - + ) : ( - + )} diff --git a/src/app/_libs/components/url-converter/original-url-input.tsx b/src/app/_libs/components/url-converter/original-url-input.tsx index f58c37e..a2b97d9 100644 --- a/src/app/_libs/components/url-converter/original-url-input.tsx +++ b/src/app/_libs/components/url-converter/original-url-input.tsx @@ -76,8 +76,8 @@ export default function OriginalUrlInput({ spellCheck: false, endAdornment: ( - - + + ), diff --git a/src/app/_libs/ui/button.tsx b/src/app/_libs/ui/button.tsx index 535ccfe..2cce439 100644 --- a/src/app/_libs/ui/button.tsx +++ b/src/app/_libs/ui/button.tsx @@ -6,7 +6,7 @@ 'use client'; import { createComponent } from '@lit/react'; -import React, { ComponentProps, ReactNode } from 'react'; +import React, { ComponentProps } from 'react'; import { MdFilledButton as _MdFilledButton } from '@material/web/button/filled-button'; import { MdOutlinedButton as _MdOutlinedButton } from '@material/web/button/outlined-button'; import { MdTextButton as _MdTextButton } from '@material/web/button/text-button'; diff --git a/src/app/_libs/url-convert.ts b/src/app/_libs/url-convert.ts index da76096..315594f 100644 --- a/src/app/_libs/url-convert.ts +++ b/src/app/_libs/url-convert.ts @@ -161,7 +161,7 @@ export const encryptUrl = ({ */ const { - url: extractedUrl, + // url: extractedUrl, host, path, port, diff --git a/src/app/bookmarklet/_lib/components/bookmarklet-client.tsx b/src/app/bookmarklet/_lib/components/bookmarklet-client.tsx index 6d184c5..2e7f6d0 100644 --- a/src/app/bookmarklet/_lib/components/bookmarklet-client.tsx +++ b/src/app/bookmarklet/_lib/components/bookmarklet-client.tsx @@ -22,7 +22,6 @@ import { enqueueSnackbar, SnackbarProvider } from 'notistack'; import ErrorIcon from '@mui/icons-material/Error'; import DoneIcon from '@mui/icons-material/Done'; import { MdIconButton } from '@/app/_libs/ui/icon-button'; -import ContentPasteIcon from '@mui/icons-material/ContentPaste'; import HomeStatus from '@/app/_libs/components/home-status'; export default async function BookmarkletClient() { @@ -43,7 +42,7 @@ export default async function BookmarkletClient() { [bookmarkletHref, hasMounted, selectedSchool, bookmarkletRaw], ); - const { copy, reset, error, copied } = useCopy({ + const { copy, error, copied } = useCopy({ onCopyError: (message) => { enqueueSnackbar(message, { variant: 'error', diff --git a/src/app/bookmarklet/page.tsx b/src/app/bookmarklet/page.tsx index 2b42d3a..1d628e0 100644 --- a/src/app/bookmarklet/page.tsx +++ b/src/app/bookmarklet/page.tsx @@ -1,4 +1,3 @@ -import InitSelectSchool from '@/app/_libs/components/init-select-school'; import { SubtitleComponent, TitleComponent, diff --git a/src/app/decrypt/page.tsx b/src/app/decrypt/page.tsx index 60d65ec..8fb37c9 100644 --- a/src/app/decrypt/page.tsx +++ b/src/app/decrypt/page.tsx @@ -1,4 +1,3 @@ -import InitSelectSchool from '@/app/_libs/components/init-select-school'; import { TitleComponent } from '@/app/_libs/components/title'; import UrlConverter from '@/app/_libs/components/url-converter/url-converter'; import HomeStatus from '@/app/_libs/components/home-status'; diff --git a/src/app/error.tsx b/src/app/error.tsx index df494ac..1c0cd8e 100644 --- a/src/app/error.tsx +++ b/src/app/error.tsx @@ -1,6 +1,6 @@ 'use client'; -import { useCallback, useEffect } from 'react'; +import { useCallback } from 'react'; import Title from '@/app/_libs/components/title'; import Link from 'next/link'; import MdFab from '@/app/_libs/ui/floating-action-buttons'; diff --git a/src/app/middleware.ts b/src/app/middleware.ts new file mode 100644 index 0000000..e69de29 diff --git a/src/app/page.tsx b/src/app/page.tsx index c4ed33b..acde2af 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -1,4 +1,3 @@ -import InitSelectSchool from '@/app/_libs/components/init-select-school'; import { TitleComponent } from '@/app/_libs/components/title'; import UrlConverter from '@/app/_libs/components/url-converter/url-converter'; import HomeStatus from '@/app/_libs/components/home-status'; diff --git a/src/app/settings/_libs/components/school-action.tsx b/src/app/settings/_libs/components/school-action.tsx index 0e941b7..b8f5db0 100644 --- a/src/app/settings/_libs/components/school-action.tsx +++ b/src/app/settings/_libs/components/school-action.tsx @@ -50,26 +50,28 @@ export default function SchoolAction({ }, [setIsSchoolNotListed]); return ( -
- {isSchoolSelected && ( - - - - - - )} - {!isSchoolNotListed && mode === 'init' && ( - - {isSchoolSelected ? '自定义设置' : '列表上没有我的学校?'} - - )} -
+ type && ( +
+ {isSchoolSelected && ( + + + + + + )} + {!isSchoolNotListed && mode === 'init' && ( + + {isSchoolSelected ? '自定义设置' : '列表上没有我的学校?'} + + )} +
+ ) ); } diff --git a/src/app/settings/_libs/components/school-customization.tsx b/src/app/settings/_libs/components/school-customization.tsx index 9aad5c0..655b136 100644 --- a/src/app/settings/_libs/components/school-customization.tsx +++ b/src/app/settings/_libs/components/school-customization.tsx @@ -90,45 +90,47 @@ export default function SchoolCustomization({ if (isSchoolNotListed || mode === 'settings') { return ( - <> - -
-

- 自定义 -

- {mode === 'init' && ( - - - - )} -
- -
- + type && ( + <> + +
+

+ 自定义 +

+ {mode === 'init' && ( + + + + )} +
-
-

- 注: KEY 或 IV 留空 将使用默认值 wrdvpnisthebest! -

-
- +
+ + +
+

+ 注: KEY 或 IV 留空 将使用默认值 wrdvpnisthebest! +

+ + + ) ); } else { return null; diff --git a/src/app/settings/_libs/components/school-selector.tsx b/src/app/settings/_libs/components/school-selector.tsx index 52ec8b0..8807cd8 100644 --- a/src/app/settings/_libs/components/school-selector.tsx +++ b/src/app/settings/_libs/components/school-selector.tsx @@ -17,7 +17,7 @@ import { useAtom } from 'jotai'; import { selectedSchoolAtom } from '@/app/_libs/atoms'; import { School } from '@/app/_libs/types'; -export default async function SchoolSelector() { +export default function SchoolSelector() { const schoolData = buildSchoolList(webvpnData); const [selectedSchool, setSelectedSchool] = useAtom(selectedSchoolAtom); const [hasMounted, setHasMounted] = useState(false); diff --git a/src/app/settings/_libs/components/sync-localstorage-with-cookie.tsx b/src/app/settings/_libs/components/sync-localstorage-with-cookie.tsx index 0b610c4..5012549 100644 --- a/src/app/settings/_libs/components/sync-localstorage-with-cookie.tsx +++ b/src/app/settings/_libs/components/sync-localstorage-with-cookie.tsx @@ -24,7 +24,7 @@ export function SyncLocalStorageWithCookie({ } else { Cookies.remove('selectedSchool'); } - }, [selectedSchool]); + }, [selectedSchool, withRedirect]); return <>; } diff --git a/src/app/settings/page.tsx b/src/app/settings/page.tsx index 8d66aa7..8c3e667 100644 --- a/src/app/settings/page.tsx +++ b/src/app/settings/page.tsx @@ -1,5 +1,5 @@ import type { Metadata } from 'next'; -import Title, { TitleComponent } from '@/app/_libs/components/title'; +import { TitleComponent } from '@/app/_libs/components/title'; import SettingsUI from './_libs/ui/settings-ui'; import GoBackButton from './_libs/components/go-back-button';