Tally UI

SaleWarningToast

SaleWarningToast shows the sale's stock warning, such as an add that will be backordered.

Import

import { SaleWarningToast } from '@tallyui/components';

Usage

<SaleWarningToast warning={sale.warning} />

Mount it once beside AddedToCartToast, as a late child of the screen's root view. When an add or a quantity raise passes the stock of a product that takes backorders with notice, the add still happens and it shows WCPOS v2's warning toast, such as "Shirt will be backordered", for 4 seconds, in its own slot below the add toast. Each new seq shows it again; a warning already there when it mounts does not show. A host that does not mount it shows nothing.

Props

PropTypeDefaultDescription
warningSaleWarning | nullrequireduseSale().warning: the latest stock warning ({ kind, name, seq }), or null before any; a new seq is a new warning
testIDstring'sale-warning-toast'Test identifier

On this page