♻️ refactor: Refactor the structure of the common component
This commit is contained in:
@@ -29,10 +29,10 @@ import Text from '@douyinfe/semi-ui/lib/es/typography/text';
|
|||||||
import TelegramLoginButton from 'react-telegram-login';
|
import TelegramLoginButton from 'react-telegram-login';
|
||||||
|
|
||||||
import { IconGithubLogo, IconMail, IconLock } from '@douyinfe/semi-icons';
|
import { IconGithubLogo, IconMail, IconLock } from '@douyinfe/semi-icons';
|
||||||
import OIDCIcon from './OIDCIcon.js';
|
import OIDCIcon from './common/logo/OIDCIcon.js';
|
||||||
import WeChatIcon from './WeChatIcon';
|
import WeChatIcon from './common/logo/WeChatIcon.js';
|
||||||
import { setUserData } from '../helpers/data.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 { useTranslation } from 'react-i18next';
|
||||||
import Background from '../images/example.png';
|
import Background from '../images/example.png';
|
||||||
|
|
||||||
|
|||||||
@@ -26,9 +26,9 @@ import {
|
|||||||
onLinuxDOOAuthClicked,
|
onLinuxDOOAuthClicked,
|
||||||
onOIDCClicked,
|
onOIDCClicked,
|
||||||
} from './utils.js';
|
} from './utils.js';
|
||||||
import OIDCIcon from './OIDCIcon.js';
|
import OIDCIcon from './common/logo/OIDCIcon.js';
|
||||||
import LinuxDoIcon from './LinuxDoIcon.js';
|
import LinuxDoIcon from './common/logo/LinuxDoIcon.js';
|
||||||
import WeChatIcon from './WeChatIcon.js';
|
import WeChatIcon from './common/logo/WeChatIcon.js';
|
||||||
import TelegramLoginButton from 'react-telegram-login/src';
|
import TelegramLoginButton from 'react-telegram-login/src';
|
||||||
import { setUserData } from '../helpers/data.js';
|
import { setUserData } from '../helpers/data.js';
|
||||||
import { UserContext } from '../context/User/index.js';
|
import { UserContext } from '../context/User/index.js';
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import React from 'react';
|
|||||||
import { useDebouncedCallback } from 'use-debounce';
|
import { useDebouncedCallback } from 'use-debounce';
|
||||||
import clsx from 'clsx';
|
import clsx from 'clsx';
|
||||||
import { Button, Tooltip, Toast } from '@douyinfe/semi-ui';
|
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 { IconCopy } from '@douyinfe/semi-icons';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
|
|
||||||
@@ -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;
|
|
||||||
@@ -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;
|
|
||||||
@@ -4,7 +4,7 @@ import {
|
|||||||
TextArea,
|
TextArea,
|
||||||
Button,
|
Button,
|
||||||
} from '@douyinfe/semi-ui';
|
} from '@douyinfe/semi-ui';
|
||||||
import MarkdownRenderer from '../common/MarkdownRenderer';
|
import MarkdownRenderer from '../common/markdown/MarkdownRenderer';
|
||||||
import {
|
import {
|
||||||
ChevronRight,
|
ChevronRight,
|
||||||
ChevronUp,
|
ChevronUp,
|
||||||
|
|||||||
Reference in New Issue
Block a user