Add new email components: Content and Header

Two new functionalities for email templates have been introduced. A 'content' component which provides a container complete with border and padding specifications, and a 'header' component which simply encapsulates its child items. Both use the '@react-email/components' container for layout.
This commit is contained in:
gbuomprisco
2024-06-21 17:00:38 +08:00
parent e96651d19b
commit 8c929e6685
2 changed files with 29 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
import { Container } from '@react-email/components';
import * as React from 'react';
export function EmailContent(
props: React.PropsWithChildren<{
className?: string;
}>,
) {
return (
<Container
className={
'rounded-xl my-[8px] px-[24px] py-[12px] mx-auto border border-solid border-[#eeeeee] ' +
props.className || ''
}
>
{props.children}
</Container>
);
}

View File

@@ -0,0 +1,10 @@
import { Container } from '@react-email/components';
import * as React from 'react';
export function EmailHeader(props: React.PropsWithChildren) {
return (
<Container>
{props.children}
</Container>
);
}