diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 07830ac..ba59612 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -40,6 +40,12 @@ jobs: - name: Run linter run: npm run lint + - name: SonarQube Scan + uses: SonarSource/sonarqube-scan-action@v4 + env: + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Build production bundle run: npm run build diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 0000000..12cf442 --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +20 diff --git a/README.md b/README.md index cb940ed..32b07fa 100644 --- a/README.md +++ b/README.md @@ -230,7 +230,14 @@ const nextConfig = { ### Prerequisites -- Node.js 18+ +- Node.js 20.9.0+ + - Recommend using [nvm](https://github.com/nvm-sh/nvm) (Node Version Manager): + ```bash + curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash + # Restart terminal or source ~/.bashrc + nvm install 20 + nvm use 20 + ``` - npm or yarn - Backend services running (see [Backend README](../backend/README.md)) diff --git a/app/cart/page.tsx b/app/cart/page.tsx index 92e8059..d9a8f0d 100644 --- a/app/cart/page.tsx +++ b/app/cart/page.tsx @@ -21,22 +21,22 @@ export default function CartPage() { if (isLoading) { return ( -
+
Add some awesome products to get started!
+
{item.product.brand}
-+
{`LKR ${item.product.price.toLocaleString('en-LK')}`}
+
Add products from product pages to compare their features
Browse Components @@ -55,41 +55,42 @@ export default function ComparePage() { ); return ( -+
Side-by-side comparison of {compareList.length} product{compareList.length > 1 ? 's' : ''}
-
+ |
+
Specification
|
@@ -98,7 +99,7 @@ export default function ComparePage() {
@@ -109,18 +110,18 @@ export default function ComparePage() {
height={200}
className="w-full h-40 object-cover rounded-lg mb-3"
/>
-
+ | ||
|---|---|---|---|
| + | |||
| Category | {compareList.map((product) => ( -+ | {product.subcategory || product.category} | ))}|
| + | |||
| Stock | {compareList.map((product) => ( @@ -155,7 +156,7 @@ export default function ComparePage() { In Stock ) : ( - +|||
| + | |||
| Rating | {compareList.map((product) => ( -+ |
{product.rating ? (
{product.rating.toFixed(1)}
@@ -177,7 +178,7 @@ export default function ComparePage() {
({product.reviewCount || 0} reviews)
) : (
- No ratings
+ No ratings
)}
|
))}
@@ -187,21 +188,19 @@ export default function ComparePage() {
{allSpecKeys.map((specKey: string, index: number) => (
|
| + | {specKey.charAt(0).toUpperCase() + specKey.slice(1)} | {compareList.map((product: Product) => ( -+ | {product.specs[specKey] !== undefined ? ( {product.specs[specKey]} ) : ( - - + - )} | ))} @@ -209,12 +208,12 @@ export default function ComparePage() { ))} {/* Description */} -
| + | |||
| Description | {compareList.map((product) => ( -+ | {product.description} | ))} @@ -230,12 +229,12 @@ export default function ComparePage() { animate={{ opacity: 1, y: 0 }} className="mt-8 text-center" > -