refactor: tidy all constants to commom/constants

This commit is contained in:
haitao(lj) 2022-09-28 16:13:27 +08:00
parent bb8f0647a6
commit 5e61ece028
7 changed files with 27 additions and 26 deletions

View File

@ -34,3 +34,25 @@ export const ADMIN_LIST_STATUS = {
name: 'deleted',
},
};
export const ADMIN_NAV_MENUS = [
{
name: 'dashboard',
children: [],
},
{
name: 'contents',
child: [{ name: 'questions' }, { name: 'answers' }],
},
{
name: 'users',
},
{
name: 'flags',
// badgeContent: 5,
},
{
name: 'settings',
child: [{ name: 'general' }, { name: 'interface' }],
},
];

View File

@ -18,7 +18,7 @@ import {
BaseUserCard,
Empty,
} from '@answer/components';
import { ADMIN_LIST_STATUS } from '@answer/common';
import { ADMIN_LIST_STATUS } from '@answer/common/constants';
import { useEditStatusModal } from '@answer/hooks';
import * as Type from '@/services/types';

View File

@ -18,7 +18,7 @@ import {
BaseUserCard,
Empty,
} from '@answer/components';
import { ADMIN_LIST_STATUS } from '@answer/common';
import { ADMIN_LIST_STATUS } from '@answer/common/constants';
import { useEditStatusModal, useReportModal } from '@answer/hooks';
import { questionDelete } from '@answer/services/api';

View File

@ -11,7 +11,7 @@ import {
import { AccordionNav } from '@answer/components';
import { ADMIN_NAV_MENUS } from '@/pages/Admin/admin.constants';
import { ADMIN_NAV_MENUS } from '@answer/common/constants';
import '../index.scss';
const UserOverview: FC = () => {

View File

@ -1,21 +0,0 @@
export const ADMIN_NAV_MENUS = [
{
name: 'dashboard',
children: [],
},
{
name: 'contents',
child: [{ name: 'questions' }, { name: 'answers' }],
},
{
name: 'users',
},
{
name: 'flags',
// badgeContent: 5,
},
{
name: 'settings',
child: [{ name: 'general' }, { name: 'interface' }],
},
];

View File

@ -5,7 +5,7 @@ import { Outlet } from 'react-router-dom';
import { AccordionNav, PageTitle } from '@answer/components';
import { ADMIN_NAV_MENUS } from '@/pages/Admin/admin.constants';
import { ADMIN_NAV_MENUS } from '@answer/common/constants';
import './index.scss';

View File

@ -1,4 +1,4 @@
import { LOGIN_NEED_BACK } from '@answer/common';
import { LOGIN_NEED_BACK } from '@answer/common/constants';
import Storage from './storage';