style: format code

This commit is contained in:
robin 2022-09-29 10:35:11 +08:00
parent 15392fabb4
commit 99b3e8d096
15 changed files with 32 additions and 15 deletions

View File

@ -166,7 +166,13 @@ const TagSelector: FC<IProps> = ({
variant="outline-secondary"
size="sm">
{item.slug_name}
<Icon name="x" onClick={() => handleRemove(item)} />
<Button
className="btn-no-border"
variant="link"
onClick={() => handleRemove(item)}>
x
</Button>
</Button>
);
})}

View File

@ -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;

View File

@ -12,6 +12,7 @@ import {
modifyAnswer,
useQueryRevisions,
} from '@answer/api';
import type * as Type from '@/services/types';
import './index.scss';

View File

@ -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';

View File

@ -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';

View File

@ -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 = () => {

View File

@ -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 = () => {

View File

@ -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 {

View File

@ -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';

View File

@ -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 = () => {

View File

@ -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',

View File

@ -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 = () => {

View File

@ -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', {

View File

@ -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',

View File

@ -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 = () => {