JoyLoyaltyPage
Interfaces
LoyaltyPageBlockProps
Extends
HydrogenComponentProps<LoyaltyPageLoaderData>
Properties
children?
children?: Element[];Rendered child component instances.
Inherited from
HydrogenComponentProps.children
className?
className?: string;Optional CSS class passed through by the renderer.
Inherited from
HydrogenComponentProps.className
Component
Component: ForwardRefExoticComponent<any>;The React component registered for the element.
Inherited from
HydrogenComponentProps.Component
data-wv-id
"data-wv-id": string;The unique element identifier used in rendered markup.
Inherited from
HydrogenComponentProps.data-wv-id
data-wv-type
"data-wv-type": string;The element type used in rendered markup.
Inherited from
HydrogenComponentProps.data-wv-type
loaderData?
loaderData?: LoyaltyPageLoaderData;Result returned by the component's server-side loader.
Inherited from
HydrogenComponentProps.loaderData
sectionId
sectionId: string;'all' (the whole page) or one section id — see SECTION_OPTIONS.
type
type: string;The registered element type.
Inherited from
HydrogenComponentProps.type
LoyaltyPageLoaderData
Loader payload — shop-level only. No customer field, by construction (D2).
Properties
apiUrl
apiUrl: string | null;assetUrl?
assetUrl?: string | null;Widget-core origin override (JOY_WIDGET_ASSET_URL) — the same env the
core-loader documents for pinning/self-hosting the CDN artifact. Null →
the default CDN.
data?
data?: JoyLoyaltyPageData;Undefined when the env vars are missing — there was nothing to fetch with.
error?
error?: string;shopDomain
shopDomain: string | null;Variables
schema
const schema: SchemaType;Functions
cartFromLoaderData()
function cartFromLoaderData(data): StorefrontCartProp | undefined;A cart route loader's answer → the cart: the cart itself (skeleton) or {cart, ...} (Pilot).
Parameters
| Parameter | Type |
|---|---|
data | unknown |
Returns
StorefrontCartProp | undefined
default()
function default(props): Element;Parameters
| Parameter | Type |
|---|---|
props | LoyaltyPageBlockProps |
Returns
Element
loader()
function loader(__namedParameters): Promise<LoyaltyPageLoaderData>;Parameters
| Parameter | Type |
|---|---|
__namedParameters | ComponentLoaderArgs |
Returns
Promise<LoyaltyPageLoaderData>
localeCartRoute()
function localeCartRoute(locale): string;The cart action route for the current ($locale) param — also where go_to_cart sends the shopper.
An optional :locale? segment also captures a plain path (/loyalty-page → locale: 'loyalty-page'),
so only a locale-shaped segment (fr, en-ca) becomes a prefix (NEW-02).
Parameters
| Parameter | Type |
|---|---|
locale | string | undefined |
Returns
string