Skip to content

Commit 55f0446

Browse files
committed
chore: drawer title is mandatory
1 parent 1bb414f commit 55f0446

File tree

2 files changed

+15
-16
lines changed

2 files changed

+15
-16
lines changed

src/components/Drawers.tsx

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,21 @@ import { VariantProps } from "class-variance-authority"
1313

1414
type DrawerProps = Parameters<typeof Drawer>[0]
1515
type BaseDrawerProps = DrawerProps & {
16-
title?: string
16+
title: string
1717
description?: string
1818
trigger?: React.ReactNode
1919
children?: React.ReactNode
2020
}
21-
export function BaseDrawer({ title, description, trigger, children, ...drawerProps }: BaseDrawerProps) {
21+
export function BaseDrawer({ title, description = "", trigger, children, ...drawerProps }: BaseDrawerProps) {
2222
return (
2323
<Drawer {...drawerProps}>
2424
{trigger && <DrawerTrigger asChild>{trigger}</DrawerTrigger>}
2525
<DrawerContent>
2626
<div className="mx-auto w-full max-w-sm">
27-
{title && (
28-
<DrawerHeader>
29-
<DrawerTitle>{title}</DrawerTitle>
30-
{description && <DrawerDescription>{description}</DrawerDescription>}
31-
</DrawerHeader>
32-
)}
27+
<DrawerHeader>
28+
<DrawerTitle>{title}</DrawerTitle>
29+
{description && <DrawerDescription>{description}</DrawerDescription>}
30+
</DrawerHeader>
3331
{children}
3432
</div>
3533
</DrawerContent>

src/pages/quotes/QuotePage.tsx

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,8 @@ function OfferConfirmDrawer({ children, onSubmit, ...drawerProps }: OfferConfirm
8585
return (
8686
<ConfirmDrawer {...drawerProps} onSubmit={onSubmit} submitButtonText="Yes, offer quote.">
8787
<>
88-
<div className="px-4 py-12">
89-
<div className="flex items-center justify-center space-x-2">
90-
Are you sure you want to <span className="ps-1 font-bold">offer the quote</span>?
91-
</div>
88+
<div className="py-12 text-xl">
89+
Are you sure you want to <span className="ps-1 font-bold">offer the quote</span>?
9290
</div>
9391
<>{children}</>
9492
</>
@@ -110,10 +108,8 @@ function DenyConfirmDrawer({ children, onSubmit, ...drawerProps }: DenyConfirmDr
110108
submitButtonVariant="destructive"
111109
onSubmit={onSubmit}
112110
>
113-
<div className="px-4 py-12">
114-
<div className="flex items-center justify-center space-x-2">
115-
Are you sure you want to <span className="ps-1 font-bold">deny the quote</span>?
116-
</div>
111+
<div className="py-12 text-xl">
112+
Are you sure you want to <span className="ps-1 font-bold">deny offering a quote</span>?
117113
</div>
118114
</ConfirmDrawer>
119115
)
@@ -204,6 +200,7 @@ function QuoteActions({ value, isFetching }: { value: InfoReply; isFetching: boo
204200
<>
205201
<div className="flex items-center gap-2">
206202
<DenyConfirmDrawer
203+
title="Confirm denying quote"
207204
open={denyConfirmDrawerOpen}
208205
onOpenChange={setDenyConfirmDrawerOpen}
209206
onSubmit={() => {
@@ -220,6 +217,8 @@ function QuoteActions({ value, isFetching }: { value: InfoReply; isFetching: boo
220217
</Button>
221218
</DenyConfirmDrawer>
222219
<OfferFormDrawer
220+
title="Offer quote"
221+
description="Make an offer to the current holder of this bill"
223222
open={offerFormDrawerOpen}
224223
onOpenChange={setOfferFormDrawerOpen}
225224
onSubmit={(data) => {
@@ -233,6 +232,8 @@ function QuoteActions({ value, isFetching }: { value: InfoReply; isFetching: boo
233232
</Button>
234233
</OfferFormDrawer>
235234
<OfferConfirmDrawer
235+
title="Confirm offering quote"
236+
description="Review your inputs and confirm the offer"
236237
open={offerConfirmDrawerOpen}
237238
onOpenChange={setOfferConfirmDrawerOpen}
238239
onSubmit={() => {

0 commit comments

Comments
 (0)