UNPKG

@selfcommunity/react-ui

Version:

React UI Components to integrate a Community created with SelfCommunity Platform.

74 lines (65 loc) 1.76 kB
import { SCContentType, SCPaymentProduct, SCPurchasableContent } from '@selfcommunity/types'; import React from 'react'; import { PaymentOrderPdfButtonProps } from '../PaymentOrderPdfButton'; export interface BuyButtonProps { /** * Overrides or extends the styles applied to the component. * @default null */ className?: string; /** * Content type */ contentType: SCContentType; /** * Content id */ contentId?: number | string; /** * Purchasable Content */ content?: SCPurchasableContent; /** * Prefetched products */ prefetchedProducts?: SCPaymentProduct[]; /** * onPurchase callback * @param user * @param joined */ onPurchase?: (contentType: SCContentType, id: number) => any; /** * show ticket button if content is already paid */ showTicket?: boolean; /** * Props to spread to the PaymentOrderPdfButton component * @default {} */ PaymentOrderPdfButtonComponentProps?: PaymentOrderPdfButtonProps; /** * Overrides the button label. * @default null */ label?: React.ReactNode; /** * Others properties */ [p: string]: any; } /** * > API documentation for the Community-JS Buy Button component. Learn about the available props and the CSS API. #### Import ```jsx import {BuyButton} from '@selfcommunity/react-ui'; ``` #### Component Name The name `BuyButton` can be used when providing style overrides in the theme. #### CSS |Rule Name|Global class|Description| |---|---|---| |root|.SCBuyButton-root|Styles applied to the root element.| * @param inProps */ export default function BuyButton(inProps: BuyButtonProps): JSX.Element;