Skip to main content
Version: 2.4.0

AddressSelectModal

The address select modal is used to select one of the user's adresses.

Loading...

Usage#

import React from "react";
import {
AddressSelectModal,
PelcroModalController,
usePelcro,
} from "@pelcro/react-pelcro-js";
import "@pelcro/react-pelcro-js/dist/pelcro.css";
export const AddressSelectExample = () => {
const { switchView } = usePelcro();
return (
<>
<button onClick={() => switchView("address-select")}>
Select an address
</button>
<PelcroModalController>
<AddressSelectModal />
</PelcroModalController>
</>
);
};

Reference#

Props#

onDisplay#

() โ‡’ void

Callback function called when the modal is first displayed.

onClose#

() โ‡’ void

Callback function called when the modal is closed.

onSuccess#

(selectedAddressId) โ‡’ 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.