-
-
Notifications
You must be signed in to change notification settings - Fork 392
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
♻️ Remove use of context from email package #981
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
WalkthroughThe overarching modification across multiple components and files is the transition from using a context hook to directly passing the email context as a prop. This change streamlines the access to the Changes
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (10)
- apps/web/src/utils/emails.ts (1 hunks)
- packages/emails/src/send-email.tsx (2 hunks)
- packages/emails/src/templates/components/email-context.tsx (1 hunks)
- packages/emails/src/templates/components/email-layout.tsx (2 hunks)
- packages/emails/src/templates/components/notification-email.tsx (3 hunks)
- packages/emails/src/templates/components/styled-components.tsx (2 hunks)
- packages/emails/src/templates/finalized-host.tsx (3 hunks)
- packages/emails/src/templates/login.tsx (3 hunks)
- packages/emails/src/templates/new-participant-confirmation.tsx (1 hunks)
- packages/emails/src/templates/new-poll.tsx (3 hunks)
Additional comments: 31
packages/emails/src/templates/components/email-context.tsx (1)
- 4-4: The addition of the
domain
property to theEmailContext
type is consistent with the PR's objective to refactor how context is managed.apps/web/src/utils/emails.ts (1)
- 24-24: The inclusion of the
domain
property in theemailClient
's context object aligns with the changes made in theEmailContext
type and is a logical step in the refactoring process.packages/emails/src/templates/components/notification-email.tsx (4)
- 1-1: The import change from
useEmailContext
toEmailContext
is correct and aligns with the refactoring goal.- 10-10: The addition of the
ctx
prop to theNotificationEmailProps
interface is consistent with the new pattern of passing context as a prop.- 23-25: The replacement of the
useEmailContext
hook with thectx
prop within theNotificationEmail
component is in line with the PR's objectives.- 28-28: Passing the
ctx
prop to theEmailLayout
component is a necessary change following the removal of the context hook.packages/emails/src/templates/new-participant-confirmation.tsx (5)
- 1-1: The import statement change from
useEmailContext
toEmailContext
is correct.- 9-9: Adding the
ctx
prop to theNewParticipantConfirmationEmailProps
interface is consistent with the refactor.- 15-17: The use of the
ctx
prop within theNewParticipantConfirmationEmail
component is in line with the PR's objectives.- 20-20: Passing the
ctx
prop to theEmailLayout
component is appropriate following the removal of the context hook.- 24-25: The
Domain
component now correctly receives thectx
prop, aligning with the new pattern of passing context.packages/emails/src/templates/login.tsx (5)
- 1-1: The change from
useEmailContext
toEmailContext
in the import statement is correct.- 16-16: The addition of the
ctx
prop to theLoginEmailProps
interface is consistent with the refactor.- 23-23: The use of the
ctx
prop within theLoginEmail
component is in line with the PR's objectives.- 27-27: Passing the
ctx
prop to theEmailLayout
component is appropriate following the removal of the context hook.- 31-32: The
Domain
component now correctly receives thectx
prop, aligning with the new pattern of passing context.packages/emails/src/templates/finalized-host.tsx (4)
- 3-3: The import statement change from
useEmailContext
toEmailContext
is correct.- 17-17: Adding the
ctx
prop to theFinalizeHostEmailProps
interface is consistent with the refactor.- 28-28: The use of the
ctx
prop within theFinalizeHostEmail
component is in line with the PR's objectives.- 31-31: Passing the
ctx
prop to theEmailLayout
component is appropriate following the removal of the context hook.packages/emails/src/templates/components/email-layout.tsx (3)
- 11-11: The change from
useEmailContext
toEmailContext
in the import statement is correct.- 18-18: The addition of the
ctx
prop to theEmailLayoutProps
interface is consistent with the refactor.- 46-48: The use of the
ctx
prop within theEmailLayout
component is in line with the PR's objectives.packages/emails/src/templates/new-poll.tsx (4)
- 1-1: The change from
useEmailContext
toEmailContext
in the import statement is correct.- 10-10: The addition of the
ctx
prop to theNewPollEmailProps
interface is consistent with the refactor.- 41-43: The use of the
ctx
prop within theNewPollEmail
component is in line with the PR's objectives.- 46-46: Passing the
ctx
prop to theEmailLayout
component is appropriate following the removal of the context hook.packages/emails/src/templates/components/styled-components.tsx (2)
- 13-13: The change from
useEmailContext
toEmailContext
in the import statement is correct.- 35-36: The
Domain
component now correctly receives thectx
prop, aligning with the new pattern of passing context.packages/emails/src/send-email.tsx (2)
- 16-18: The modification of the
TemplateProps
type to exclude the "ctx" property is consistent with the refactor to pass context as a prop.- 83-87: The adjustment in the rendering of the
Template
component to include the "ctx" property is appropriate and aligns with the changes made throughout the PR.
ea6889f
to
868d40b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (14)
- apps/web/src/utils/emails.ts (1 hunks)
- packages/emails/src/send-email.tsx (2 hunks)
- packages/emails/src/templates/components/email-context.tsx (1 hunks)
- packages/emails/src/templates/components/email-layout.tsx (2 hunks)
- packages/emails/src/templates/components/notification-email.tsx (3 hunks)
- packages/emails/src/templates/components/styled-components.tsx (2 hunks)
- packages/emails/src/templates/finalized-host.tsx (3 hunks)
- packages/emails/src/templates/finalized-participant.tsx (3 hunks)
- packages/emails/src/templates/login.tsx (3 hunks)
- packages/emails/src/templates/new-comment.tsx (1 hunks)
- packages/emails/src/templates/new-participant-confirmation.tsx (1 hunks)
- packages/emails/src/templates/new-participant.tsx (1 hunks)
- packages/emails/src/templates/new-poll.tsx (3 hunks)
- packages/emails/src/templates/register.tsx (2 hunks)
Files skipped from review as they are similar to previous changes (9)
- apps/web/src/utils/emails.ts
- packages/emails/src/send-email.tsx
- packages/emails/src/templates/components/email-layout.tsx
- packages/emails/src/templates/components/notification-email.tsx
- packages/emails/src/templates/components/styled-components.tsx
- packages/emails/src/templates/finalized-host.tsx
- packages/emails/src/templates/login.tsx
- packages/emails/src/templates/new-participant-confirmation.tsx
- packages/emails/src/templates/new-poll.tsx
Additional comments: 11
packages/emails/src/templates/components/email-context.tsx (1)
- 4-4: The addition of the
domain
property to theEmailContext
type is consistent with the PR objectives to standardize URL handling within the email system.packages/emails/src/templates/new-comment.tsx (2)
- 16-16: The
ctx
prop has been correctly added to theNewCommentEmailProps
interface.- 20-20: The
ctx
prop is appropriately passed to theNotificationEmail
component, aligning with the PR's goal of prop-based context management.packages/emails/src/templates/new-participant.tsx (2)
- 16-16: The
ctx
prop has been correctly added to theNewParticipantEmailProps
interface.- 20-20: The
ctx
prop is appropriately passed to theNotificationEmail
component, aligning with the PR's goal of prop-based context management.packages/emails/src/templates/register.tsx (4)
- 1-1: The import of
EmailContext
is consistent with the changes made to theEmailContext
type.- 13-13: The
ctx
prop has been correctly added to theRegisterEmailProps
interface.- 23-23: The
ctx
prop is correctly passed to theEmailLayout
component.- 27-28: The
Domain
component is now receiving thectx
prop, and the footnote text correctly uses this prop.packages/emails/src/templates/finalized-participant.tsx (2)
- 18-18: The
ctx
prop has been correctly added to theFinalizeParticipantEmailProps
interface.- 33-33: The
ctx
prop is correctly passed to theEmailLayout
component, which is in line with the PR's objectives.
This is needed to allow us to use the next-auth API in server components.
Summary by CodeRabbit
New Features
Refactor
Bug Fixes