Lint fix email package

This commit is contained in:
MartinBraquet
2026-02-23 22:19:34 +01:00
parent f0c645b16d
commit aa785c1539
7 changed files with 63 additions and 27 deletions

View File

@@ -1,6 +1,6 @@
import {sleep} from 'common/util/time'
import {type CreateEmailOptions, CreateEmailRequestOptions, Resend} from 'resend'
import {log} from 'shared/utils'
import {sleep} from 'common/util/time'
/*
* typically: { subject: string, to: string | string[] } & ({ text: string } | { react: ReactNode })

View File

@@ -1,4 +1,3 @@
import React from 'react'
import {
Body,
Button,
@@ -11,12 +10,14 @@ import {
Section,
Text,
} from '@react-email/components'
import {type User} from 'common/user'
import {DOMAIN} from 'common/envs/constants'
import {jamesUser, mockUser} from './functions/mock'
import {type User} from 'common/user'
import {button, container, content, Footer, main, paragraph} from 'email/utils'
import React from 'react'
import {createT} from 'shared/locale'
import {jamesUser, mockUser} from './functions/mock'
interface NewEndorsementEmailProps {
fromUser: User
onUser: User
@@ -42,7 +43,11 @@ export const NewEndorsementEmail = ({
return (
<Html>
<Head />
<Preview>{t('email.new_endorsement.preview', 'New endorsement from {fromUserName}', {fromUserName: fromUser.name})}</Preview>
<Preview>
{t('email.new_endorsement.preview', 'New endorsement from {fromUserName}', {
fromUserName: fromUser.name,
})}
</Preview>
<Body style={main}>
<Container style={container}>
{/*<Section style={logoContainer}>*/}
@@ -55,9 +60,15 @@ export const NewEndorsementEmail = ({
{/*</Section>*/}
<Section style={content}>
<Text style={paragraph}>{t('email.new_endorsement.greeting', 'Hi {name},', {name})}</Text>
<Text style={paragraph}>
{t('email.new_endorsement.greeting', 'Hi {name},', {name})}
</Text>
<Text style={paragraph}>{t('email.new_endorsement.message', '{fromUserName} endorsed you!', {fromUserName: fromUser.name})}</Text>
<Text style={paragraph}>
{t('email.new_endorsement.message', '{fromUserName} endorsed you!', {
fromUserName: fromUser.name,
})}
</Text>
<Section style={endorsementContainer}>
<Row>

View File

@@ -1,10 +1,11 @@
import React from 'react'
import {Body, Button, Container, Head, Html, Preview, Section, Text} from '@react-email/components'
import {DOMAIN} from 'common/envs/constants'
import {type ProfileRow} from 'common/profiles/profile'
import {type User} from 'common/user'
import {jamesProfile, jamesUser, mockUser} from './functions/mock'
import {Footer} from 'email/utils'
import React from 'react'
import {jamesProfile, jamesUser, mockUser} from './functions/mock'
interface NewMatchEmailProps {
onUser: User

View File

@@ -1,12 +1,13 @@
import React from 'react'
import {Body, Button, Container, Head, Html, Preview, Section, Text} from '@react-email/components'
import {type User} from 'common/user'
import {type ProfileRow} from 'common/profiles/profile'
import {jamesProfile, jamesUser, mockUser} from './functions/mock'
import {DOMAIN} from 'common/envs/constants'
import {type ProfileRow} from 'common/profiles/profile'
import {type User} from 'common/user'
import {button, container, content, Footer, imageContainer, main, paragraph} from 'email/utils'
import React from 'react'
import {createT} from 'shared/locale'
import {jamesProfile, jamesUser, mockUser} from './functions/mock'
interface NewMessageEmailProps {
fromUser: User
fromUserProfile: ProfileRow

View File

@@ -1,14 +1,15 @@
import React from 'react'
import {Body, Container, Head, Html, Link, Preview, Section, Text} from '@react-email/components'
import {type User} from 'common/user'
import {mockUser} from './functions/mock'
import {DOMAIN} from 'common/envs/constants'
import {container, content, Footer, main, paragraph} from 'email/utils'
import {FilterFields} from 'common/filters'
import {MatchesType} from 'common/profiles/bookmarked_searches'
import {formatFilters, locationType} from 'common/searches'
import {FilterFields} from 'common/filters'
import {type User} from 'common/user'
import {container, content, Footer, main, paragraph} from 'email/utils'
import React from 'react'
import {createT} from 'shared/locale'
import {mockUser} from './functions/mock'
interface NewMessageEmailProps {
toUser: User
matches: MatchesType[]

View File

@@ -1,6 +1,6 @@
import React from 'react'
import {Column, Img, Link, Row, Section, Text} from '@react-email/components'
import {DOMAIN} from 'common/envs/constants'
import React from 'react'
import {createT} from 'shared/locale'
interface Props {
@@ -61,7 +61,11 @@ export const Footer = ({email, unsubscribeUrl, locale}: Props) => {
</Text>
<Text style={{fontSize: '10px', color: '#888', marginTop: '12px'}}>
{t('email.footer.sent_to', 'The email was sent to {email}. To no longer receive these emails, unsubscribe', {email})}{' '}
{t(
'email.footer.sent_to',
'The email was sent to {email}. To no longer receive these emails, unsubscribe',
{email},
)}{' '}
<Link href={unsubscribeUrl}>{t('email.footer.unsubscribe_link', 'here')}</Link>.
</Text>
</Row>

View File

@@ -1,10 +1,11 @@
import React from 'react'
import {Body, Button, Container, Head, Html, Preview, Section, Text} from '@react-email/components'
import {type User} from 'common/user'
import {mockUser} from './functions/mock'
import {button, container, content, Footer, main, paragraph} from 'email/utils'
import React from 'react'
import {createT} from 'shared/locale'
import {mockUser} from './functions/mock'
interface WelcomeEmailProps {
toUser: User
unsubscribeUrl: string
@@ -26,15 +27,29 @@ export const WelcomeEmail = ({
return (
<Html>
<Head />
<Preview>{t('email.welcome.preview', 'Welcome to Compass — Please confirm your email')}</Preview>
<Preview>
{t('email.welcome.preview', 'Welcome to Compass — Please confirm your email')}
</Preview>
<Body style={main}>
<Container style={container}>
<Section style={content}>
<Text style={paragraph}>{t('email.welcome.title', 'Welcome to Compass, {name}!', {name})}</Text>
<Text style={paragraph}>
{t('email.welcome.title', 'Welcome to Compass, {name}!', {name})}
</Text>
<Text style={paragraph}>{t('email.welcome.intro', 'Compass is a free, community-owned platform built to help people form deep, meaningful connections — platonic, romantic, or collaborative. There are no ads, no hidden algorithms, and no subscriptions — just a transparent, open-source space shaped by people like you.')}</Text>
<Text style={paragraph}>
{t(
'email.welcome.intro',
'Compass is a free, community-owned platform built to help people form deep, meaningful connections — platonic, romantic, or collaborative. There are no ads, no hidden algorithms, and no subscriptions — just a transparent, open-source space shaped by people like you.',
)}
</Text>
<Text style={paragraph}>{t('email.welcome.confirmation', 'To finish creating your account and start exploring Compass, please confirm your email below:')}</Text>
<Text style={paragraph}>
{t(
'email.welcome.confirmation',
'To finish creating your account and start exploring Compass, please confirm your email below:',
)}
</Text>
<Button style={button} href={verificationLink}>
{t('email.welcome.confirmButton', 'Confirm My Email')}
@@ -46,7 +61,10 @@ export const WelcomeEmail = ({
</Text>
<Text style={{marginTop: '40px', fontSize: '12px', color: '#555'}}>
{t('email.welcome.thanks', 'Your presence and participation are what make Compass possible. Thank you for helping us build an internet space that prioritizes depth, trust, and community over monetization.')}
{t(
'email.welcome.thanks',
'Your presence and participation are what make Compass possible. Thank you for helping us build an internet space that prioritizes depth, trust, and community over monetization.',
)}
</Text>
</Section>