-
Notifications
You must be signed in to change notification settings - Fork 1
Clean up products section code review feedback #50
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
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,6 +1,5 @@ | ||||||
| "use client" | ||||||
|
|
||||||
| import { useState } from "react" | ||||||
| import Image from "next/image" | ||||||
| import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card" | ||||||
| import { Container } from "@/components/ui/container" | ||||||
|
|
@@ -85,7 +84,7 @@ Built with modern businesses in mind, StormERP integrates seamlessly with your e | |||||
| "Business Intelligence & Reporting", | ||||||
| "Multi-Location & Multi-Currency Support" | ||||||
| ], | ||||||
| productUrl: "https://erp.codestormhub.live", | ||||||
| productUrl: "https://codestormhub.live/erp/dashboard", | ||||||
| dashboardImage: "/products/stormerp-dashboard.png", | ||||||
| status: "active", | ||||||
| category: "ERP" | ||||||
|
|
@@ -97,8 +96,6 @@ interface ProductsSectionProps { | |||||
| } | ||||||
|
|
||||||
| export default function ProductsSection({ className }: ProductsSectionProps) { | ||||||
| const [selectedProduct, setSelectedProduct] = useState<Product | null>(null) | ||||||
|
|
||||||
| return ( | ||||||
| <section className={className} aria-labelledby="products-heading"> | ||||||
| <Container className="py-16 sm:py-24"> | ||||||
|
|
@@ -172,7 +169,6 @@ export default function ProductsSection({ className }: ProductsSectionProps) { | |||||
| variant="outline" | ||||||
| size="sm" | ||||||
| className="flex-1" | ||||||
| onClick={() => setSelectedProduct(product)} | ||||||
| > | ||||||
| View Details | ||||||
| </Button> | ||||||
|
|
@@ -193,7 +189,10 @@ export default function ProductsSection({ className }: ProductsSectionProps) { | |||||
| </Card> | ||||||
|
|
||||||
| {/* Product Detail Modal */} | ||||||
| <DialogContent className="max-w-5xl max-h-[90vh] overflow-y-auto"> | ||||||
| <DialogContent | ||||||
| className="max-w-5xl max-h-[90vh] overflow-y-auto" | ||||||
| aria-describedby="product-description" | ||||||
| > | ||||||
| <DialogHeader> | ||||||
| <div className="flex items-center gap-3"> | ||||||
| <div className="w-12 h-12 rounded-xl bg-primary/20 flex items-center justify-center"> | ||||||
|
|
@@ -222,7 +221,7 @@ export default function ProductsSection({ className }: ProductsSectionProps) { | |||||
| </div> | ||||||
|
|
||||||
| {/* Description */} | ||||||
| <div className="space-y-3"> | ||||||
| <div className="space-y-3" id="product-description"> | ||||||
|
||||||
| <div className="space-y-3" id="product-description"> | |
| <div className="space-y-3" id={`product-description-${product.id}`}> |
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.
The aria-describedby attribute references a hardcoded ID "product-description", but this ID is duplicated for each product in the map loop (line 224). HTML IDs must be unique within the document. Consider using a dynamic ID such as
product-description-${product.id}for both the aria-describedby attribute and the corresponding id on line 224.