Update screenshot (#45)

* update screenshot

* add key to suppress react warning
This commit is contained in:
Berry de Vos 2023-01-24 08:52:30 +01:00 committed by GitHub
parent 23b68080e8
commit 3defdc5a37
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 3 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 238 KiB

After

Width:  |  Height:  |  Size: 240 KiB

View file

@ -1,3 +1,4 @@
import { Fragment } from 'react'
import { parse } from 'node-html-parser'
import { Text } from '@react-email/text'
import { Link } from '@react-email/link'
@ -20,11 +21,15 @@ export default ({ content, href }: Props) => {
{elements.map((element) => {
switch (element.localName) {
case 'p':
return <Text style={text}>{element.text}</Text>
return (
<Text key="p" style={text}>
{element.text}
</Text>
)
case 'blockquote':
const paragraphs = element.querySelectorAll('> p')
return (
<>
<Fragment key="blockquote">
<Text style={blockquote}>{paragraphs[0].text ?? ''}</Text>
{blockquoteHasMore && (
<Text style={blockquote}>
@ -33,7 +38,7 @@ export default ({ content, href }: Props) => {
</Link>
</Text>
)}
</>
</Fragment>
)
}
})}