mirror of https://gitee.com/answerdev/answer.git
refeactor(components): remove unnecessary component AdminHeader
This commit is contained in:
parent
a18bad72f0
commit
1590b662f6
|
@ -1,23 +0,0 @@
|
|||
import { FC, memo } from 'react';
|
||||
import { Container } from 'react-bootstrap';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { useMatch } from 'react-router-dom';
|
||||
|
||||
const Index: FC = () => {
|
||||
const { t } = useTranslation('translation', {
|
||||
keyPrefix: 'admin.admin_header',
|
||||
});
|
||||
const adminPathMatch = useMatch('/admin/*');
|
||||
if (!adminPathMatch) {
|
||||
return null;
|
||||
}
|
||||
return (
|
||||
<div className="bg-light py-2">
|
||||
<Container className="py-1">
|
||||
<h6 className="mb-0 fw-bold lh-base">{t('title')}</h6>
|
||||
</Container>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default memo(Index);
|
|
@ -18,7 +18,6 @@ import TextArea from './TextArea';
|
|||
import Mentions from './Mentions';
|
||||
import FormatTime from './FormatTime';
|
||||
import Toast from './Toast';
|
||||
import AdminHeader from './AdminHeader';
|
||||
import AccordionNav from './AccordionNav';
|
||||
import PageTitle from './PageTitle';
|
||||
import Empty from './Empty';
|
||||
|
@ -50,7 +49,6 @@ export {
|
|||
Mentions,
|
||||
FormatTime,
|
||||
Toast,
|
||||
AdminHeader,
|
||||
AccordionNav,
|
||||
PageTitle,
|
||||
Empty,
|
||||
|
|
|
@ -3,7 +3,7 @@ import { Container, Row, Col } from 'react-bootstrap';
|
|||
import { useTranslation } from 'react-i18next';
|
||||
import { Outlet, useLocation } from 'react-router-dom';
|
||||
|
||||
import { AccordionNav, AdminHeader, PageTitle } from '@/components';
|
||||
import { AccordionNav, PageTitle } from '@/components';
|
||||
import { ADMIN_NAV_MENUS } from '@/common/constants';
|
||||
|
||||
import './index.scss';
|
||||
|
@ -20,10 +20,17 @@ const formPaths = [
|
|||
const Index: FC = () => {
|
||||
const { t } = useTranslation('translation', { keyPrefix: 'page_title' });
|
||||
const { pathname } = useLocation();
|
||||
|
||||
return (
|
||||
<>
|
||||
<PageTitle title={t('admin')} />
|
||||
<AdminHeader />
|
||||
<div className="bg-light py-2">
|
||||
<Container className="py-1">
|
||||
<h6 className="mb-0 fw-bold lh-base">
|
||||
{t('title', { keyPrefix: 'admin.admin_header' })}
|
||||
</h6>
|
||||
</Container>
|
||||
</div>
|
||||
<Container className="admin-container">
|
||||
<Row>
|
||||
<Col lg={2}>
|
||||
|
|
Loading…
Reference in New Issue