Skip to content

Commit 2289b1e

Browse files
committed
Fix build
1 parent a192582 commit 2289b1e

File tree

16 files changed

+158
-124
lines changed

16 files changed

+158
-124
lines changed

.eslintrc.cjs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,11 @@ module.exports = {
8484
],
8585
"@next/next/no-img-element": "off",
8686
"@typescript-eslint/no-unsafe-return": "off",
87+
"@typescript-eslint/no-confusing-void-expression": "off",
8788
"@typescript-eslint/no-non-null-assertion": "off",
8889
"@typescript-eslint/no-unsafe-assignment": "off",
8990
"@typescript-eslint/explicit-function-return-type": "off",
91+
"@typescript-eslint/prefer-promise-reject-errors": "off",
9092
"@typescript-eslint/no-explicit-any": "off",
9193
"@typescript-eslint/no-unsafe-call": "off",
9294
"@typescript-eslint/no-unused-vars": [

package.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
{
2-
"name": "almacency",
2+
"name": "store",
33
"version": "0.1.0",
44
"private": true,
5-
"packageManager": "[email protected]",
6-
"engines": {
7-
"node": "18.x"
8-
},
95
"scripts": {
106
"dev": "next dev",
117
"build": "next build",

src/components/ui/input.tsx

Lines changed: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,23 @@
1-
import * as React from "react"
1+
import * as React from "react";
22

3-
import { cn } from "@/lib/utils"
3+
import {cn} from "@/lib/utils";
44

5-
export interface InputProps
6-
extends React.InputHTMLAttributes<HTMLInputElement> {}
5+
export type InputProps = React.InputHTMLAttributes<HTMLInputElement>;
76

8-
const Input = React.forwardRef<HTMLInputElement, InputProps>(
9-
({ className, type, ...props }, ref) => {
10-
return (
11-
<input
12-
type={type}
13-
className={cn(
14-
"flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
15-
className
16-
)}
17-
ref={ref}
18-
{...props}
19-
/>
20-
)
21-
}
22-
)
23-
Input.displayName = "Input"
7+
const Input = React.forwardRef<HTMLInputElement, InputProps>(({className, type, ...props}, ref) => {
8+
return (
9+
<input
10+
ref={ref}
11+
className={cn(
12+
"flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
13+
className,
14+
)}
15+
type={type}
16+
{...props}
17+
/>
18+
);
19+
});
2420

25-
export { Input }
21+
Input.displayName = "Input";
22+
23+
export {Input};

src/components/ui/label.tsx

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,22 @@
1-
"use client"
1+
"use client";
22

3-
import * as React from "react"
4-
import * as LabelPrimitive from "@radix-ui/react-label"
5-
import { cva, type VariantProps } from "class-variance-authority"
3+
import * as React from "react";
4+
import * as LabelPrimitive from "@radix-ui/react-label";
5+
import {cva, type VariantProps} from "class-variance-authority";
66

7-
import { cn } from "@/lib/utils"
7+
import {cn} from "@/lib/utils";
88

99
const labelVariants = cva(
10-
"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
11-
)
10+
"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
11+
);
1212

1313
const Label = React.forwardRef<
1414
React.ElementRef<typeof LabelPrimitive.Root>,
15-
React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> &
16-
VariantProps<typeof labelVariants>
17-
>(({ className, ...props }, ref) => (
18-
<LabelPrimitive.Root
19-
ref={ref}
20-
className={cn(labelVariants(), className)}
21-
{...props}
22-
/>
23-
))
24-
Label.displayName = LabelPrimitive.Root.displayName
15+
React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> & VariantProps<typeof labelVariants>
16+
>(({className, ...props}, ref) => (
17+
<LabelPrimitive.Root ref={ref} className={cn(labelVariants(), className)} {...props} />
18+
));
2519

26-
export { Label }
20+
Label.displayName = LabelPrimitive.Root.displayName;
21+
22+
export {Label};

src/components/ui/radio-group.tsx

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,40 @@
1-
"use client"
1+
"use client";
22

3-
import * as React from "react"
4-
import * as RadioGroupPrimitive from "@radix-ui/react-radio-group"
5-
import { Circle } from "lucide-react"
3+
import * as React from "react";
4+
import * as RadioGroupPrimitive from "@radix-ui/react-radio-group";
5+
import {Circle} from "lucide-react";
66

7-
import { cn } from "@/lib/utils"
7+
import {cn} from "@/lib/utils";
88

99
const RadioGroup = React.forwardRef<
1010
React.ElementRef<typeof RadioGroupPrimitive.Root>,
1111
React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root>
12-
>(({ className, ...props }, ref) => {
13-
return (
14-
<RadioGroupPrimitive.Root
15-
className={cn("grid gap-2", className)}
16-
{...props}
17-
ref={ref}
18-
/>
19-
)
20-
})
21-
RadioGroup.displayName = RadioGroupPrimitive.Root.displayName
12+
>(({className, ...props}, ref) => {
13+
return <RadioGroupPrimitive.Root className={cn("grid gap-2", className)} {...props} ref={ref} />;
14+
});
15+
16+
RadioGroup.displayName = RadioGroupPrimitive.Root.displayName;
2217

2318
const RadioGroupItem = React.forwardRef<
2419
React.ElementRef<typeof RadioGroupPrimitive.Item>,
2520
React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item>
26-
>(({ className, ...props }, ref) => {
21+
>(({className, ...props}, ref) => {
2722
return (
2823
<RadioGroupPrimitive.Item
2924
ref={ref}
3025
className={cn(
3126
"aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
32-
className
27+
className,
3328
)}
3429
{...props}
3530
>
3631
<RadioGroupPrimitive.Indicator className="flex items-center justify-center">
3732
<Circle className="h-2.5 w-2.5 fill-current text-current" />
3833
</RadioGroupPrimitive.Indicator>
3934
</RadioGroupPrimitive.Item>
40-
)
41-
})
42-
RadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName
35+
);
36+
});
37+
38+
RadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName;
4339

44-
export { RadioGroup, RadioGroupItem }
40+
export {RadioGroup, RadioGroupItem};

src/components/ui/skeleton.tsx

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,7 @@
1-
import { cn } from "@/lib/utils"
1+
import {cn} from "@/lib/utils";
22

3-
function Skeleton({
4-
className,
5-
...props
6-
}: React.HTMLAttributes<HTMLDivElement>) {
7-
return (
8-
<div
9-
className={cn("animate-pulse rounded-md bg-muted", className)}
10-
{...props}
11-
/>
12-
)
3+
function Skeleton({className, ...props}: React.HTMLAttributes<HTMLDivElement>) {
4+
return <div className={cn("animate-pulse rounded-md bg-muted", className)} {...props} />;
135
}
146

15-
export { Skeleton }
7+
export {Skeleton};

src/components/ui/toggle.tsx

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
1-
"use client"
1+
"use client";
22

3-
import * as React from "react"
4-
import * as TogglePrimitive from "@radix-ui/react-toggle"
5-
import { cva, type VariantProps } from "class-variance-authority"
3+
import * as React from "react";
4+
import * as TogglePrimitive from "@radix-ui/react-toggle";
5+
import {cva, type VariantProps} from "class-variance-authority";
66

7-
import { cn } from "@/lib/utils"
7+
import {cn} from "@/lib/utils";
88

99
const toggleVariants = cva(
1010
"inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground",
1111
{
1212
variants: {
1313
variant: {
1414
default: "bg-transparent",
15-
outline:
16-
"border border-input bg-transparent hover:bg-accent hover:text-accent-foreground",
15+
outline: "border border-input bg-transparent hover:bg-accent hover:text-accent-foreground",
1716
},
1817
size: {
1918
default: "h-10 px-3",
@@ -25,21 +24,20 @@ const toggleVariants = cva(
2524
variant: "default",
2625
size: "default",
2726
},
28-
}
29-
)
27+
},
28+
);
3029

3130
const Toggle = React.forwardRef<
3231
React.ElementRef<typeof TogglePrimitive.Root>,
33-
React.ComponentPropsWithoutRef<typeof TogglePrimitive.Root> &
34-
VariantProps<typeof toggleVariants>
35-
>(({ className, variant, size, ...props }, ref) => (
32+
React.ComponentPropsWithoutRef<typeof TogglePrimitive.Root> & VariantProps<typeof toggleVariants>
33+
>(({className, variant, size, ...props}, ref) => (
3634
<TogglePrimitive.Root
3735
ref={ref}
38-
className={cn(toggleVariants({ variant, size, className }))}
36+
className={cn(toggleVariants({variant, size, className}))}
3937
{...props}
4038
/>
41-
))
39+
));
4240

43-
Toggle.displayName = TogglePrimitive.Root.displayName
41+
Toggle.displayName = TogglePrimitive.Root.displayName;
4442

45-
export { Toggle, toggleVariants }
43+
export {Toggle, toggleVariants};

src/lib/utils.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { type ClassValue, clsx } from "clsx"
2-
import { twMerge } from "tailwind-merge"
1+
import {type ClassValue, clsx} from "clsx";
2+
import {twMerge} from "tailwind-merge";
33

44
export function cn(...inputs: ClassValue[]) {
5-
return twMerge(clsx(inputs))
5+
return twMerge(clsx(inputs));
66
}

src/modules/cart/components/CartDrawer/CartDrawer.tsx

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,16 @@ function CartDrawer({
3636

3737
function handleUpdateCart(id: number, item: CartItem) {
3838
if (!item.quantity) {
39-
return removeItem(id);
39+
removeItem(id);
40+
41+
return;
4042
}
4143

42-
return updateItem(id, item);
44+
updateItem(id, item);
4345
}
4446

4547
function handleUpdateField(id: string, value: string) {
46-
return updateField(id, value);
48+
updateField(id, value);
4749
}
4850

4951
useEffect(() => {
@@ -82,7 +84,9 @@ function CartDrawer({
8284
data-testid="continue-order"
8385
size="lg"
8486
variant="brand"
85-
onClick={() => setCurrentStep("fields")}
87+
onClick={() => {
88+
setCurrentStep("fields");
89+
}}
8690
>
8791
Continuar
8892
</Button>
@@ -95,7 +99,9 @@ function CartDrawer({
9599
className="w-full"
96100
size="lg"
97101
variant="ghost"
98-
onClick={() => setCurrentStep("details")}
102+
onClick={() => {
103+
setCurrentStep("details");
104+
}}
99105
>
100106
Revisar pedido
101107
</Button>

src/modules/cart/components/CartDrawer/Details.tsx

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import type {Cart, CartItem} from "../../types";
22

3-
import {Button} from "@/components/ui/button";
43
import {parseCurrency} from "~/currency/utils";
54

5+
import {Button} from "@/components/ui/button";
6+
67
import {getCartItemPrice, getCartItemOptionsSummary} from "../../utils";
78

89
function Details({cart, onChange}: {cart: Cart; onChange: (id: number, item: CartItem) => void}) {
@@ -26,9 +27,10 @@ function Details({cart, onChange}: {cart: Cart; onChange: (id: number, item: Car
2627
<Button
2728
className="text-md h-6 w-6 rounded-full"
2829
data-testid="decrement"
29-
size="xs"
3030
variant="brand"
31-
onClick={() => onChange(id, {...item, quantity: item.quantity - 1})}
31+
onClick={() => {
32+
onChange(id, {...item, quantity: item.quantity - 1});
33+
}}
3234
>
3335
{" "}
3436
-{" "}
@@ -39,9 +41,10 @@ function Details({cart, onChange}: {cart: Cart; onChange: (id: number, item: Car
3941
<Button
4042
className="text-md h-6 w-6 rounded-full"
4143
data-testid="increment"
42-
size="xs"
4344
variant="brand"
44-
onClick={() => onChange(id, {...item, quantity: item.quantity + 1})}
45+
onClick={() => {
46+
onChange(id, {...item, quantity: item.quantity + 1});
47+
}}
4548
>
4649
{" "}
4750
+{" "}

0 commit comments

Comments
 (0)