Skip to content

Commit c470d4e

Browse files
ci: apply automated fixes
1 parent eec02e4 commit c470d4e

3 files changed

Lines changed: 38 additions & 31 deletions

File tree

src/components/shop/ProductDrawer.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,9 @@ export function ProductDrawer({
148148
// slides out with content visible (not empty). Uses the derived-state pattern
149149
// so displayHandle is updated synchronously on open (no empty-frame flash).
150150
const [displayHandle, setDisplayHandle] = React.useState<string | null>(null)
151-
const [prevProductHandle, setPrevProductHandle] = React.useState<string | null>(null)
151+
const [prevProductHandle, setPrevProductHandle] = React.useState<
152+
string | null
153+
>(null)
152154
if (productHandle !== prevProductHandle) {
153155
setPrevProductHandle(productHandle)
154156
if (productHandle) setDisplayHandle(productHandle)

src/components/shop/ui/Select.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,13 @@ function extractOptions(children: React.ReactNode): Array<OptionData> {
3131

3232
/** Custom themed dropdown. Keeps the same onChange API as a native <select>
3333
* so all call-sites stay unchanged. */
34-
export function ShopSelect({ value, onChange, className, triggerClassName, children }: Props) {
34+
export function ShopSelect({
35+
value,
36+
onChange,
37+
className,
38+
triggerClassName,
39+
children,
40+
}: Props) {
3541
const [open, setOpen] = React.useState(false)
3642
const [focused, setFocused] = React.useState<string | null>(null)
3743
const triggerRef = React.useRef<HTMLButtonElement>(null)

src/routes/shop.index.tsx

Lines changed: 28 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -198,35 +198,34 @@ function ShopIndex() {
198198

199199
{/* Product grid */}
200200
<div className="px-6 md:px-11 max-w-[1280px] mx-auto mt-7">
201-
{products.length === 0 ? (
202-
<div className="text-center py-24 text-shop-muted">
203-
No products yet. Check back soon!
204-
</div>
205-
) : (
206-
<>
207-
<section className="grid gap-x-4 gap-y-5.5 grid-cols-[repeat(auto-fill,minmax(340px,1fr))]">
208-
{products.map((product, i) => (
209-
<ProductCard
210-
key={product.id}
211-
product={product}
212-
loading={i < 8 ? 'eager' : 'lazy'}
213-
onQuickView={setDrawerHandle}
214-
/>
215-
))}
216-
</section>
217-
{hasNextPage ? (
218-
<div className="flex justify-center py-8">
219-
<ShopButton
220-
onClick={() => loadMore.mutate()}
221-
disabled={loadMore.isPending}
222-
>
223-
{loadMore.isPending ? 'Loading…' : 'Load more'}
224-
</ShopButton>
225-
</div>
226-
) : null}
227-
</>
228-
)}
229-
201+
{products.length === 0 ? (
202+
<div className="text-center py-24 text-shop-muted">
203+
No products yet. Check back soon!
204+
</div>
205+
) : (
206+
<>
207+
<section className="grid gap-x-4 gap-y-5.5 grid-cols-[repeat(auto-fill,minmax(340px,1fr))]">
208+
{products.map((product, i) => (
209+
<ProductCard
210+
key={product.id}
211+
product={product}
212+
loading={i < 8 ? 'eager' : 'lazy'}
213+
onQuickView={setDrawerHandle}
214+
/>
215+
))}
216+
</section>
217+
{hasNextPage ? (
218+
<div className="flex justify-center py-8">
219+
<ShopButton
220+
onClick={() => loadMore.mutate()}
221+
disabled={loadMore.isPending}
222+
>
223+
{loadMore.isPending ? 'Loading…' : 'Load more'}
224+
</ShopButton>
225+
</div>
226+
) : null}
227+
</>
228+
)}
230229
</div>
231230

232231
<ProductDrawer

0 commit comments

Comments
 (0)