modalBuilder
Ce contenu n’est pas encore disponible dans votre langue.
modalBuilder(
client,args):ModalBuilder
Defined in: actions/wrapper/modalBuilder.ts:98
Helper to craft Frak modal, and share a base initial config
Parameters
Section titled “Parameters”client
Section titled “client”The current Frak Client
login?
Section titled “login?”ModalStepMetadata & { allowSso: true; ssoMetadata?: SsoMetadata; } | ModalStepMetadata & { allowSso?: false; ssoMetadata?: undefined; }
Login step parameters
metadata?
Section titled “metadata?”Common modal metadata (customisation, language etc)
Returns
Section titled “Returns”Description
Section titled “Description”This function will create a modal builder with the provided metadata and login parameters.
Example
Section titled “Example”Here is an example of how to use the modalBuilder to create and display a sharing modal:
// Create the modal builderconst modalBuilder = window.FrakSDK.modalBuilder(frakClient, baseModalConfig);
// Configure the information to be shared via the sharing linkconst sharingConfig = { popupTitle: "Share this with your friends", text: "Discover our product!", link: window.location.href,};
// Display the sharing modalfunction modalShare() { modalBuilder.sharing(sharingConfig).display();}- ModalStepTypes for more info about each modal step types and their parameters
- ModalRpcMetadata for more info about the metadata that can be passed to the modal
- ModalRpcStepsResultType for more info about the result of each modal steps
- displayModal for more info about how the modal is displayed