Conversation
|
Someone is attempting to deploy a commit to the Vivek Prajapati's projects Team on Vercel. A member of the Team first needs to authorize it. |
WalkthroughFixed a README typo, added a GitHub link to the footer, made product rating rendering robust and clamped, and added a required terms-acceptance checkbox to the signup form (HTML5 validation). No public/exported API changes. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor User
participant Form as SignupForm(UI)
participant Browser as BrowserValidation
participant App as SubmissionHandler
User->>Form: Fill inputs + (un)check termsAccepted
User->>Form: Click "Sign Up"
Form->>Browser: Trigger HTML5 validation (required fields incl. termsAccepted)
alt validation fails (e.g., termsAccepted unchecked)
Browser-->>User: Prevent submit, show validation message
else validation passes
Browser-->>Form: Validation OK
Form->>App: Proceed with existing submit flow
App-->>User: Handle response (success/error)
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
✨ Finishing Touches
🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (2)
README.md (1)
94-94: Typo fix looks good; tiny phrasing polish (optional).Current sentence is correct. For a crisper tone, consider “subject to” instead of “pertaining to … stated below.”
Apply if you agree:
-We accept contributions to our project pertaining to the [Code of Conduct](https://github.com/codervivek5/VigyBag?tab=coc-ov-file) and [Contributing Guidelines](https://github.com/codervivek5/VigyBag/blob/main/CONTRIBUTING.md) stated below. +We accept contributions to our project, subject to our [Code of Conduct](https://github.com/codervivek5/VigyBag?tab=coc-ov-file) and [Contributing Guidelines](https://github.com/codervivek5/VigyBag/blob/main/CONTRIBUTING.md) outlined below.src/User/components/Popular_Categories/ProductGrid.jsx (1)
107-114: Optionally clamp rating to [0,5] before rendering.Prevents unexpected arrays if rate is out-of-range.
Minimal change:
- {[...Array(Math.round(product.rating.rate))].map((_, i) => ( + {[ + ...Array( + Math.max(0, Math.min(5, Math.round(product.rating.rate))) + ), + ].map((_, i) => ( <span key={i} className="text-yellow-400"> ⭐ </span> ))} - <span className="text-gray-500 ml-1">({Math.round(product.rating.rate)})</span> + <span className="text-gray-500 ml-1">({Math.max(0, Math.min(5, Math.round(product.rating.rate)))})</span>
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (4)
README.md(1 hunks)src/User/components/Footer/Footer.jsx(2 hunks)src/User/components/Popular_Categories/ProductGrid.jsx(1 hunks)src/User/pages/UserAuth/UserAuth.jsx(1 hunks)
🧰 Additional context used
🧬 Code graph analysis (3)
src/User/components/Popular_Categories/ProductGrid.jsx (3)
src/User/components/ProductCard/ProductCard.jsx (2)
_(18-20)div(4-45)src/User/pages/Latest_in_the_Market/OrganicTea.jsx (1)
product(31-42)src/User/utils/productFilters.js (2)
normalizeAndFilterByRating(1-9)product(5-8)
src/User/pages/UserAuth/UserAuth.jsx (1)
src/Admin/Pages/VigyForm.jsx (1)
activeTab(9-409)
src/User/components/Footer/Footer.jsx (2)
src/User/components/About/ContributorCard.jsx (2)
link(17-27)div(3-32)src/User/pages/Contributors/Contributors.jsx (1)
link(386-403)
🔇 Additional comments (4)
src/User/pages/UserAuth/UserAuth.jsx (1)
461-486: Split policy links from checkbox label and add rel attributes
File: src/User/pages/UserAuth/UserAuth.jsx:461-486- <div className="flex items-start space-x-2"> - <input - type="checkbox" - id="termsAccepted" - required - className="mt-1 h-4 w-4 rounded border-gray-300 text-emerald-600 focus:ring-emerald-500" - /> - <label htmlFor="termsAccepted" className="text-xs text-gray-300"> - I agree to the{" "} - <Link - to="/terms-and-condition" - className="text-[#4caf50] hover:underline" - target="_blank" - > - Terms and Conditions - </Link>{" "} - and{" "} - <Link - to="/privacy-policy" - className="text-[#4caf50] hover:underline" - target="_blank" - > - Privacy Policy - </Link> - </label> - </div> + <div className="flex items-start space-x-2"> + <input + type="checkbox" + id="termsAccepted" + required + className="mt-1 h-4 w-4 rounded border-gray-300 text-emerald-600 focus:ring-emerald-500" + /> + <div className="text-xs text-gray-300"> + <label htmlFor="termsAccepted">I agree to the</label>{" "} + <Link + to="/terms-and-condition" + className="text-[#4caf50] hover:underline" + target="_blank" + rel="noopener noreferrer" + > + Terms and Conditions + </Link>{" "} + and{" "} + <Link + to="/privacy-policy" + className="text-[#4caf50] hover:underline" + target="_blank" + rel="noopener noreferrer" + > + Privacy Policy + </Link> + </div> + </div>I couldn’t find any route definitions for
/terms-and-conditionor/privacy-policy—please verify those paths exist to avoid 404s.src/User/components/Footer/Footer.jsx (2)
9-9: Import for GitHub icon is correct.
156-156: GitHub social link added correctly (secure, accessible).Has target="_blank" with rel="noopener noreferrer" and an aria-label. LGTM.
src/User/components/Popular_Categories/ProductGrid.jsx (1)
113-114: Numeric rating now matches star count.Switching to Math.round(product.rating.rate) keeps UI consistent.
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (2)
src/User/components/Popular_Categories/ProductGrid.jsx (2)
108-114: Optional: use FaStar for consistency and add an accessible label.Other components use react-icons; aligning here improves UI consistency and accessibility.
- ⭐ + <FaStar aria-hidden="true" /> </span> ))} + <span className="sr-only"> + {Math.max(0, Math.min(5, Math.round(Number(product.rating?.rate ?? 0)) || 0))} out of 5 stars + </span>Add import (outside the shown hunk):
import { FaHeart, FaRegHeart, FaStar } from "react-icons/fa";
8-8: Remove unused import.
PaymentPageisn’t used and can be dropped to avoid lint warnings.-import PaymentPage from "../../pages/Payment/Payment";
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
src/User/components/Popular_Categories/ProductGrid.jsx(1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
src/User/components/Popular_Categories/ProductGrid.jsx (3)
src/User/components/Products/ProductDetails.jsx (5)
product(256-256)totalReviews(178-198)acc(182-188)rating(210-212)calculatePercentages(177-215)src/User/utils/productFilters.js (2)
normalizeAndFilterByRating(1-9)product(5-8)src/User/components/ProductCard/ProductCard.jsx (1)
_(18-20)
There was a problem hiding this comment.
Actionable comments posted: 0
♻️ Duplicate comments (1)
src/User/components/Popular_Categories/ProductGrid.jsx (1)
108-120: Rating clamped/coerced and synced with stars + text — LGTMCoerces to Number, rounds, clamps to [0,5], and reuses one value for stars and text. This resolves the prior bot comment.
🧹 Nitpick comments (3)
src/User/components/Popular_Categories/ProductGrid.jsx (3)
109-109: Nit: prefer nullish coalescing over truthiness fallbackAvoids accidental truthy/falsey semantics and reads clearer.
- const rating = Math.max(0, Math.min(5, Math.round(Number(product.rating?.rate) || 0))); + const rating = Math.max(0, Math.min(5, Math.round(Number(product.rating?.rate ?? 0))));
112-118: Optional a11y: mark stars as decorative and add a screen-reader labelImproves SR output without visual changes.
- {Array.from({ length: rating }).map((_, i) => ( - <span key={i} className="text-yellow-400"> + <span className="sr-only">{`Rating: ${rating} out of 5`}</span> + {Array.from({ length: rating }).map((_, i) => ( + <span key={i} className="text-yellow-400" aria-hidden="true"> ⭐ </span> ))} - <span className="text-gray-500 ml-1">({rating})</span> + <span className="text-gray-500 ml-1" aria-hidden="true">({rating})</span>
108-120: Extract shared rating normalization helper
Filter callbacks insrc/User/pages/Popular_Categories/*.jsxandsrc/User/pages/Latest_in_the_Market/*.jsxuseMath.round(product.rating.rate)without clamping, whereasProductGrid.jsxclamps to [0, 5] before rendering. Extract a helper—e.g.function getNormalizedRating(rate) { const n = Math.round(Number(rate) || 0); return Math.max(0, Math.min(5, n)); }Then import and use it in both
ProductGrid.jsxand all filter functions (e.g. inBeauty-Wellness.jsx,Health-Supplements.jsx, etc.) to keep filtering and display consistent.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
src/User/components/Popular_Categories/ProductGrid.jsx(1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
src/User/components/Popular_Categories/ProductGrid.jsx (5)
src/User/components/Products/ProductDetails.jsx (5)
product(256-256)rating(210-212)totalReviews(178-198)acc(182-188)calculatePercentages(177-215)src/User/utils/productFilters.js (2)
normalizeAndFilterByRating(1-9)product(5-8)src/User/components/ProductCard/ProductCard.jsx (1)
_(18-20)src/User/components/Popular_Categories/Filters.jsx (1)
e(46-49)src/User/pages/Latest_in_the_Market/ArtSupplies.jsx (1)
product(32-43)
Bug Fixes: UI/UX Issues Resolution
Summary
Resolves three specific UI/UX issues to improve user experience and functionality.
Changes Made
Files Modified
src/User/components/Footer/Footer.jsx- GitHub link additionsrc/User/pages/UserAuth/UserAuth.jsx- Terms checkbox implementationsrc/User/components/Popular_Categories/ProductGrid.jsx- Rating display fixTesting
Type: Bug Fix
No breaking changes. Maintains existing functionality while fixing identified issues.
Summary by CodeRabbit
New Features
Bug Fixes
Documentation