Store editor
Media upload section
Cover and gallery upload. Exports the product types that can carry unlockable media.
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.
Media upload 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.
| Prop | Type | Default | Description |
|---|---|---|---|
productType* | ProductKindType | — | Undocumented — add TSDoc to the prop in the library. |
promoImages* | string[] | — | Promo image sources — data URIs or absolute URLs. Rendered as 64px thumbs. |
onPromoImagesChange* | (images: string[]) => void | — | Undocumented — add TSDoc to the prop in the library. |
unlockableFiles* | string[] | — | The unlockable payload as opaque strings (file names in the app). Held here but deliberately *not* rendered — the app never listed them in this section, and preserving that keeps the visual byte-identical. |
onUnlockableFilesChange* | (files: string[]) => void | — | Undocumented — add TSDoc to the prop in the library. |
showUnlockable | boolean | — | Overrides whether the "unlock" well renders. Defaults to `UNLOCKABLE_PRODUCT_TYPES.includes(productType)` — courses, events and services deliver differently and get their own sections. |
toPromoImageValue | (file: File, index: number) => string | () => PLACEHOLDER_PROMO_IMAGE | Turns a picked promo file into the string held in `promoImages`. The app base64-encoded each file with a `FileReader`; the default here resolves to `PLACEHOLDER_PROMO_IMAGE`, which keeps the component synchronous and side-effect free. |
toUnlockableFileValue | (file: File, index: number) => string | (file) => file.name | Turns a picked unlockable file into the string held in `unlockableFiles`. |
onPromoFilesSelected | (files: File[]) => void | — | Fires with the raw picks as well, for a host that wants to upload for real. |
onUnlockableFilesSelected | (files: File[]) => void | — | Undocumented — add TSDoc to the prop in the library. |
promoHint | string | "PNG | Small print under the promo drop zone. |
className | string | — | 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/MediaUploadSection.tsx- Portability
- Needs its app dependencies replaced by props before it renders in isolation.