-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(jsx-email,create-jsx-email): consolidate and fix TS types in temp…
…late (#242)
- Loading branch information
1 parent
3b5eed8
commit 735061b
Showing
6 changed files
with
115 additions
and
6 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
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
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
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
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 |
---|---|---|
@@ -1,3 +1,103 @@ | ||
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html | ||
|
||
exports[`cli > esbuild plugins 1`] = `Promise {}`; | ||
exports[`cli > esbuild plugins 1`] = ` | ||
"import { | ||
Body, | ||
Button, | ||
Container, | ||
Head, | ||
Hr, | ||
Html, | ||
Link, | ||
Preview, | ||
Section, | ||
Text | ||
} from 'jsx-email'; | ||
interface TemplateProps { | ||
email: string; | ||
name: string; | ||
} | ||
const main = { | ||
backgroundColor: '#f6f9fc', | ||
fontFamily: | ||
'-apple-system,BlinkMacSystemFont,\\"Segoe UI\\",Roboto,\\"Helvetica Neue\\",Ubuntu,sans-serif' | ||
}; | ||
const container = { | ||
backgroundColor: '#ffffff', | ||
margin: '0 auto', | ||
marginBottom: '64px', | ||
padding: '20px 0 48px' | ||
}; | ||
const box = { | ||
padding: '0 48px' | ||
}; | ||
const hr = { | ||
borderColor: '#e6ebf1', | ||
margin: '20px 0' | ||
}; | ||
const paragraph = { | ||
color: '#777', | ||
fontSize: '16px', | ||
lineHeight: '24px', | ||
textAlign: 'left' as const | ||
}; | ||
const anchor = { | ||
color: '#777' | ||
}; | ||
const button = { | ||
fontWeight: 'bold', | ||
padding: '10px', | ||
textDecoration: 'none' | ||
}; | ||
export const previewProps: TemplateProps = { | ||
email: 'batman@example.com', | ||
name: 'Bruce Wayne' | ||
}; | ||
export const templateName = 'BatmanEmail'; | ||
export const Template = ({ email, name }: TemplateProps) => ( | ||
<Html> | ||
<Head /> | ||
<Preview>This is our email preview text for {name} <{email}></Preview> | ||
<Body style={main}> | ||
<Container style={container}> | ||
<Section style={box}> | ||
<Text style={paragraph}>This is our email body text</Text> | ||
<Button | ||
align={'center'} | ||
backgroundColor={'#777'} | ||
borderRadius={5} | ||
fontSize={16} | ||
height={60} | ||
href=\\"https://example.com\\" | ||
style={button} | ||
textColor={'#fff'} | ||
width={160} | ||
> | ||
Action Button | ||
</Button> | ||
<Hr style={hr} /> | ||
<Text style={paragraph}> | ||
This is text content with a{' '} | ||
<Link style={anchor} href=\\"mailto:{email}\\"> | ||
link | ||
</Link> | ||
. | ||
</Text> | ||
</Section> | ||
</Container> | ||
</Body> | ||
</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