mirror of https://gitee.com/answerdev/answer.git
Merge branch 'ui' of git.backyard.segmentfault.com:opensource/answer into ui
This commit is contained in:
commit
0144033216
|
@ -49,9 +49,9 @@ when cloning repo, and run `pnpm install` to init dependencies. you can use proj
|
|||
|
||||
## 🖥 Environment Support
|
||||
|
||||
| [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/edge/edge_48x48.png" alt="IE / Edge" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)<br>Edge / IE | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/firefox/firefox_48x48.png" alt="Firefox" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)<br>Firefox | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/chrome/chrome_48x48.png" alt="Chrome" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)<br>Chrome | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/safari/safari_48x48.png" alt="Safari" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)<br>Safari |
|
||||
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| Edge, IE11 | last 2 versions | last 2 versions | last 2 versions |
|
||||
| [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/edge/edge_48x48.png" alt="Edge" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)<br>Edge | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/firefox/firefox_48x48.png" alt="Firefox" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)<br>Firefox | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/chrome/chrome_48x48.png" alt="Chrome" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)<br>Chrome | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/safari/safari_48x48.png" alt="Safari" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)<br>Safari |
|
||||
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| last 2 versions | last 2 versions | last 2 versions | last 2 versions |
|
||||
|
||||
## Build with
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ import {
|
|||
postAnswer,
|
||||
useQueryQuestionByTitle,
|
||||
} from '@answer/api';
|
||||
import type * as Type from '@answer/services/types';
|
||||
import type * as Type from '@/services/types';
|
||||
|
||||
import SearchQuestion from './components/SearchQuestion';
|
||||
|
|
@ -5,9 +5,10 @@ import { useTranslation } from 'react-i18next';
|
|||
import { marked } from 'marked';
|
||||
|
||||
import { Editor, Modal } from '@answer/components';
|
||||
import { FormDataType } from '@answer/common/interface';
|
||||
import { postAnswer } from '@answer/api';
|
||||
|
||||
import { FormDataType } from '@/common/interface';
|
||||
|
||||
interface Props {
|
||||
visible?: boolean;
|
||||
data: {
|
|
@ -4,11 +4,6 @@ import { useParams, useSearchParams } from 'react-router-dom';
|
|||
|
||||
import { questionDetail, getAnswers } from '@answer/api';
|
||||
import { Pagination, PageTitle } from '@answer/components';
|
||||
import type {
|
||||
ListResult,
|
||||
QuDetailRes,
|
||||
AnswerItem,
|
||||
} from '@answer/services/types';
|
||||
import { userInfoStore } from '@answer/stores';
|
||||
import { scrollTop } from '@answer/utils';
|
||||
import { usePageUsers } from '@answer/hooks';
|
||||
|
@ -22,6 +17,8 @@ import {
|
|||
Alert,
|
||||
} from './components';
|
||||
|
||||
import type { ListResult, QuDetailRes, AnswerItem } from '@/services/types';
|
||||
|
||||
import './index.scss';
|
||||
|
||||
const Index = () => {
|
|
@ -12,7 +12,7 @@ import {
|
|||
modifyAnswer,
|
||||
useQueryRevisions,
|
||||
} from '@answer/api';
|
||||
import type * as Type from '@answer/services/types';
|
||||
import type * as Type from '@/services/types';
|
||||
|
||||
import './index.scss';
|
||||
|
|
@ -3,7 +3,7 @@ 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 '@answer/services/types';
|
||||
import * as Type from '@/services/types';
|
||||
import { PageTitle, FollowingTags } from '@answer/components';
|
||||
import { useTagInfo, useFollow } from '@answer/api';
|
||||
|
|
@ -3,9 +3,9 @@ import { Form, Button } from 'react-bootstrap';
|
|||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
import { passRetrieve, checkImgCode } from '@answer/api';
|
||||
import type { FormDataType } from '@answer/common/interface';
|
||||
import type { ImgCodeRes, PssRetReq } from '@answer/services/types';
|
||||
import { PicAuthCodeModal } from '@answer/components/Modal';
|
||||
import type { FormDataType } from '@/common/interface';
|
||||
import type { ImgCodeRes, PssRetReq } from '@/services/types';
|
||||
import { PicAuthCodeModal } from '@/components/Modal';
|
||||
|
||||
interface IProps {
|
||||
visible: boolean;
|
|
@ -3,14 +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 '@answer/common/interface';
|
||||
import type { FormDataType } from '@/common/interface';
|
||||
import { login, checkImgCode } from '@answer/api';
|
||||
import type { LoginReqParams, ImgCodeRes } from '@answer/services/types';
|
||||
import type { LoginReqParams, ImgCodeRes } from '@/services/types';
|
||||
import { PageTitle, Unactivate } from '@answer/components';
|
||||
import { PicAuthCodeModal } from '@answer/components/Modal';
|
||||
import { PicAuthCodeModal } from '@/components/Modal';
|
||||
import { userInfoStore } from '@answer/stores';
|
||||
import { isLogin, getQueryString } from '@answer/utils';
|
||||
import Storage from '@answer/utils/storage';
|
||||
import Storage from '@/utils/storage';
|
||||
|
||||
const Index: React.FC = () => {
|
||||
const { t } = useTranslation('translation', { keyPrefix: 'login' });
|
|
@ -3,10 +3,10 @@ import { Container, Col, Form, Button } from 'react-bootstrap';
|
|||
import { Link } from 'react-router-dom';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
import type { FormDataType } from '@answer/common/interface';
|
||||
import type { FormDataType } from '@/common/interface';
|
||||
import { passRetrieveSet } from '@answer/api';
|
||||
import { userInfoStore } from '@answer/stores';
|
||||
import Storage from '@answer/utils/storage';
|
||||
import Storage from '@/utils/storage';
|
||||
import { getQueryString, isLogin } from '@answer/utils';
|
||||
|
||||
import { PageTitle } from '@/components';
|
|
@ -3,7 +3,7 @@ import { Badge, OverlayTrigger, Tooltip } from 'react-bootstrap';
|
|||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
import { Avatar, Icon } from '@answer/components';
|
||||
import type { UserInfoRes } from '@answer/services/types';
|
||||
import type { UserInfoRes } from '@/services/types';
|
||||
|
||||
interface Props {
|
||||
data: UserInfoRes;
|
|
@ -4,8 +4,8 @@ import { Link } from 'react-router-dom';
|
|||
import { Trans, useTranslation } from 'react-i18next';
|
||||
|
||||
import { register } from '@answer/api';
|
||||
import type { FormDataType } from '@answer/common/interface';
|
||||
import userStore from '@answer/stores/userInfo';
|
||||
import type { FormDataType } from '@/common/interface';
|
||||
import userStore from '@/stores/userInfo';
|
||||
|
||||
interface Props {
|
||||
callback: () => void;
|
|
@ -2,8 +2,8 @@ import React, { FC, FormEvent, useEffect, useState } from 'react';
|
|||
import { Form, Button } from 'react-bootstrap';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
import type { FormDataType } from '@answer/common/interface';
|
||||
import type * as Type from '@answer/services/types';
|
||||
import type { FormDataType } from '@/common/interface';
|
||||
import type * as Type from '@/services/types';
|
||||
import { getUserInfo, changeEmail } from '@answer/api';
|
||||
import { useToast } from '@answer/hooks';
|
||||
|
|
@ -2,7 +2,7 @@ import React, { FC, FormEvent, useState } from 'react';
|
|||
import { Form, Button } from 'react-bootstrap';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
import type { FormDataType } from '@answer/common/interface';
|
||||
import type { FormDataType } from '@/common/interface';
|
||||
import { modifyPassword } from '@answer/api';
|
||||
import { useToast } from '@answer/hooks';
|
||||
|
|
@ -7,10 +7,10 @@ import en from 'dayjs/locale/en';
|
|||
import zh from 'dayjs/locale/zh-cn';
|
||||
|
||||
import { languages } from '@answer/api';
|
||||
import type { FormDataType } from '@answer/common/interface';
|
||||
import type { LangsType } from '@answer/services/types';
|
||||
import type { FormDataType } from '@/common/interface';
|
||||
import type { LangsType } from '@/services/types';
|
||||
import { useToast } from '@answer/hooks';
|
||||
import Storage from '@answer/utils/storage';
|
||||
import Storage from '@/utils/storage';
|
||||
|
||||
const Index = () => {
|
||||
const { t, i18n } = useTranslation('translation', {
|
|
@ -2,7 +2,7 @@ import React, { useState, FormEvent, useEffect } from 'react';
|
|||
import { Form, Button } from 'react-bootstrap';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
import type { FormDataType } from '@answer/common/interface';
|
||||
import type { FormDataType } from '@/common/interface';
|
||||
import { noticeSet, getUserInfo } from '@answer/api';
|
||||
import { useToast } from '@answer/hooks';
|
||||
|
|
@ -5,7 +5,7 @@ import { Trans, useTranslation } from 'react-i18next';
|
|||
import { marked } from 'marked';
|
||||
|
||||
import { modifyUserInfo, uploadAvatar, getUserInfo } from '@answer/api';
|
||||
import type { FormDataType } from '@answer/common/interface';
|
||||
import type { FormDataType } from '@/common/interface';
|
||||
import { UploadImg, Avatar } from '@answer/components';
|
||||
import { userInfoStore } from '@answer/stores';
|
||||
import { useToast } from '@answer/hooks';
|
||||
|
@ -181,7 +181,7 @@ const Index: React.FC = () => {
|
|||
<Trans i18nKey="settings.profile.avatar.text">
|
||||
You can upload your image or
|
||||
<a
|
||||
href="##"
|
||||
href="@/pages/Users/Settings/Profile/index##"
|
||||
onClick={(e) => {
|
||||
e.preventDefault();
|
||||
handleChange({
|
|
@ -4,7 +4,7 @@ import { useTranslation } from 'react-i18next';
|
|||
import { Outlet } from 'react-router-dom';
|
||||
|
||||
import { getUserInfo } from '@answer/api';
|
||||
import type { FormDataType } from '@answer/common/interface';
|
||||
import type { FormDataType } from '@/common/interface';
|
||||
|
||||
import Nav from './components/Nav';
|
||||
|
|
@ -22,25 +22,25 @@ const routeConfig: RouteNode[] = [
|
|||
},
|
||||
{
|
||||
path: 'questions/:qid',
|
||||
page: 'pages/QuestionDetail',
|
||||
page: 'pages/Questions/Detail',
|
||||
},
|
||||
{
|
||||
path: 'questions/:qid/:aid',
|
||||
page: 'pages/QuestionDetail',
|
||||
page: 'pages/Questions/Detail',
|
||||
},
|
||||
{
|
||||
path: 'questions/ask',
|
||||
page: 'pages/Ask',
|
||||
page: 'pages/Questions/Ask',
|
||||
rules: ['isLoginAndNormal'],
|
||||
},
|
||||
{
|
||||
path: 'posts/:qid/edit',
|
||||
page: 'pages/Ask',
|
||||
page: 'pages/Questions/Ask',
|
||||
rules: ['isLoginAndNormal'],
|
||||
},
|
||||
{
|
||||
path: 'posts/:qid/:aid/edit',
|
||||
page: 'pages/EditAnswer',
|
||||
page: 'pages/Questions/EditAnswer',
|
||||
},
|
||||
{
|
||||
path: '/search',
|
||||
|
@ -53,90 +53,90 @@ const routeConfig: RouteNode[] = [
|
|||
},
|
||||
{
|
||||
path: 'tags/:tagName',
|
||||
page: 'pages/TagDetail',
|
||||
page: 'pages/Tags/Detail',
|
||||
},
|
||||
{
|
||||
path: 'tags/:tagName/info',
|
||||
page: 'pages/TagInfo',
|
||||
page: 'pages/Tags/Info',
|
||||
},
|
||||
{
|
||||
path: 'tags/:tagId/edit',
|
||||
page: 'pages/EditTag',
|
||||
page: 'pages/Tags/Edit',
|
||||
},
|
||||
// users
|
||||
{
|
||||
path: 'users/:username',
|
||||
page: 'pages/Personal',
|
||||
page: 'pages/Users/Personal',
|
||||
},
|
||||
{
|
||||
path: 'users/:username/:tabName',
|
||||
page: 'pages/Personal',
|
||||
page: 'pages/Users/Personal',
|
||||
},
|
||||
{
|
||||
path: 'users/settings',
|
||||
page: 'pages/Settings',
|
||||
page: 'pages/Users/Settings',
|
||||
children: [
|
||||
{
|
||||
index: true,
|
||||
page: 'pages/Settings/Profile',
|
||||
page: 'pages/Users/Settings/Profile',
|
||||
},
|
||||
{
|
||||
path: 'profile',
|
||||
page: 'pages/Settings/Profile',
|
||||
page: 'pages/Users/Settings/Profile',
|
||||
},
|
||||
{
|
||||
path: 'notify',
|
||||
page: 'pages/Settings/Notification',
|
||||
page: 'pages/Users/Settings/Notification',
|
||||
},
|
||||
{
|
||||
path: 'account',
|
||||
page: 'pages/Settings/Account',
|
||||
page: 'pages/Users/Settings/Account',
|
||||
},
|
||||
{
|
||||
path: 'interface',
|
||||
page: 'pages/Settings/Interface',
|
||||
page: 'pages/Users/Settings/Interface',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: 'users/notifications/:type',
|
||||
page: 'pages/Notifications',
|
||||
page: 'pages/Users/Notifications',
|
||||
},
|
||||
{
|
||||
path: 'users/login',
|
||||
page: 'pages/Login',
|
||||
page: 'pages/Users/Login',
|
||||
},
|
||||
{
|
||||
path: 'users/register',
|
||||
page: 'pages/Register',
|
||||
page: 'pages/Users/Register',
|
||||
},
|
||||
{
|
||||
path: 'users/account-recovery',
|
||||
page: 'pages/AccountForgot',
|
||||
page: 'pages/Users/AccountForgot',
|
||||
},
|
||||
{
|
||||
path: 'users/password-reset',
|
||||
page: 'pages/PasswordReset',
|
||||
page: 'pages/Users/PasswordReset',
|
||||
},
|
||||
{
|
||||
path: 'users/account-activation',
|
||||
page: 'pages/ActiveEmail',
|
||||
page: 'pages/Users/ActiveEmail',
|
||||
},
|
||||
{
|
||||
path: 'users/account-activation/success',
|
||||
page: 'pages/ActivationResult',
|
||||
page: 'pages/Users/ActivationResult',
|
||||
},
|
||||
{
|
||||
path: '/users/account-activation/failed',
|
||||
page: 'pages/ActivationResult',
|
||||
page: 'pages/Users/ActivationResult',
|
||||
},
|
||||
{
|
||||
path: '/users/confirm-new-email',
|
||||
page: 'pages/ConfirmNewEmail',
|
||||
page: 'pages/Users/ConfirmNewEmail',
|
||||
},
|
||||
{
|
||||
path: '/users/account-suspended',
|
||||
page: 'pages/Suspended',
|
||||
page: 'pages/Users/Suspended',
|
||||
},
|
||||
// for admin
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue