Skip to content

QuoteRequestComment

The buyer's optional message to the seller, held by the app until submit: the request it belongs to does not exist yet, so nothing is written while typing.

import { QuoteRequestComment } from "@evolve-storefront/feature-quote/checkout";

Renders inside QuoteProvider.

Preview

Request And Remove CartOpen in Storybook ↗

Usage

const deleteCart = useDeleteCart();
const quote = useQuoteRequestEnding({
comment,
fields: (
<>
<QuoteRequestComment value={comment} onValueChange={setComment} />
<QuoteRequestRemoveCart checked={removeCart} onCheckedChange={setRemoveCart} />
</>
),
removeCart: removeCart ? () => deleteCart.mutateAsync({ cart }) : undefined,
onRequested: (created) => router.push(quoteRequestHref(created.id.id)),
});
<CheckoutFinishSection cart={cart} endings={[quote]} onPlaceOrder={placeAndPay} />;

Props

PropTypeDescription
valuestring
onValueChange(comment: string) => void
disabled?boolean
className?string

Examples

Remove Cart FailsA cart that could not be removed does not undo the request: it is still made.
useQuoteRequestEnding({ removeCart: () => deleteCart.mutateAsync({ cart }) });
Open in Storybook ↗
Without The CapabilityA buyer without the capability gets the ending with isHeld: false, which the finish step leaves out.
<CheckoutFinishSection cart={cart} endings={[useQuoteRequestEnding()]} onPlaceOrder={placeAndPay} />;
Open in Storybook ↗