♻️ refactor: Refactor the structure of the common component

This commit is contained in:
Apple\Apple
2025-06-01 17:39:41 +08:00
parent 9fb9dfb905
commit efe4ea0e25
10 changed files with 8 additions and 57 deletions

View File

@@ -29,10 +29,10 @@ import Text from '@douyinfe/semi-ui/lib/es/typography/text';
import TelegramLoginButton from 'react-telegram-login';
import { IconGithubLogo, IconMail, IconLock } from '@douyinfe/semi-icons';
import OIDCIcon from './OIDCIcon.js';
import WeChatIcon from './WeChatIcon';
import OIDCIcon from './common/logo/OIDCIcon.js';
import WeChatIcon from './common/logo/WeChatIcon.js';
import { setUserData } from '../helpers/data.js';
import LinuxDoIcon from './LinuxDoIcon.js';
import LinuxDoIcon from './common/logo/LinuxDoIcon.js';
import { useTranslation } from 'react-i18next';
import Background from '../images/example.png';

View File

@@ -26,9 +26,9 @@ import {
onLinuxDOOAuthClicked,
onOIDCClicked,
} from './utils.js';
import OIDCIcon from './OIDCIcon.js';
import LinuxDoIcon from './LinuxDoIcon.js';
import WeChatIcon from './WeChatIcon.js';
import OIDCIcon from './common/logo/OIDCIcon.js';
import LinuxDoIcon from './common/logo/LinuxDoIcon.js';
import WeChatIcon from './common/logo/WeChatIcon.js';
import TelegramLoginButton from 'react-telegram-login/src';
import { setUserData } from '../helpers/data.js';
import { UserContext } from '../context/User/index.js';

View File

@@ -13,7 +13,7 @@ import React from 'react';
import { useDebouncedCallback } from 'use-debounce';
import clsx from 'clsx';
import { Button, Tooltip, Toast } from '@douyinfe/semi-ui';
import { copy } from '../../helpers/utils';
import { copy } from '../../../helpers/utils';
import { IconCopy } from '@douyinfe/semi-icons';
import { useTranslation } from 'react-i18next';

View File

@@ -1,28 +0,0 @@
import { Input, Typography } from '@douyinfe/semi-ui';
import React from 'react';
const TextInput = ({
label,
name,
value,
onChange,
placeholder,
type = 'text',
}) => {
return (
<>
<div style={{ marginTop: 10 }}>
<Typography.Text strong>{label}</Typography.Text>
</div>
<Input
name={name}
placeholder={placeholder}
onChange={(value) => onChange(value)}
value={value}
autoComplete='new-password'
/>
</>
);
};
export default TextInput;

View File

@@ -1,21 +0,0 @@
import { Input, InputNumber, Typography } from '@douyinfe/semi-ui';
import React from 'react';
const TextNumberInput = ({ label, name, value, onChange, placeholder }) => {
return (
<>
<div style={{ marginTop: 10 }}>
<Typography.Text strong>{label}</Typography.Text>
</div>
<InputNumber
name={name}
placeholder={placeholder}
onChange={(value) => onChange(value)}
value={value}
autoComplete='new-password'
/>
</>
);
};
export default TextNumberInput;

View File

@@ -4,7 +4,7 @@ import {
TextArea,
Button,
} from '@douyinfe/semi-ui';
import MarkdownRenderer from '../common/MarkdownRenderer';
import MarkdownRenderer from '../common/markdown/MarkdownRenderer';
import {
ChevronRight,
ChevronUp,