Skip to content

Store editor

Product settings section

Access and expiry for a standard product.
Available
Needs mock props

Examples

Rendered live from the maintained Storybook story. Lantern stores only the story id and embeds Storybook rather than duplicating the component or its demo.

Product settings section

Rendered live from Storybook

Storybook must be running for this to load — bun run start:storybook from the monorepo root, or set NEXT_PUBLIC_STORYBOOK_URL to a deployed instance.

Props

The component's public API, read from its TypeScript source. Descriptions come from TSDoc on the prop, so this table cannot drift from the component.

PropTypeDefaultDescription
productType*ProductKindType—Undocumented — add TSDoc to the prop in the library.
form*ProductFormState—Undocumented — add TSDoc to the prop in the library.
onFormChange*(updates: Partial<ProductFormState>) => void—Undocumented — add TSDoc to the prop in the library.
nowDatePRODUCT_SETTINGS_DEFAULT_NOWReference "today". Feeds the calendar's disabled-days matcher and the month it opens on, so the control never reads the machine clock.
expiryEnabledboolean—Lifts the expiry toggle. Leave undefined to let the section seed itself from `form.expiryDays` and manage the switch, exactly as the app did.
initialExpiryEnabledboolean—Initial expiry-toggle state when uncontrolled. Defaults to `!!form.expiryDays`.
onExpiryEnabledChange(enabled: boolean) => void—Undocumented — add TSDoc to the prop in the library.
defaultOpenExpiryCalendarbooleanfalseRenders the expiry calendar open on mount so it is a static story.
onOpenDiscountSettings() => void—Fires when the "Settings" link in the discount-codes helper line is clicked. The app called `navigate("/creator/settings", { state: { settingsTab: "discounts" } })`; routing is the host's business here.
discountSettingsHrefstring—Renders the discount "Settings" link as a real anchor instead of a button. Takes precedence over `onOpenDiscountSettings` for the element used; both still fire on click.
currencySymbolstring"$"Currency symbol on the deposit field. BTS bills in AUD.
classNamestring—Undocumented — add TSDoc to the prop in the library.

Reference

Transcribed from the component audit. If this disagrees with the source, the source is right.

Source
src/components/store/editor/sections/ProductSettingsSection.tsx
Portability
Needs its app dependencies replaced by props before it renders in isolation.
Notes
Takes a now value so the expiry parser holds still.