Skip to content

Commit

Permalink
Merge pull request #8 from TEDx-SJEC/coupon
Browse files Browse the repository at this point in the history
Refactor: disabled the save button if there is no coupon
  • Loading branch information
Vyshnav001 authored Sep 14, 2024
2 parents a9a5c3f + 41646aa commit 89f9c41
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/components/Admin/code-generation-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,13 @@ export function Coupon({ session }: { session: NextAuthSession }) {
</CardHeader>
<CardContent className="space-y-2">
<div className="space-y-1">
<Label htmlFor="new">New password</Label>
<Label htmlFor="new">Coupon code</Label>
<Input id="new" type="text" disabled value={data} />
</div>
</CardContent>
<CardFooter>
<Button
disabled={data === undefined ? true : false}
onClick={async () => {
await saveCoupon(data as string, session.user.id);
}}
Expand Down

0 comments on commit 89f9c41

Please sign in to comment.