-
Notifications
You must be signed in to change notification settings - Fork 130
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "refactor(emails): Create base template for code emails"
This reverts commit 94820ab.
- Loading branch information
1 parent
d01ba6f
commit a0fce18
Showing
5 changed files
with
174 additions
and
65 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,7 +1,48 @@ | ||
import { BaseEmailCode, EmailCodeProps } from '../components/BaseEmailCode'; | ||
import { Container, Heading, Section, Text } from '@react-email/components'; | ||
|
||
export const EmailDeleteAccountCode = (props: EmailCodeProps) => { | ||
return <BaseEmailCode type="deleteAccountCode" {...props} />; | ||
import { Footer } from '@/emails/components/Footer'; | ||
import { Layout } from '@/emails/components/Layout'; | ||
import { styles } from '@/emails/styles'; | ||
import { VALIDATION_TOKEN_EXPIRATION_IN_MINUTES } from '@/features/auth/utils'; | ||
import i18n from '@/lib/i18n/server'; | ||
|
||
type EmailDeleteAccountCodeProps = { | ||
language: string; | ||
name: string; | ||
code: string; | ||
}; | ||
|
||
export const EmailDeleteAccountCode = ({ | ||
language, | ||
name, | ||
code, | ||
}: EmailDeleteAccountCodeProps) => { | ||
i18n.changeLanguage(language); | ||
return ( | ||
<Layout preview={i18n.t('emails:deleteAccountCode.preview')}> | ||
<Container style={styles.container}> | ||
<Heading style={styles.h1}> | ||
{i18n.t('emails:deleteAccountCode.title')} | ||
</Heading> | ||
<Section style={styles.section}> | ||
<Text style={styles.text}> | ||
{i18n.t('emails:deleteAccountCode.hello', { name: name ?? '' })} | ||
<br /> | ||
{i18n.t('emails:deleteAccountCode.intro')} | ||
</Text> | ||
<Text style={styles.code}>{code}</Text> | ||
<Text style={styles.textMuted}> | ||
{i18n.t('emails:deleteAccountCode.validityTime', { | ||
expiration: VALIDATION_TOKEN_EXPIRATION_IN_MINUTES, | ||
})} | ||
<br /> | ||
{i18n.t('emails:deleteAccountCode.ignoreHelper')} | ||
</Text> | ||
</Section> | ||
<Footer /> | ||
</Container> | ||
</Layout> | ||
); | ||
}; | ||
|
||
export default EmailDeleteAccountCode; |
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,7 +1,48 @@ | ||
import { BaseEmailCode, EmailCodeProps } from '../components/BaseEmailCode'; | ||
import { Container, Heading, Section, Text } from '@react-email/components'; | ||
|
||
export const EmailAddressChange = (props: EmailCodeProps) => { | ||
return <BaseEmailCode type="emailAddressChange" {...props} />; | ||
import { Footer } from '@/emails/components/Footer'; | ||
import { Layout } from '@/emails/components/Layout'; | ||
import { styles } from '@/emails/styles'; | ||
import { VALIDATION_TOKEN_EXPIRATION_IN_MINUTES } from '@/features/auth/utils'; | ||
import i18n from '@/lib/i18n/server'; | ||
|
||
type EmailAddressChangeProps = { | ||
language: string; | ||
name: string; | ||
code: string; | ||
}; | ||
|
||
export const EmailAddressChange = ({ | ||
language, | ||
name, | ||
code, | ||
}: EmailAddressChangeProps) => { | ||
i18n.changeLanguage(language); | ||
return ( | ||
<Layout preview={i18n.t('emails:emailAddressChange.preview')}> | ||
<Container style={styles.container}> | ||
<Heading style={styles.h1}> | ||
{i18n.t('emails:emailAddressChange.title')} | ||
</Heading> | ||
<Section style={styles.section}> | ||
<Text style={styles.text}> | ||
{i18n.t('emails:emailAddressChange.hello', { name: name ?? '' })} | ||
<br /> | ||
{i18n.t('emails:emailAddressChange.intro')} | ||
</Text> | ||
<Text style={styles.code}>{code}</Text> | ||
<Text style={styles.textMuted}> | ||
{i18n.t('emails:emailAddressChange.validityTime', { | ||
expiration: VALIDATION_TOKEN_EXPIRATION_IN_MINUTES, | ||
})} | ||
<br /> | ||
{i18n.t('emails:emailAddressChange.ignoreHelper')} | ||
</Text> | ||
</Section> | ||
<Footer /> | ||
</Container> | ||
</Layout> | ||
); | ||
}; | ||
|
||
export default EmailAddressChange; |
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,7 +1,46 @@ | ||
import { BaseEmailCode, EmailCodeProps } from '../components/BaseEmailCode'; | ||
import { Container, Heading, Section, Text } from '@react-email/components'; | ||
|
||
export const EmailLoginCode = (props: EmailCodeProps) => { | ||
return <BaseEmailCode type="loginCode" {...props} />; | ||
import { Footer } from '@/emails/components/Footer'; | ||
import { Layout } from '@/emails/components/Layout'; | ||
import { styles } from '@/emails/styles'; | ||
import { VALIDATION_TOKEN_EXPIRATION_IN_MINUTES } from '@/features/auth/utils'; | ||
import i18n from '@/lib/i18n/server'; | ||
|
||
type EmailLoginCodeProps = { | ||
language: string; | ||
name: string; | ||
code: string; | ||
}; | ||
|
||
export const EmailLoginCode = ({ | ||
language, | ||
name, | ||
code, | ||
}: EmailLoginCodeProps) => { | ||
i18n.changeLanguage(language); | ||
return ( | ||
<Layout preview={i18n.t('emails:loginCode.preview')}> | ||
<Container style={styles.container}> | ||
<Heading style={styles.h1}>{i18n.t('emails:loginCode.title')}</Heading> | ||
<Section style={styles.section}> | ||
<Text style={styles.text}> | ||
{i18n.t('emails:loginCode.hello', { name: name ?? '' })} | ||
<br /> | ||
{i18n.t('emails:loginCode.intro')} | ||
</Text> | ||
<Text style={styles.code}>{code}</Text> | ||
<Text style={styles.textMuted}> | ||
{i18n.t('emails:loginCode.validityTime', { | ||
expiration: VALIDATION_TOKEN_EXPIRATION_IN_MINUTES, | ||
})} | ||
<br /> | ||
{i18n.t('emails:loginCode.ignoreHelper')} | ||
</Text> | ||
</Section> | ||
<Footer /> | ||
</Container> | ||
</Layout> | ||
); | ||
}; | ||
|
||
export default EmailLoginCode; |
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,7 +1,48 @@ | ||
import { BaseEmailCode, EmailCodeProps } from '../components/BaseEmailCode'; | ||
import { Container, Heading, Section, Text } from '@react-email/components'; | ||
|
||
const EmailRegisterCode = (props: EmailCodeProps) => { | ||
return <BaseEmailCode type="registerCode" {...props} />; | ||
import { Footer } from '@/emails/components/Footer'; | ||
import { Layout } from '@/emails/components/Layout'; | ||
import { styles } from '@/emails/styles'; | ||
import { VALIDATION_TOKEN_EXPIRATION_IN_MINUTES } from '@/features/auth/utils'; | ||
import i18n from '@/lib/i18n/server'; | ||
|
||
type EmailRegisterCodeProps = { | ||
language: string; | ||
name?: string; | ||
code: string; | ||
}; | ||
|
||
export const EmailRegisterCode = ({ | ||
language, | ||
name, | ||
code, | ||
}: EmailRegisterCodeProps) => { | ||
i18n.changeLanguage(language); | ||
return ( | ||
<Layout preview={i18n.t('emails:registerCode.preview')}> | ||
<Container style={styles.container}> | ||
<Heading style={styles.h1}> | ||
{i18n.t('emails:registerCode.title')} | ||
</Heading> | ||
<Section style={styles.section}> | ||
<Text style={styles.text}> | ||
{i18n.t('emails:registerCode.hello', { name: name ?? '' })} | ||
<br /> | ||
{i18n.t('emails:registerCode.intro')} | ||
</Text> | ||
<Text style={styles.code}>{code}</Text> | ||
<Text style={styles.textMuted}> | ||
{i18n.t('emails:registerCode.validityTime', { | ||
expiration: VALIDATION_TOKEN_EXPIRATION_IN_MINUTES, | ||
})} | ||
<br /> | ||
{i18n.t('emails:registerCode.ignoreHelper')} | ||
</Text> | ||
</Section> | ||
<Footer /> | ||
</Container> | ||
</Layout> | ||
); | ||
}; | ||
|
||
export default EmailRegisterCode; |