mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-19 02:56:23 +08:00
feat(admin): adapt new config system (#11360)
feat(server): add test mail api feat(admin): adapt new config system
This commit is contained in:
@@ -195,7 +195,7 @@ export function Template(props: PropsWithChildren) {
|
||||
</>
|
||||
);
|
||||
|
||||
if (env.testing) {
|
||||
if (globalThis.env?.testing) {
|
||||
return content;
|
||||
}
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@ import {
|
||||
TeamWorkspaceDeleted,
|
||||
TeamWorkspaceUpgraded,
|
||||
} from './teams';
|
||||
import TestMail from './test-mail';
|
||||
import {
|
||||
ChangeEmail,
|
||||
ChangeEmailNotification,
|
||||
@@ -45,7 +46,7 @@ function render(component: React.ReactElement) {
|
||||
});
|
||||
}
|
||||
|
||||
type Props<T> = T extends React.FC<infer P> ? P : never;
|
||||
type Props<T> = T extends React.ComponentType<infer P> ? P : never;
|
||||
export type EmailRenderer<Props> = (props: Props) => Promise<EmailContent>;
|
||||
|
||||
function make<T extends React.ComponentType<any>>(
|
||||
@@ -65,6 +66,10 @@ function make<T extends React.ComponentType<any>>(
|
||||
}
|
||||
|
||||
export const Renderers = {
|
||||
//#region Test
|
||||
TestMail: make(TestMail, 'Test Email from AFFiNE'),
|
||||
//#endregion
|
||||
|
||||
//#region User
|
||||
SignIn: make(SignIn, 'Sign in to AFFiNE'),
|
||||
SignUp: make(SignUp, 'Your AFFiNE account is waiting for you!'),
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
import { Content, P, Template, Title } from './components';
|
||||
|
||||
export default function TestMail() {
|
||||
return (
|
||||
<Template>
|
||||
<Title>Test Email from AFFiNE</Title>
|
||||
<Content>
|
||||
<P>This is a test email from your AFFiNE instance.</P>
|
||||
</Content>
|
||||
</Template>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user