feat(client): add welcome card (#1606)
Co-authored-by: sealday <sealday@gmail.com> Reviewed-on: daoyoucloud/tachybase#1606
This commit is contained in:
parent
e679b0b32e
commit
ee7f011b31
@ -0,0 +1,47 @@
|
|||||||
|
import React from 'react';
|
||||||
|
|
||||||
|
import { css } from '@emotion/css';
|
||||||
|
import { Button, Card, Flex, Space, Typography } from 'antd';
|
||||||
|
import { Outlet, useMatch, useParams } from 'react-router';
|
||||||
|
|
||||||
|
import { PageTab } from '../page-style/PageTab';
|
||||||
|
import { usePageStyle } from '../page-style/usePageStyle';
|
||||||
|
|
||||||
|
const WelcomeCard = () => {
|
||||||
|
return (
|
||||||
|
<Card
|
||||||
|
className={css`
|
||||||
|
max-width: 800px;
|
||||||
|
margin: 24px auto;
|
||||||
|
`}
|
||||||
|
>
|
||||||
|
<Typography.Title>欢迎来到塔奇平台</Typography.Title>
|
||||||
|
|
||||||
|
<Typography.Text>
|
||||||
|
塔奇平台致力于打造一个用户友好的应用研发平台,旨在降低开发门槛,提升研发效率,为企业用户和开发者提供一站式解决方案。
|
||||||
|
</Typography.Text>
|
||||||
|
<Flex
|
||||||
|
justify="flex-end"
|
||||||
|
className={css`
|
||||||
|
margin-top: 48px;
|
||||||
|
`}
|
||||||
|
>
|
||||||
|
<Space>
|
||||||
|
<Button>使用手册</Button>
|
||||||
|
<Button type="primary">新增入口</Button>
|
||||||
|
</Space>
|
||||||
|
</Flex>
|
||||||
|
</Card>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export const AdminContent = () => {
|
||||||
|
const isMatchAdmin = useMatch('/admin');
|
||||||
|
const params = useParams<any>();
|
||||||
|
const pageStyle = usePageStyle();
|
||||||
|
if (isMatchAdmin) {
|
||||||
|
return <WelcomeCard />;
|
||||||
|
} else {
|
||||||
|
return params.name && pageStyle === 'tab' ? <PageTab /> : <Outlet />;
|
||||||
|
}
|
||||||
|
};
|
@ -28,6 +28,7 @@ import { Plugin } from '../../application/Plugin';
|
|||||||
import { VariablesProvider } from '../../variables';
|
import { VariablesProvider } from '../../variables';
|
||||||
import { PageTab } from '../page-style/PageTab';
|
import { PageTab } from '../page-style/PageTab';
|
||||||
import { usePageStyle } from '../page-style/usePageStyle';
|
import { usePageStyle } from '../page-style/usePageStyle';
|
||||||
|
import { AdminContent } from './AdminContent';
|
||||||
import { NoticeArea } from './NoticeArea';
|
import { NoticeArea } from './NoticeArea';
|
||||||
|
|
||||||
const useStyles = createStyles(({ css, token }) => {
|
const useStyles = createStyles(({ css, token }) => {
|
||||||
@ -450,7 +451,9 @@ export const InternalAdminLayout = (props: any) => {
|
|||||||
{params.name && <Layout.Sider className={styles.sider} theme={'light'} ref={sideMenuRef}></Layout.Sider>}
|
{params.name && <Layout.Sider className={styles.sider} theme={'light'} ref={sideMenuRef}></Layout.Sider>}
|
||||||
<Layout.Content className={styles.main}>
|
<Layout.Content className={styles.main}>
|
||||||
<header className={styles.mainHeader}></header>
|
<header className={styles.mainHeader}></header>
|
||||||
<div className="amplifier-block">{params.name && pageStyle === 'tab' ? <PageTab /> : <Outlet />}</div>
|
<div className="amplifier-block">
|
||||||
|
<AdminContent />
|
||||||
|
</div>
|
||||||
</Layout.Content>
|
</Layout.Content>
|
||||||
</Layout>
|
</Layout>
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user