chore: set up twenty-emails config so build isn't needed in development (#3619)

* chore: set up twenty-emails config so build isn't needed in development

* fix: fix script dependency

* chore: use @vitejs/plugin-react-swc

* Remove useless dependancy

* Fix typing

* chore: use baseUrl in twenty-emails

* chore: fix docker server prod build

* refactor: optimize Docker file and tsconfig

* fix: fix WORKDIR in docker

---------

Co-authored-by: martmull <martmull@hotmail.fr>
This commit is contained in:
Thaïs
2024-01-29 06:17:12 -03:00
committed by GitHub
parent 7fdd7119d2
commit a654205dbc
29 changed files with 1108 additions and 141 deletions

View File

@ -1,13 +1,17 @@
import * as React from 'react';
import { PropsWithChildren } from 'react';
import { Container, Html } from '@react-email/components';
import { BaseHead } from 'src/components/BaseHead';
import { Logo } from 'src/components/Logo';
export const BaseEmail = ({ children, width = 290 }) => {
type BaseEmailProps = PropsWithChildren<{
width?: number;
}>;
export const BaseEmail = ({ children, width }: BaseEmailProps) => {
return (
<Html lang="en">
<BaseHead />
<Container width={width}>
<Container width={width || 290}>
<Logo />
{children}
</Container>

View File

@ -1,4 +1,3 @@
import * as React from 'react';
import { Font, Head } from '@react-email/components';
import { emailTheme } from 'src/common-style';

View File

@ -1,6 +1,7 @@
import * as React from 'react';
import { ReactNode } from 'react';
import { Button } from '@react-email/button';
import { emailTheme } from 'src/common-style';
const callToActionStyle = {
display: 'flex',
padding: '8px 32px',
@ -13,7 +14,12 @@ const callToActionStyle = {
fontWeight: emailTheme.font.weight.bold,
};
export const CallToAction = ({ value, href }) => {
type CallToActionProps = {
href: string;
value: ReactNode;
};
export const CallToAction = ({ value, href }: CallToActionProps) => {
return (
<Button href={href} style={callToActionStyle}>
{value}

View File

@ -1,4 +1,4 @@
import * as React from 'react';
import { ReactNode } from 'react';
import { Column } from '@react-email/components';
import { Row } from '@react-email/row';
import { Text } from '@react-email/text';
@ -18,7 +18,11 @@ const highlightedStyle = {
color: emailTheme.font.colors.highlighted,
};
export const HighlightedText = ({ value }) => {
type HighlightedTextProps = {
value: ReactNode;
};
export const HighlightedText = ({ value }: HighlightedTextProps) => {
return (
<Row style={rowStyle}>
<Column>

View File

@ -1,4 +1,4 @@
import * as React from 'react';
import { ReactNode } from 'react';
import { Link as EmailLink } from '@react-email/components';
import { emailTheme } from 'src/common-style';
@ -7,7 +7,12 @@ const linkStyle = {
textDecoration: 'underline',
};
export const Link = ({ value, href }) => {
type LinkProps = {
value: ReactNode;
href: string;
};
export const Link = ({ value, href }: LinkProps) => {
return (
<EmailLink href={href} style={linkStyle}>
{value}

View File

@ -1,4 +1,4 @@
import * as React from 'react';
import { PropsWithChildren } from 'react';
import { Text } from '@react-email/text';
import { emailTheme } from 'src/common-style';
@ -8,6 +8,6 @@ const mainTextStyle = {
color: emailTheme.font.colors.primary,
};
export const MainText = ({ children }) => {
export const MainText = ({ children }: PropsWithChildren) => {
return <Text style={mainTextStyle}>{children}</Text>;
};

View File

@ -1,6 +1,10 @@
import { ReactNode } from 'react';
import { Heading } from '@react-email/components';
import * as React from 'react';
export const Title = ({ value }) => {
type TitleProps = {
value: ReactNode;
};
export const Title = ({ value }: TitleProps) => {
return <Heading as="h1">{value}</Heading>;
};