Skip to content

Commit c38203b

Browse files
committed
fix(emails): move emails folder into components, fix styling
1 parent a847295 commit c38203b

File tree

9 files changed

+93
-63
lines changed

9 files changed

+93
-63
lines changed

sim/app/(auth)/components/emails/email-icons.tsx

Lines changed: 0 additions & 21 deletions
This file was deleted.
File renamed without changes.

sim/app/(auth)/components/emails/otp-verification-email.tsx renamed to sim/components/emails/otp-verification-email.tsx

Lines changed: 45 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ import {
1212
Section,
1313
Text,
1414
} from '@react-email/components'
15-
import { XIcon } from 'lucide-react'
16-
import { DiscordIcon } from '@/components/icons'
1715
import { baseStyles } from './base-styles'
1816

1917
interface OTPVerificationEmailProps {
@@ -48,15 +46,19 @@ export const OTPVerificationEmail = ({
4846
<Body style={baseStyles.main}>
4947
<Preview>{getSubjectByType(type)}</Preview>
5048
<Container style={baseStyles.container}>
51-
<Section style={{ ...baseStyles.header, textAlign: 'center' }}>
49+
<Section
50+
style={{
51+
...baseStyles.header,
52+
textAlign: 'center',
53+
padding: '30px',
54+
}}
55+
>
5256
<Img
5357
src={`${baseUrl}/sim.png`}
54-
width="120"
55-
height="40"
58+
width="114"
5659
alt="Sim Studio"
5760
style={{
58-
display: 'block',
59-
objectFit: 'contain',
61+
display: 'inline-block',
6062
margin: '0 auto',
6163
}}
6264
/>
@@ -94,23 +96,46 @@ export const OTPVerificationEmail = ({
9496
</Container>
9597

9698
<Section style={baseStyles.footer}>
97-
<Row style={{ marginBottom: '10px' }}>
98-
<Column align="center">
99-
<Link
100-
href="https://x.com/simstudioai"
101-
style={{ textDecoration: 'none', margin: '0 8px' }}
102-
>
103-
<XIcon />
99+
<Row>
100+
<Column align="right" style={{ width: '50%', paddingRight: '8px' }}>
101+
<Link href="https://x.com/simstudioai" style={{ textDecoration: 'none' }}>
102+
<Img
103+
src={`${baseUrl}/x-icon.png`}
104+
width="20"
105+
height="20"
106+
alt="X"
107+
style={{
108+
display: 'block',
109+
marginLeft: 'auto',
110+
filter: 'grayscale(100%)',
111+
opacity: 0.7,
112+
}}
113+
/>
104114
</Link>
105-
<Link
106-
href="https://discord.gg/crdsGfGk"
107-
style={{ textDecoration: 'none', margin: '0 8px' }}
108-
>
109-
<DiscordIcon />
115+
</Column>
116+
<Column align="left" style={{ width: '50%', paddingLeft: '8px' }}>
117+
<Link href="https://discord.gg/crdsGfGk" style={{ textDecoration: 'none' }}>
118+
<Img
119+
src={`${baseUrl}/discord-icon.png`}
120+
width="24"
121+
height="24"
122+
alt="Discord"
123+
style={{
124+
display: 'block',
125+
filter: 'grayscale(100%)',
126+
opacity: 0.9,
127+
}}
128+
/>
110129
</Link>
111130
</Column>
112131
</Row>
113-
<Text style={baseStyles.footerText}>
132+
<Text
133+
style={{
134+
...baseStyles.footerText,
135+
textAlign: 'center',
136+
color: '#706a7b',
137+
}}
138+
>
114139
© {new Date().getFullYear()} Sim Studio, All Rights Reserved
115140
<br />
116141
If you have any questions, please contact us at support@simstudio.ai
File renamed without changes.

sim/app/(auth)/components/emails/reset-password-email.tsx renamed to sim/components/emails/reset-password-email.tsx

Lines changed: 45 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import {
1313
Text,
1414
} from '@react-email/components'
1515
import { baseStyles } from './base-styles'
16-
import { DiscordIcon, XIcon } from './email-icons'
1716

1817
interface ResetPasswordEmailProps {
1918
username?: string
@@ -39,15 +38,19 @@ export const ResetPasswordEmail = ({
3938
<Body style={baseStyles.main}>
4039
<Preview>Reset your Sim Studio password</Preview>
4140
<Container style={baseStyles.container}>
42-
<Section style={{ ...baseStyles.header, textAlign: 'center' }}>
41+
<Section
42+
style={{
43+
...baseStyles.header,
44+
textAlign: 'center',
45+
padding: '30px',
46+
}}
47+
>
4348
<Img
4449
src={`${baseUrl}/sim.png`}
45-
width="120"
46-
height="40"
50+
width="114"
4751
alt="Sim Studio"
4852
style={{
49-
display: 'block',
50-
objectFit: 'contain',
53+
display: 'inline-block',
5154
margin: '0 auto',
5255
}}
5356
/>
@@ -86,23 +89,46 @@ export const ResetPasswordEmail = ({
8689
</Container>
8790

8891
<Section style={baseStyles.footer}>
89-
<Row style={{ marginBottom: '10px' }}>
90-
<Column align="center">
91-
<Link
92-
href="https://x.com/simstudioai"
93-
style={{ textDecoration: 'none', margin: '0 8px' }}
94-
>
95-
<XIcon />
92+
<Row>
93+
<Column align="right" style={{ width: '50%', paddingRight: '8px' }}>
94+
<Link href="https://x.com/simstudioai" style={{ textDecoration: 'none' }}>
95+
<Img
96+
src={`${baseUrl}/x-icon.png`}
97+
width="20"
98+
height="20"
99+
alt="X"
100+
style={{
101+
display: 'block',
102+
marginLeft: 'auto',
103+
filter: 'grayscale(100%)',
104+
opacity: 0.7,
105+
}}
106+
/>
96107
</Link>
97-
<Link
98-
href="https://discord.gg/crdsGfGk"
99-
style={{ textDecoration: 'none', margin: '0 8px' }}
100-
>
101-
<DiscordIcon />
108+
</Column>
109+
<Column align="left" style={{ width: '50%', paddingLeft: '8px' }}>
110+
<Link href="https://discord.gg/crdsGfGk" style={{ textDecoration: 'none' }}>
111+
<Img
112+
src={`${baseUrl}/discord-icon.png`}
113+
width="24"
114+
height="24"
115+
alt="Discord"
116+
style={{
117+
display: 'block',
118+
filter: 'grayscale(100%)',
119+
opacity: 0.9,
120+
}}
121+
/>
102122
</Link>
103123
</Column>
104124
</Row>
105-
<Text style={baseStyles.footerText}>
125+
<Text
126+
style={{
127+
...baseStyles.footerText,
128+
textAlign: 'center',
129+
color: '#706a7b',
130+
}}
131+
>
106132
© {new Date().getFullYear()} Sim Studio, All Rights Reserved
107133
<br />
108134
If you have any questions, please contact us at support@simstudio.ai

sim/lib/auth.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ import { drizzleAdapter } from 'better-auth/adapters/drizzle'
44
import { nextCookies } from 'better-auth/next-js'
55
import { emailOTP, genericOAuth } from 'better-auth/plugins'
66
import { Resend } from 'resend'
7-
import { createLogger } from '@/lib/logs/console-logger'
87
import {
98
getEmailSubject,
109
renderOTPEmail,
1110
renderPasswordResetEmail,
12-
} from '@/app/(auth)/components/emails/render-email'
11+
} from '@/components/emails/render-email'
12+
import { createLogger } from '@/lib/logs/console-logger'
1313
import { db } from '@/db'
1414
import * as schema from '@/db/schema'
1515

sim/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"test": "vitest run",
1818
"test:watch": "vitest",
1919
"test:coverage": "vitest run --coverage",
20-
"email:dev": "email dev --dir app/emails",
20+
"email:dev": "email dev --dir components/emails",
2121
"cli:build": "npm run build -w packages/simstudio",
2222
"cli:dev": "npm run build -w packages/simstudio && cd packages/simstudio && node ./dist/index.js",
2323
"cli:publish": "cd packages/simstudio && npm publish",

sim/public/discord-icon.png

17 KB
Loading

sim/public/x-icon.png

17.3 KB
Loading

0 commit comments

Comments
 (0)