feat: powered by

This commit is contained in:
chenos 2022-04-10 15:03:43 +08:00
parent 6b1ff526eb
commit a6b6f840e3
4 changed files with 61 additions and 1 deletions

View File

@ -14,6 +14,7 @@ export * from './document-title';
export * from './i18n';
export * from './icon';
export * from './plugin-manager';
export * from './powered-by';
export * from './record-provider';
export * from './route-switch';
export * from './schema-component';
@ -25,3 +26,4 @@ export * from './slate';
export * from './system-settings';
export * from './user';
export * from './workflow';

View File

@ -0,0 +1,27 @@
import { css } from '@emotion/css';
import React from 'react';
import { useTranslation } from 'react-i18next';
export const PoweredBy = () => {
const { i18n } = useTranslation();
const urls = {
'en-US': 'https://www.nocobase.com',
'zh-CN': 'https://cn.nocobase.com',
};
return (
<div
className={css`
text-align: center;
color: rgba(0, 0, 0, 0.45);
a {
color: rgba(0, 0, 0, 0.45);
&:hover {
color: rgba(0,0,0,.85);
}
}
`}
>
Powered by <a href={urls[i18n.language] || urls['en-US']}>NocoBase</a>
</div>
);
};

View File

@ -15,6 +15,7 @@ import {
useRoute,
useSystemSettings
} from '../../../';
import { PoweredBy } from '../../../powered-by';
const InternalAdminLayout = (props: any) => {
const route = useRoute();
@ -111,7 +112,24 @@ const InternalAdminLayout = (props: any) => {
</Layout.Header>
<Layout>
<Layout.Sider style={{ display: 'none' }} theme={'light'} ref={sideMenuRef}></Layout.Sider>
<Layout.Content style={{ minHeight: 'calc(100vh - 46px)' }}>{props.children}</Layout.Content>
<Layout.Content
className={css`
min-height: calc(100vh - 46px);
position: relative;
padding-bottom: 70px;
.ant-layout-footer {
position: absolute;
bottom: 0;
text-align: center;
width: 100%;
}
`}
>
{props.children}
<Layout.Footer>
<PoweredBy />
</Layout.Footer>
</Layout.Content>
</Layout>
</Layout>
);

View File

@ -1,4 +1,6 @@
import { css } from '@emotion/css';
import React from 'react';
import { PoweredBy } from '../../../powered-by';
export function AuthLayout(props: any) {
return (
@ -11,6 +13,17 @@ export function AuthLayout(props: any) {
>
<h1>NocoBase</h1>
{props.children}
<div
className={css`
position: absolute;
bottom: 24px;
width: 100%;
left: 0;
text-align: center;
`}
>
<PoweredBy />
</div>
</div>
);
}