Skip to main content
Version: 2.0.0

AddressSelectContainer

Handles selecting one of the user's addresses.

Usage#

import React from "react";
import {
AddressSelectContainer,
AddressSelectList,
AddressSelectSubmit,
Alert,
} from "@pelcro/react-pelcro-js";
import "@pelcro/react-pelcro-js/dist/pelcro.css";
export const CustomAddressSelectView = () => {
return (
<AddressSelectContainer
onSuccess={(selectedAddressId) => {
console.log(selectedAddressId);
}}
onFailure={(err) => {
console.error(err.message);
}}
>
<Alert />
<AddressSelectList />
<AddressSelectSubmit />
</AddressSelectContainer>
);
};

Reference#

AddressSelectContainer#

Props#

onSuccess#

(selectedAdressId) โ‡’ void

Callback function called when the address is selected succesfully.

onGiftRedemptionSuccess#

(userObject) โ‡’ void

Callback function called when the user is redeeming a gift, and the gift is redeemed succesfully.

onFailure#

(errorObject) โ‡’ void

Callback function called when the gift redemption fails.

Children components#

Alert#

Displays the relevant errors or success messages.


AddressSelectList Required#

A selectable list of all the user's addresses.


AddressSelectSubmit Required#

Instance of Button

A button component that submits the selected address.

Props#

name#

string?

The title displayed inside the button