fix: replace browser alerts with Sonner toasts#361
fix: replace browser alerts with Sonner toasts#361akashagrahari78 wants to merge 2 commits intoapsinghdev:mainfrom
Conversation
|
@akashagrahari78 is attempting to deploy a commit to the AJEET PRATAP SINGH's projects Team on Vercel. A member of the Team first needs to authorize it. |
📝 WalkthroughWalkthroughAdds the Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
apps/web/src/app/layout.tsx (1)
130-130: ConfigureToasterto match the app's dark theme.The app forces
defaultTheme="dark"inThemeProvider, but Sonner's<Toaster />defaults to the light theme, so toasts will render with a light background against the app's darkbg-backgroundand feel visually inconsistent with the design system. Additionally,<Toaster />is rendered outsideThemeProvider, so it can't pick up the active theme fromnext-themescontext automatically.Consider explicitly setting the theme (and optionally position/richColors) to match the app:
Proposed change
- <Toaster /> + <Toaster theme="dark" position="bottom-right" richColors />Or move
<Toaster />insideThemeProviderand usetheme="system"so it followsnext-themes.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@apps/web/src/app/layout.tsx` at line 130, The Toaster is rendered outside ThemeProvider and defaults to a light theme, causing visual mismatch; fix by either moving the <Toaster /> inside the existing ThemeProvider so it can use next-themes and set theme="system", or explicitly configure the Sonner <Toaster /> props to match the app (e.g., theme="dark", richColors={true} and optional position) so it renders with the app's dark styling; update the component that renders <Toaster /> accordingly (referencing <Toaster /> and ThemeProvider).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@apps/web/src/components/ui/FiltersContainer.tsx`:
- Around line 23-25: The toast message in handleClickWipFilters currently has a
trailing space and lost the original emoji; update the string passed to
toast.info in handleClickWipFilters to remove the trailing whitespace and
restore the original emoji (e.g., "🏗️ Coming very soon") so the WIP message
displays correctly.
---
Nitpick comments:
In `@apps/web/src/app/layout.tsx`:
- Line 130: The Toaster is rendered outside ThemeProvider and defaults to a
light theme, causing visual mismatch; fix by either moving the <Toaster />
inside the existing ThemeProvider so it can use next-themes and set
theme="system", or explicitly configure the Sonner <Toaster /> props to match
the app (e.g., theme="dark", richColors={true} and optional position) so it
renders with the app's dark styling; update the component that renders <Toaster
/> accordingly (referencing <Toaster /> and ThemeProvider).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: efab3e22-ebad-4682-bd5f-f55bfc05cce8
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (4)
apps/web/package.jsonapps/web/src/app/layout.tsxapps/web/src/components/payment/PaymentFlow.tsxapps/web/src/components/ui/FiltersContainer.tsx
|
Issue is resolved as by moving Toaster inside ThemeProvider and dark theme is added. |
Closes #360
Summary
<Toaster />to the root layout for global usageTesting
Screenshots
*Before

*After

Summary by CodeRabbit
New Features
Improvements