UNPKG

@frak-labs/components

Version:

Frak Wallet components, helping any person to interact with the Frak wallet.

86 lines (81 loc) 2.62 kB
import type { FullInteractionTypesKey } from '@frak-labs/core-sdk'; import { JSX } from 'preact'; /** * Button to share the current page * * @param args * @returns The share button with `<button>` tag * * @group components * * @example * Basic usage: * ```html * <frak-button-share></frak-button-share> * ``` * * @example * Using a custom text: * ```html * <frak-button-share text="Share and earn!"></frak-button-share> * ``` * * @example * Using a custom class: * ```html * <frak-button-share classname="button button-primary"></frak-button-share> * ``` * * @example * Using reward information and fallback text: * ```html * <frak-button-share use-reward text="Share and earn up to {REWARD}!" no-reward-text="Share and earn!"></frak-button-share> * ``` * * @example * Using reward information for specific reward and fallback text: * ```html * <frak-button-share use-reward text="Share and earn up to {REWARD}!" no-reward-text="Share and earn!" target-interaction="retail.customerMeeting"></frak-button-share> * ``` * * @see {@link @frak-labs/core-sdk!actions.modalBuilder | `modalBuilder()`} for more info about the modal display * @see {@link @frak-labs/core-sdk!actions.getProductInformation | `getProductInformation()`} for more info about the estimated reward fetching */ export declare function ButtonShare({ text, classname, useReward: rawUseReward, noRewardText, targetInteraction, showWallet: rawShowWallet, }: ButtonShareProps): JSX.Element; export declare interface ButtonShareElement extends HTMLElement, ButtonShareProps { } /** * The props type for {@link ButtonShare}. * @inline */ declare type ButtonShareProps = { /** * Text to display on the button * - To specify where the reward should be displayed, use the placeholder `{REWARD}`, e.g. `Share and earn up to {REWARD}!` * @defaultValue `"Share and earn!"` */ text?: string; /** * Classname to apply to the button */ classname?: string; /** * Do we display the reward on the share modal? * @defaultValue `false` */ useReward?: boolean; /** * Fallback text if the reward isn't found */ noRewardText?: string; /** * Target interaction behind this sharing action (will be used to get the right reward to display) */ targetInteraction?: FullInteractionTypesKey; /** * Do we display the wallet modal instead of the share modal? * @defaultValue `false` */ showWallet?: boolean; }; export { }