From a6b6f840e3e2297fd97b474435bd7ce563fd43ad Mon Sep 17 00:00:00 2001 From: chenos Date: Sun, 10 Apr 2022 15:03:43 +0800 Subject: [PATCH] feat: powered by --- packages/client/src/index.tsx | 2 ++ packages/client/src/powered-by/index.tsx | 27 +++++++++++++++++++ .../route-switch/antd/admin-layout/index.tsx | 20 +++++++++++++- .../route-switch/antd/auth-layout/index.tsx | 13 +++++++++ 4 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 packages/client/src/powered-by/index.tsx diff --git a/packages/client/src/index.tsx b/packages/client/src/index.tsx index 3866cf481..4727a7247 100644 --- a/packages/client/src/index.tsx +++ b/packages/client/src/index.tsx @@ -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'; + diff --git a/packages/client/src/powered-by/index.tsx b/packages/client/src/powered-by/index.tsx new file mode 100644 index 000000000..2191f91e1 --- /dev/null +++ b/packages/client/src/powered-by/index.tsx @@ -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 ( +
+ Powered by NocoBase +
+ ); +}; diff --git a/packages/client/src/route-switch/antd/admin-layout/index.tsx b/packages/client/src/route-switch/antd/admin-layout/index.tsx index d5bd104db..0c104b9e3 100644 --- a/packages/client/src/route-switch/antd/admin-layout/index.tsx +++ b/packages/client/src/route-switch/antd/admin-layout/index.tsx @@ -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) => { - {props.children} + + {props.children} + + + + ); diff --git a/packages/client/src/route-switch/antd/auth-layout/index.tsx b/packages/client/src/route-switch/antd/auth-layout/index.tsx index fee86bdc8..985e65883 100644 --- a/packages/client/src/route-switch/antd/auth-layout/index.tsx +++ b/packages/client/src/route-switch/antd/auth-layout/index.tsx @@ -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) { >

NocoBase

{props.children} +
+ +
); }