Skip to content

Commit 933327b

Browse files
author
Apple\Apple
committed
Merge branch 'ui/refactor' into alpha
2 parents 6704491 + 7f36499 commit 933327b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+879
-934
lines changed

web/src/App.js

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
import React, { lazy, Suspense, useContext, useEffect } from 'react';
1+
import React, { lazy, Suspense } from 'react';
22
import { Route, Routes, useLocation } from 'react-router-dom';
3-
import Loading from './components/Loading';
3+
import Loading from './components/common/Loading.js';
44
import User from './pages/User';
5-
import { PrivateRoute } from './components/PrivateRoute';
6-
import RegisterForm from './components/RegisterForm';
7-
import LoginForm from './components/LoginForm';
5+
import { AuthRedirect, PrivateRoute } from './helpers';
6+
import RegisterForm from './components/auth/RegisterForm.js';
7+
import LoginForm from './components/auth/LoginForm.js';
88
import NotFound from './pages/NotFound';
99
import Setting from './pages/Setting';
1010
import EditUser from './pages/User/EditUser';
11-
import PasswordResetForm from './components/PasswordResetForm';
12-
import PasswordResetConfirm from './components/PasswordResetConfirm';
11+
import PasswordResetForm from './components/auth/PasswordResetForm.js';
12+
import PasswordResetConfirm from './components/auth/PasswordResetConfirm.js';
1313
import Channel from './pages/Channel';
1414
import Token from './pages/Token';
1515
import EditChannel from './pages/Channel/EditChannel';
@@ -18,16 +18,14 @@ import TopUp from './pages/TopUp';
1818
import Log from './pages/Log';
1919
import Chat from './pages/Chat';
2020
import Chat2Link from './pages/Chat2Link';
21-
import { Layout } from '@douyinfe/semi-ui';
2221
import Midjourney from './pages/Midjourney';
2322
import Pricing from './pages/Pricing/index.js';
2423
import Task from './pages/Task/index.js';
2524
import Playground from './pages/Playground/index.js';
26-
import OAuth2Callback from './components/OAuth2Callback.js';
27-
import PersonalSetting from './components/PersonalSetting.js';
25+
import OAuth2Callback from './components/auth/OAuth2Callback.js';
26+
import PersonalSetting from './components/settings/PersonalSetting.js';
2827
import Setup from './pages/Setup/index.js';
29-
import SetupCheck from './components/SetupCheck';
30-
import AuthRedirect from './components/AuthRedirect';
28+
import { useSetupCheck } from './hooks/useSetupCheck.js';
3129

3230
const Home = lazy(() => import('./pages/Home'));
3331
const Detail = lazy(() => import('./pages/Detail'));
@@ -37,7 +35,7 @@ function App() {
3735
const location = useLocation();
3836

3937
return (
40-
<SetupCheck>
38+
<useSetupCheck>
4139
<Routes>
4240
<Route
4341
path='/'
@@ -292,7 +290,7 @@ function App() {
292290
/>
293291
<Route path='*' element={<NotFound />} />
294292
</Routes>
295-
</SetupCheck>
293+
</useSetupCheck>
296294
);
297295
}
298296

web/src/components/AuthRedirect.js

Lines changed: 0 additions & 14 deletions
This file was deleted.

web/src/components/PrivateRoute.js

Lines changed: 0 additions & 12 deletions
This file was deleted.

web/src/components/SetupCheck.js

Lines changed: 0 additions & 18 deletions
This file was deleted.
Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React, { useContext, useEffect, useState } from 'react';
22
import { Link, useNavigate, useSearchParams } from 'react-router-dom';
3-
import { UserContext } from '../context/User';
3+
import { UserContext } from '../../context/User/index.js';
44
import {
55
API,
66
getLogo,
@@ -9,12 +9,11 @@ import {
99
showSuccess,
1010
updateAPI,
1111
getSystemName,
12-
} from '../helpers';
13-
import {
12+
setUserData,
1413
onGitHubOAuthClicked,
1514
onOIDCClicked,
16-
onLinuxDOOAuthClicked,
17-
} from './utils';
15+
onLinuxDOOAuthClicked
16+
} from '../../helpers/index.js';
1817
import Turnstile from 'react-turnstile';
1918
import {
2019
Button,
@@ -29,12 +28,11 @@ import Text from '@douyinfe/semi-ui/lib/es/typography/text';
2928
import TelegramLoginButton from 'react-telegram-login';
3029

3130
import { IconGithubLogo, IconMail, IconLock } from '@douyinfe/semi-icons';
32-
import OIDCIcon from './common/logo/OIDCIcon.js';
33-
import WeChatIcon from './common/logo/WeChatIcon.js';
34-
import { setUserData } from '../helpers/data.js';
35-
import LinuxDoIcon from './common/logo/LinuxDoIcon.js';
31+
import OIDCIcon from '../common/logo/OIDCIcon.js';
32+
import WeChatIcon from '../common/logo/WeChatIcon.js';
33+
import LinuxDoIcon from '../common/logo/LinuxDoIcon.js';
3634
import { useTranslation } from 'react-i18next';
37-
import Background from '../images/example.png';
35+
import Background from '/example.png';
3836

3937
const LoginForm = () => {
4038
const [inputs, setInputs] = useState({
@@ -505,7 +503,7 @@ const LoginForm = () => {
505503
};
506504

507505
return (
508-
<div className="min-h-screen relative flex items-center justify-center py-12 px-4 sm:px-6 lg:px-8 overflow-hidden">
506+
<div className="relative flex items-center justify-center py-12 px-4 sm:px-6 lg:px-8 overflow-hidden">
509507
{/* 背景图片容器 - 放大并保持居中 */}
510508
<div
511509
className="absolute inset-0 z-0 bg-cover bg-center scale-125 opacity-100"
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
import React, { useContext, useEffect, useState } from 'react';
22
import { Spin, Typography, Space } from '@douyinfe/semi-ui';
33
import { useNavigate, useSearchParams } from 'react-router-dom';
4-
import { API, showError, showSuccess, updateAPI } from '../helpers';
5-
import { UserContext } from '../context/User';
6-
import { setUserData } from '../helpers/data.js';
4+
import { API, showError, showSuccess, updateAPI, setUserData } from '../../helpers';
5+
import { UserContext } from '../../context/User';
76

87
const OAuth2Callback = (props) => {
98
const [searchParams, setSearchParams] = useSearchParams();

web/src/components/PasswordResetConfirm.js renamed to web/src/components/auth/PasswordResetConfirm.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import React, { useEffect, useState } from 'react';
2-
import { API, copy, showError, showNotice, getLogo, getSystemName } from '../helpers';
2+
import { API, copy, showError, showNotice, getLogo, getSystemName } from '../../helpers';
33
import { useSearchParams, Link } from 'react-router-dom';
44
import { Button, Card, Form, Typography } from '@douyinfe/semi-ui';
55
import { IconMail, IconLock } from '@douyinfe/semi-icons';
66
import { useTranslation } from 'react-i18next';
7-
import Background from '../images/example.png';
7+
import Background from '/example.png';
88

99
const { Text, Title } = Typography;
1010

@@ -69,7 +69,7 @@ const PasswordResetConfirm = () => {
6969
}
7070

7171
return (
72-
<div className="min-h-screen relative flex items-center justify-center py-12 px-4 sm:px-6 lg:px-8 overflow-hidden">
72+
<div className="relative flex items-center justify-center py-12 px-4 sm:px-6 lg:px-8 overflow-hidden">
7373
{/* 背景图片容器 - 放大并保持居中 */}
7474
<div
7575
className="absolute inset-0 z-0 bg-cover bg-center scale-125 opacity-100"

web/src/components/PasswordResetForm.js renamed to web/src/components/auth/PasswordResetForm.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import React, { useEffect, useState } from 'react';
2-
import { API, getLogo, showError, showInfo, showSuccess, getSystemName } from '../helpers';
2+
import { API, getLogo, showError, showInfo, showSuccess, getSystemName } from '../../helpers';
33
import Turnstile from 'react-turnstile';
44
import { Button, Card, Form, Typography } from '@douyinfe/semi-ui';
55
import { IconMail } from '@douyinfe/semi-icons';
66
import { Link } from 'react-router-dom';
77
import { useTranslation } from 'react-i18next';
8-
import Background from '../images/example.png';
8+
import Background from '/example.png';
99

1010
const { Text, Title } = Typography;
1111

@@ -76,7 +76,7 @@ const PasswordResetForm = () => {
7676
}
7777

7878
return (
79-
<div className="min-h-screen relative flex items-center justify-center py-12 px-4 sm:px-6 lg:px-8 overflow-hidden">
79+
<div className="relative flex items-center justify-center py-12 px-4 sm:px-6 lg:px-8 overflow-hidden">
8080
{/* 背景图片容器 - 放大并保持居中 */}
8181
<div
8282
className="absolute inset-0 z-0 bg-cover bg-center scale-125 opacity-100"
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ import {
88
showSuccess,
99
updateAPI,
1010
getSystemName,
11-
} from '../helpers';
11+
setUserData
12+
} from '../../helpers/index.js';
1213
import Turnstile from 'react-turnstile';
1314
import {
1415
Button,
@@ -25,15 +26,14 @@ import {
2526
onGitHubOAuthClicked,
2627
onLinuxDOOAuthClicked,
2728
onOIDCClicked,
28-
} from './utils.js';
29-
import OIDCIcon from './common/logo/OIDCIcon.js';
30-
import LinuxDoIcon from './common/logo/LinuxDoIcon.js';
31-
import WeChatIcon from './common/logo/WeChatIcon.js';
29+
} from '../../helpers/index.js';
30+
import OIDCIcon from '../common/logo/OIDCIcon.js';
31+
import LinuxDoIcon from '../common/logo/LinuxDoIcon.js';
32+
import WeChatIcon from '../common/logo/WeChatIcon.js';
3233
import TelegramLoginButton from 'react-telegram-login/src';
33-
import { setUserData } from '../helpers/data.js';
34-
import { UserContext } from '../context/User/index.js';
34+
import { UserContext } from '../../context/User/index.js';
3535
import { useTranslation } from 'react-i18next';
36-
import Background from '../images/example.png';
36+
import Background from '/example.png';
3737

3838
const RegisterForm = () => {
3939
const { t } = useTranslation();
@@ -549,7 +549,7 @@ const RegisterForm = () => {
549549
};
550550

551551
return (
552-
<div className="min-h-screen relative flex items-center justify-center py-12 px-4 sm:px-6 lg:px-8 overflow-hidden">
552+
<div className="relative flex items-center justify-center py-12 px-4 sm:px-6 lg:px-8 overflow-hidden">
553553
<div
554554
className="absolute inset-0 z-0 bg-cover bg-center scale-125 opacity-100"
555555
style={{

0 commit comments

Comments
 (0)