diff --git a/ui/src/components/TagSelector/index.tsx b/ui/src/components/TagSelector/index.tsx index ba913e62..8f75b661 100644 --- a/ui/src/components/TagSelector/index.tsx +++ b/ui/src/components/TagSelector/index.tsx @@ -166,7 +166,13 @@ const TagSelector: FC = ({ variant="outline-secondary" size="sm"> {item.slug_name} - handleRemove(item)} /> + + ); })} diff --git a/ui/src/pages/Questions/Ask/index.tsx b/ui/src/pages/Questions/Ask/index.tsx index df4fc106..cdfe747d 100644 --- a/ui/src/pages/Questions/Ask/index.tsx +++ b/ui/src/pages/Questions/Ask/index.tsx @@ -15,10 +15,11 @@ import { postAnswer, useQueryQuestionByTitle, } from '@answer/api'; -import type * as Type from '@/services/types'; import SearchQuestion from './components/SearchQuestion'; +import type * as Type from '@/services/types'; + interface FormDataItem { title: { value: string; diff --git a/ui/src/pages/Questions/EditAnswer/index.tsx b/ui/src/pages/Questions/EditAnswer/index.tsx index 455b903e..dd913e60 100644 --- a/ui/src/pages/Questions/EditAnswer/index.tsx +++ b/ui/src/pages/Questions/EditAnswer/index.tsx @@ -12,6 +12,7 @@ import { modifyAnswer, useQueryRevisions, } from '@answer/api'; + import type * as Type from '@/services/types'; import './index.scss'; diff --git a/ui/src/pages/Tags/Detail/index.tsx b/ui/src/pages/Tags/Detail/index.tsx index 10d7d05b..59be9fca 100644 --- a/ui/src/pages/Tags/Detail/index.tsx +++ b/ui/src/pages/Tags/Detail/index.tsx @@ -3,10 +3,10 @@ import { Container, Row, Col, Button } from 'react-bootstrap'; import { useParams, Link, useNavigate } from 'react-router-dom'; import { useTranslation } from 'react-i18next'; -import * as Type from '@/services/types'; import { PageTitle, FollowingTags } from '@answer/components'; import { useTagInfo, useFollow } from '@answer/api'; +import * as Type from '@/services/types'; import QuestionList from '@/components/Questions'; import HotQuestions from '@/components/HotQuestions'; diff --git a/ui/src/pages/Users/AccountForgot/components/sendEmail.tsx b/ui/src/pages/Users/AccountForgot/components/sendEmail.tsx index 2e599404..bc5a4533 100644 --- a/ui/src/pages/Users/AccountForgot/components/sendEmail.tsx +++ b/ui/src/pages/Users/AccountForgot/components/sendEmail.tsx @@ -3,6 +3,7 @@ import { Form, Button } from 'react-bootstrap'; import { useTranslation } from 'react-i18next'; import { passRetrieve, checkImgCode } from '@answer/api'; + import type { FormDataType } from '@/common/interface'; import type { ImgCodeRes, PssRetReq } from '@/services/types'; import { PicAuthCodeModal } from '@/components/Modal'; diff --git a/ui/src/pages/Users/Login/index.tsx b/ui/src/pages/Users/Login/index.tsx index f605e216..49a27928 100644 --- a/ui/src/pages/Users/Login/index.tsx +++ b/ui/src/pages/Users/Login/index.tsx @@ -3,13 +3,14 @@ import { Container, Form, Button, Col } from 'react-bootstrap'; import { Link } from 'react-router-dom'; import { Trans, useTranslation } from 'react-i18next'; -import type { FormDataType } from '@/common/interface'; import { login, checkImgCode } from '@answer/api'; -import type { LoginReqParams, ImgCodeRes } from '@/services/types'; import { PageTitle, Unactivate } from '@answer/components'; -import { PicAuthCodeModal } from '@/components/Modal'; import { userInfoStore } from '@answer/stores'; import { isLogin, getQueryString } from '@answer/utils'; + +import { PicAuthCodeModal } from '@/components/Modal'; +import type { LoginReqParams, ImgCodeRes } from '@/services/types'; +import type { FormDataType } from '@/common/interface'; import Storage from '@/utils/storage'; const Index: React.FC = () => { diff --git a/ui/src/pages/Users/PasswordReset/index.tsx b/ui/src/pages/Users/PasswordReset/index.tsx index 3cd9d876..7ae81d14 100644 --- a/ui/src/pages/Users/PasswordReset/index.tsx +++ b/ui/src/pages/Users/PasswordReset/index.tsx @@ -3,12 +3,12 @@ import { Container, Col, Form, Button } from 'react-bootstrap'; import { Link } from 'react-router-dom'; import { useTranslation } from 'react-i18next'; -import type { FormDataType } from '@/common/interface'; import { passRetrieveSet } from '@answer/api'; import { userInfoStore } from '@answer/stores'; -import Storage from '@/utils/storage'; import { getQueryString, isLogin } from '@answer/utils'; +import Storage from '@/utils/storage'; +import type { FormDataType } from '@/common/interface'; import { PageTitle } from '@/components'; const Index: React.FC = () => { diff --git a/ui/src/pages/Users/Personal/components/UserInfo/index.tsx b/ui/src/pages/Users/Personal/components/UserInfo/index.tsx index db2bf3ba..69cffd21 100644 --- a/ui/src/pages/Users/Personal/components/UserInfo/index.tsx +++ b/ui/src/pages/Users/Personal/components/UserInfo/index.tsx @@ -3,6 +3,7 @@ import { Badge, OverlayTrigger, Tooltip } from 'react-bootstrap'; import { useTranslation } from 'react-i18next'; import { Avatar, Icon } from '@answer/components'; + import type { UserInfoRes } from '@/services/types'; interface Props { diff --git a/ui/src/pages/Users/Register/components/SignUpForm/index.tsx b/ui/src/pages/Users/Register/components/SignUpForm/index.tsx index 549f93b2..8fd7c054 100644 --- a/ui/src/pages/Users/Register/components/SignUpForm/index.tsx +++ b/ui/src/pages/Users/Register/components/SignUpForm/index.tsx @@ -4,6 +4,7 @@ import { Link } from 'react-router-dom'; import { Trans, useTranslation } from 'react-i18next'; import { register } from '@answer/api'; + import type { FormDataType } from '@/common/interface'; import userStore from '@/stores/userInfo'; diff --git a/ui/src/pages/Users/Settings/Account/components/ModifyEmail/index.tsx b/ui/src/pages/Users/Settings/Account/components/ModifyEmail/index.tsx index d363a0e3..39f1d841 100644 --- a/ui/src/pages/Users/Settings/Account/components/ModifyEmail/index.tsx +++ b/ui/src/pages/Users/Settings/Account/components/ModifyEmail/index.tsx @@ -2,11 +2,12 @@ import React, { FC, FormEvent, useEffect, useState } from 'react'; import { Form, Button } from 'react-bootstrap'; import { useTranslation } from 'react-i18next'; -import type { FormDataType } from '@/common/interface'; -import type * as Type from '@/services/types'; import { getUserInfo, changeEmail } from '@answer/api'; import { useToast } from '@answer/hooks'; +import type { FormDataType } from '@/common/interface'; +import type * as Type from '@/services/types'; + const reg = /(?<=.{2}).+(?=@)/gi; const Index: FC = () => { diff --git a/ui/src/pages/Users/Settings/Account/components/ModifyPass/index.tsx b/ui/src/pages/Users/Settings/Account/components/ModifyPass/index.tsx index a59efaf1..92d55eff 100644 --- a/ui/src/pages/Users/Settings/Account/components/ModifyPass/index.tsx +++ b/ui/src/pages/Users/Settings/Account/components/ModifyPass/index.tsx @@ -2,10 +2,11 @@ import React, { FC, FormEvent, useState } from 'react'; import { Form, Button } from 'react-bootstrap'; import { useTranslation } from 'react-i18next'; -import type { FormDataType } from '@/common/interface'; import { modifyPassword } from '@answer/api'; import { useToast } from '@answer/hooks'; +import type { FormDataType } from '@/common/interface'; + const Index: FC = () => { const { t } = useTranslation('translation', { keyPrefix: 'settings.account', diff --git a/ui/src/pages/Users/Settings/Interface/index.tsx b/ui/src/pages/Users/Settings/Interface/index.tsx index 05cdaa89..9e3f85ec 100644 --- a/ui/src/pages/Users/Settings/Interface/index.tsx +++ b/ui/src/pages/Users/Settings/Interface/index.tsx @@ -7,9 +7,10 @@ import en from 'dayjs/locale/en'; import zh from 'dayjs/locale/zh-cn'; import { languages } from '@answer/api'; +import { useToast } from '@answer/hooks'; + import type { FormDataType } from '@/common/interface'; import type { LangsType } from '@/services/types'; -import { useToast } from '@answer/hooks'; import Storage from '@/utils/storage'; const Index = () => { diff --git a/ui/src/pages/Users/Settings/Notification/index.tsx b/ui/src/pages/Users/Settings/Notification/index.tsx index 454bfcd1..acc7088b 100644 --- a/ui/src/pages/Users/Settings/Notification/index.tsx +++ b/ui/src/pages/Users/Settings/Notification/index.tsx @@ -2,10 +2,11 @@ import React, { useState, FormEvent, useEffect } from 'react'; import { Form, Button } from 'react-bootstrap'; import { useTranslation } from 'react-i18next'; -import type { FormDataType } from '@/common/interface'; import { noticeSet, getUserInfo } from '@answer/api'; import { useToast } from '@answer/hooks'; +import type { FormDataType } from '@/common/interface'; + const Index = () => { const toast = useToast(); const { t } = useTranslation('translation', { diff --git a/ui/src/pages/Users/Settings/Profile/index.tsx b/ui/src/pages/Users/Settings/Profile/index.tsx index 6ffcd2f0..c5a105b5 100644 --- a/ui/src/pages/Users/Settings/Profile/index.tsx +++ b/ui/src/pages/Users/Settings/Profile/index.tsx @@ -5,11 +5,12 @@ import { Trans, useTranslation } from 'react-i18next'; import { marked } from 'marked'; import { modifyUserInfo, uploadAvatar, getUserInfo } from '@answer/api'; -import type { FormDataType } from '@/common/interface'; import { UploadImg, Avatar } from '@answer/components'; import { userInfoStore } from '@answer/stores'; import { useToast } from '@answer/hooks'; +import type { FormDataType } from '@/common/interface'; + const Index: React.FC = () => { const { t } = useTranslation('translation', { keyPrefix: 'settings.profile', diff --git a/ui/src/pages/Users/Settings/index.tsx b/ui/src/pages/Users/Settings/index.tsx index 65962058..1f39e628 100644 --- a/ui/src/pages/Users/Settings/index.tsx +++ b/ui/src/pages/Users/Settings/index.tsx @@ -4,10 +4,10 @@ import { useTranslation } from 'react-i18next'; import { Outlet } from 'react-router-dom'; import { getUserInfo } from '@answer/api'; -import type { FormDataType } from '@/common/interface'; import Nav from './components/Nav'; +import type { FormDataType } from '@/common/interface'; import { PageTitle } from '@/components'; const Index: React.FC = () => {