Skip to content

Commit

Permalink
chore: Fix build and UI
Browse files Browse the repository at this point in the history
  • Loading branch information
mateopresacastro committed Nov 8, 2024
1 parent 184362f commit 05a2211
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
4 changes: 2 additions & 2 deletions app/[userName]/[samplePackName]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ export default async function Page({
<span className="block text-neutral-400">{samplePack.description}</span>
<Link href={`/${userName}`} prefetch={true}>
<span className="text-neutral-400 block pt-1 font-medium text-xs">
by @{userName}
@{userName}
</span>
</Link>
<NumberFlow
value={Number(samplePack.price.toFixed(2))}
format={{ style: "currency", currency: "USD" }}
locales="en-US"
className="pt-1"
className="pt-4"
/>
<Button className="font-medium w-full my-6 text-base" size="lg">
Buy
Expand Down
13 changes: 6 additions & 7 deletions components/edit-pack-button.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use client";

import { set, z } from "zod";
import { z } from "zod";
import { Button, buttonVariants } from "@/components/ui/button";
import { zodResolver } from "@hookform/resolvers/zod";
import { useUser } from "@clerk/nextjs";
Expand Down Expand Up @@ -40,7 +40,6 @@ import {
updateSamplePackAction,
} from "@/lib/db/actions";
import { urlNameToTitle } from "@/lib/utils";
import { ChartNoAxesColumnDecreasing } from "lucide-react";
import { useEffect, useState } from "react";

// TODO: handle image upload
Expand Down Expand Up @@ -105,12 +104,12 @@ export default function EditPackButton({
});

useEffect(() => {
if (!newSamplePackName || newSamplePackName === samplePackName) {
if (!newSamplePackName) {
return;
}

router.push(`/${userName}/${newSamplePackName}`);
}, [newSamplePackName]);
}, [newSamplePackName, router, samplePackName, userName]);

function onSubmit() {
// TODO check that user actually changed values
Expand All @@ -125,7 +124,7 @@ export default function EditPackButton({
</Button>
</DialogTrigger>
<DialogContent>
<DialogHeader>
<DialogHeader className="p-1">
<DialogTitle>Edit sample pack</DialogTitle>
<DialogDescription>
If you want to change the samples delete this pack and create a new
Expand All @@ -135,7 +134,7 @@ export default function EditPackButton({
<Form {...form}>
<form
onSubmit={form.handleSubmit(onSubmit)}
className="space-y-14 w-full pt-8 overflow-y-scroll"
className="space-y-8 w-full pt-8 overflow-y-scroll px-1"
>
<FormField
control={form.control}
Expand Down Expand Up @@ -183,7 +182,7 @@ export default function EditPackButton({
</FormItem>
)}
/>
<div className="flex justify-between items-center">
<div className="flex justify-between items-center pt-8">
<Button type="submit">Submit</Button>
<AlertDialog>
<AlertDialogTrigger
Expand Down
2 changes: 1 addition & 1 deletion components/ui/input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const Input = React.forwardRef<HTMLInputElement, InputProps>(
<input
type={type}
className={cn(
"flex h-9 w-full rounded-md border border-neutral-200 bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-neutral-950 placeholder:text-neutral-500 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-neutral-950 disabled:cursor-not-allowed disabled:opacity-50 dark:border-neutral-800 dark:file:text-neutral-50 dark:placeholder:text-neutral-400 dark:focus-visible:ring-neutral-300",
"flex h-9 w-full rounded-xl border border-neutral-200 bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-neutral-950 placeholder:text-neutral-500 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-neutral-950 disabled:cursor-not-allowed disabled:opacity-50 dark:border-neutral-800 dark:file:text-neutral-50 dark:placeholder:text-neutral-400 dark:focus-visible:ring-neutral-300",
className
)}
ref={ref}
Expand Down

0 comments on commit 05a2211

Please sign in to comment.