perf: avoid layout re-rendering

This commit is contained in:
Riccardo
2024-01-25 18:12:37 +01:00
parent 551bff815f
commit dbefdc49e2
15 changed files with 137 additions and 135 deletions

View File

@@ -1,4 +1,4 @@
import { Link } from '../custom/link';
import { CustomLink } from '../custom/customLink';
import { Note } from './components/note';
import Template from './template';
@@ -22,7 +22,7 @@ export default function ConfirmationTemplate(code: string) {
justifyContent: 'center'
}}
>
<Link
<CustomLink
path={`${process.env.HOME_URL}/confirmation?code=${code}`}
text='Confirm subscription'
/>

View File

@@ -1,13 +0,0 @@
export const sayings = [
'hot off the press',
'straight from the oven',
"straight from the horse's mouth",
'brand spanking new',
'fresh as a daisy',
'straight out of the box',
'straight off the assembly line',
'hot out of the kitchen',
'just minted',
'freshly brewed',
'just off the production line'
];

View File

@@ -0,0 +1,13 @@
export const sayings = [
'hot off the press',
'straight from the oven',
"straight from the horse's mouth",
'brand spanking new',
'fresh as a daisy',
'straight out of the box',
'straight off the assembly line',
'hot out of the kitchen',
'just minted',
'freshly brewed',
'just off the production line'
];

View File

@@ -1,12 +1,11 @@
import { z } from 'zod';
import { NewsSchema } from '../../utils/schemas';
import { sayings } from './helpers/newsletterSayings';
import { sayings } from './helpers/sayings';
import Template from './template';
export default function NewsletterTemplate(
stories: z.infer<typeof NewsSchema>[]
) {
return {
subject: `What's new from the Hackernews forum?`,
template: (

View File

@@ -1,4 +1,4 @@
import { Link } from '../custom/link';
import { CustomLink } from '../custom/customLink';
import { Note } from './components/note';
import Template from './template';
@@ -22,7 +22,7 @@ export default function UnsubscribeTemplate() {
justifyContent: 'center'
}}
>
<Link path='/' text='Re-subscribe' />
<CustomLink path='/' text='Re-subscribe' />
</div>
<Note>
If you have any questions or concerns, please feel free to{' '}