-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8f9dce9
commit 1dbb752
Showing
7 changed files
with
5,304 additions
and
8,731 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,6 +24,7 @@ dist-ssr | |
*.njsproj | ||
*.sln | ||
*.sw? | ||
emails/exported-emails | ||
|
||
# Sentry Config File | ||
.env.sentry-build-plugin | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import * as React from "react"; | ||
import { | ||
Body, | ||
Container, | ||
Head, | ||
Html, | ||
Preview, | ||
Tailwind, | ||
} from "@react-email/components"; | ||
|
||
type BaseEmailTemplateProps = { | ||
preview: string; | ||
} & React.PropsWithChildren; | ||
|
||
export const BaseEmailTemplate = ({ | ||
preview, | ||
children, | ||
}: BaseEmailTemplateProps) => { | ||
return ( | ||
<Html> | ||
<Head></Head> | ||
<Tailwind> | ||
<Preview>{preview}</Preview> | ||
<Body className='mx-auto my-auto bg-gray-400 p-10 px-2 font-sans'> | ||
<Container className='mx-auto max-w-[340px] rounded-[20px] border border-solid border-gray-600 bg-white p-6'> | ||
{children} | ||
</Container> | ||
</Body> | ||
</Tailwind> | ||
</Html> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export * from "./base"; | ||
export * from "./text"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import React from "react"; | ||
import { Text as ReactEmailText } from "@react-email/components"; | ||
import { tv, VariantProps } from "tailwind-variants"; | ||
|
||
const emailText = tv({ | ||
base: "m-0 leading-tight tracking-[.5%]", | ||
variants: { | ||
variant: { | ||
base: "text-black", | ||
error: "text-red-500", | ||
info: "text-blue-500", | ||
success: "text-green-500", | ||
}, | ||
size: { | ||
default: "text-base", | ||
small: "text-sm", | ||
title: "text-2xl", | ||
}, | ||
}, | ||
defaultVariants: { | ||
variant: "base", | ||
size: "default", | ||
}, | ||
}); | ||
|
||
type Props = { | ||
className?: string; | ||
} & React.PropsWithChildren & | ||
VariantProps<typeof emailText>; | ||
|
||
export const EmailText = ({ variant, size, className, children }: Props) => { | ||
return ( | ||
<ReactEmailText className={emailText({ variant, size, className })}> | ||
{children} | ||
</ReactEmailText> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import * as React from "react"; | ||
|
||
import { BaseEmailTemplate, EmailText } from "./_components"; | ||
|
||
export default function ExampleEmail() { | ||
return ( | ||
<BaseEmailTemplate preview='This is an example email'> | ||
<EmailText size='title'>Example Email</EmailText> | ||
<EmailText className='my-4'> | ||
Lorem, ipsum dolor sit amet consectetur adipisicing elit. Possimus | ||
corrupti incidunt eius deserunt ullam? Rem laborum beatae porro earum | ||
suscipit doloremque obcaecati maxime atque fugiat placeat itaque magni, | ||
aut veritatis consequatur eum, voluptates quas quod ipsam temporibus | ||
numquam nam quam. | ||
</EmailText> | ||
<EmailText> | ||
Lorem, ipsum dolor sit amet consectetur adipisicing elit. Possimus | ||
corrupti incidunt eius deserunt ullam? Rem laborum beatae porro earum | ||
suscipit doloremque obcaecati maxime atque fugiat placeat itaque magni, | ||
aut veritatis consequatur eum, voluptates quas quod ipsam temporibus | ||
numquam nam quam. | ||
</EmailText> | ||
</BaseEmailTemplate> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.