1.6.6-beta.4 • Published 4 months ago

tf-checkout-react v1.6.6-beta.4

Weekly downloads
-
License
MIT
Repository
-
Last release
4 months ago

tf-checkout-react

 

 

Introduction

This package includes TicketFairy's checkout functionality, as well as various related functionalities. These functionalities include login/register, order management, resale, referrals, and more.

This package provides a set of components and functionalities designed to manage various aspects of the TicketFairy event experience. These include:

  • AccountSettings: A component for managing user account settings, such as email address and password.
  • AddonsContainter: A component for displaying a list of available add-ons and allowing the user to purchase them.
  • BillingInfoContainer: A component for managing billing information, such as addresses and ticket holders.
  • ConfirmationContainer: A component for displaying a confirmation page after a purchase is made.
  • IDVerification: A component for verifying the identity of the user during the checkout process.
  • MyTicketsContainer: A component for displaying a list of purchased orders.
  • OrderDetailsContainer: A component for displaying detailed information about a purchase, such as the ticket types, add-ons and pricing.
  • PaymentContainer: A component for managing payment processing during the checkout process.
  • ResetPasswordContainer: A component for resetting a user's password.
  • SeatMapContainer: A component for displaying and selecting seats on a venue map.
  • TicketResaleContainer: A component for managing the resale of tickets or add-ons by the user.
  • TicketsContainer: A component for displaying a list of available tickets and allowing the user to purchase them.

Together, these components and functionalities provide a comprehensive set of tools to manage the checkout process and related activities for a TicketFairy-powered event.
 
 

Intergrations

WebFlow

 

Prerequisites

  • node >= v16.19.0
  • npm >= 8.19.3

Installation

npm i tf-checkout-react

or

yarn add tf-checkout-react

Run Independently

  • Clone this repo: git clone https://github.com/theticketfairy/tf-checkout-react.git
  • Install dependencies: npm install
  • Install example app dependencies: cd example && npm install
  • Run example app from example folder: npm start

Project will run under localhost:3002. Port can be changed from package.json.

 

Usage

Set configuration

In order to make this package work properly, you need to set some configurations, otherwise the default configurations will be used. Currently only configuration which is needed for production, is BASE_URL. Other configurations written below are only for development/test environments.

Import setConfigs function from the package.

import { setConfigs } from 'tf-checkout-react'

Call it in the root and pass neccesary options. Here are available options:

Configurations for production

  • BASE_URL - need for making API calls (default: https://www.ticketfairy.com)

Configurations for development/testing

  • BASE_URL - need for making API calls
  • EVENT_ID - get and use specific event data
  • BRAND_SLUG - slug of the event's parent/owner brand
  • X_SOURCE_ORIGIN - need for local environment. This header will be included in every API request.

 

Functionalities

Login

The LoginModal component is designed to be used inside package to authenticate users. To use the LoginModal, simply include it in your React component and pass in the required onLogin and onClose callbacks as props.

You can authenticate users from the Billing page too, here you can either provide onLogin callback as a prop to the BillingInfoContainer component so that you can open your custom component for authentication or you can ommit it and the package inside provided LoginModal component will be called and opened.

Package can detect whether a user is logged in or not by checking for the presence of the X-TF-ECOMMERCE cookie, which is automatically set by the system when the user successfully logs in. If the X-TF-ECOMMERCE cookie is present, the package assumes that the user is logged in and displays the appropriate content.

The LoginModal component also is used in MyTicketsContainer and TicketsContainer.

To detect whether a user is logged in or not, you can use the useCookieListener hook provided by the package. Here's an example of how to use the useCookieListener hook to automatically detect whether the user is logged in:

import { useEffect, useRef, useState } from 'react'
import { useCookieListener } from 'tf-checkout-react'

const MyComponent = () => {
  const [isLogged, setIsLogged] = useState(false)

  // Listen for changes to the __X-TF-ECOMMERCE__ cookie
  useCookieListener("X_TF_ECOMMERCE", value => setIsLogged(Boolean(value)))

  // ... rest of component logic
}
PropertyTypeRequiredDefault ValueDescription
onLogin() => voidyesN/ACalled after the user successfully authorizes.
onClose() => voidyesN/ACalled on modal close.
onGetProfileDataSuccess(data) => voidnovalue => valueA callback function that is called when the profile data is successfully retrieved.
onGetProfileDataError(error) => voidnovalue => valueA callback function that is called when retrieving the profile data fails.
onForgotPassword() => voidnovalue => valueCalled on “Forgot Password” button click.
onSignup() => voidnovalue => valueCalled on “Sign Up” button click.
modalClassnamestringno" "Login modal main container class.
logostring / URL / pathnoTheTicketFairy black logo (URL)Login modal top section’s logo.
showForgotPasswordButtonbooleannofalseDisplay “Forgot Password” button.
showSignUpButtonbooleannofalseDisplay “Sign Up” button.
alreadyHasUserbooleannofalseWhether or not to show the "email is already attached to an account" message block.
userExpiredbooleannofalseWhether or not to show the "session expired" message block.
showPoweredByImagebooleannofalseWhether or not to show the Powered image.

 

Register

The RegisterModal component is designed to be used inside package to allows users to register for an account.

When the user submits the form, the component calls the register API function to create the user's account. If account creation is successful, the component then retrieves the user's profile data. The onGetProfileDataSuccess and onGetProfileDataError callbacks are then called depending on whether the profile data retrieval succeeds or fails. If profile data retrieval succeeds, the component maps the profile data to a format used by the application and saves the resulting data to the browser's localStorage. Finally, the onClose callback is called to close the modal.

PropertyTypeRequiredDefault ValueDescription
onRegister (deprecated)() => voidnoN/A-
onClose() => voidyesN/ACalled on modal close, after register request's success.
onGetProfileDataSuccess(data) => voidnovalue => valueA callback function that is called when the profile data is successfully retrieved.
onGetProfileDataError(error) => voidnovalue => valueA callback function that is called when retrieving the profile data fails.
showPoweredByImagebooleannofalseWhether or not to show the Powered image.

 

Forgot Password

The ForgotPasswordModal component is a modal dialog for users to reset their passwords. To use it, simply import the component, manage its open state, and provide callback functions for closing the modal, navigating back to the login page or component, handling successful password reset requests, and handling errors in password reset requests. Optionally, you can also display a "Powered By" image within the modal by setting the showPoweredByImage prop to true.

PropertyTypeRequiredDefault ValueDescription
onLogin() => voidyesN/ACalled on "Back to Log In" button click.
onClose() => voidyesN/ACalled on modal close, after register request's success.
onForgotPasswordSuccess(data) => voidnovalue => valueA callback function that is called when the user successfully resets their password.
onForgotPasswordError(error) => voidnovalue => valueA callback function that is called when there is an error resetting the password.
showPoweredByImagebooleannofalseWhether or not to show the Powered image.

Promo Code

The PromoCodeSection is a React component for handling promo code input, validation, and displaying success or error messages. It accepts various props to control its appearance and behavior, such as the promo code value, validation status, input visibility, and callback functions for updating the state which you can see in the below provided table.

To use this component, simply import it and include it in your JSX with the required props, managing the component's state and callback functions in the parent component as needed.

Note that package automatically calls component in TicketsContainer

PropertyTypeRequiredDefault ValueDescription
codestringyes' 'The promo code.
codeIsAppliedbooleanyesfalseWhether or not the promo code is currently applied.
showPromoInputbooleanyesfalseWhether or not to show the promo code input field.
codeIsInvalidbooleanyesfalseWhether or not the promo code is invalid.
showAlertIconsbooleannofalseWhether or not to show the alert icons.
promoTextstringnofalseButton label, which click displays promo code input.
-----
setCode(value: string) => voidyes-A function to set the promo code.
setCodeIsApplied(value: boolean) => voidyes-A function to set whether or not the promo code is currently applied.
setCodeIsInvalid(value: boolean) => voidyes-A function to set whether or not the promo code is invalid.
setShowPromoInput(value: boolean) => voidyes-A function to set whether or not to show the promo code input field.
updateTickets(value: boolean, type: string) => voidyes-A function to update the tickets based on the promo code.

Access Code

The AccessCodeSection is a React component designed for handling access code input and submission. It allows users to enter an access code and triggers an update to the ticket information based on the submitted access code. The component accepts a set of props to manage the access code value and provide callback functions for updating the state which you can see in below table.

To integrate the AccessCodeSection component, import it into your JSX and provide the required props, such as the access code value, and callback functions for updating the state. Make sure to manage the component's state and callback functions within the parent component as needed.

Note that package automatically calls component in TicketsContainer

PropertyTypeRequiredDefault ValueDescription
codestringyes' 'The access code.
-----
setCode(value: string) => voidyes-A function to set the access code.
updateTickets(value: boolean) => voidyes-A function to update the tickets based on the access code.

Waiting List

The WaitingList component is a React component designed to handle user registration for a waiting list. It displays a form that allows users to input their information, including first name, last name, email, ticket type, and quantity. Upon submission, the component adds the user to the waiting list and displays a success message.

Note that package automatically calls component in TicketsContainer

PropertyTypeRequiredDefault ValueDescription
ticketsObjectyes' 'The list of tickets to be displayed.
eventIdstring / numberyesN/AThe ID of the event for which the tickets are displayed.
defaultMaxQuantitynumberyes10The default maximum quantity of tickets that can be selected.

Pixel Usage

The usePixel hook is a utility function used to load a pixel script for tracking events on the page. It is commonly used in multiple components throughout the application to track various user actions, such as the completion of a checkout or a purchase.

The purpose of the usePixel hook is to enable event tracking and analytics for various user actions within the application.

Here is the list of pages where the usePixel function is automatically used:

  • Billing Info Container
  • Confirmation Container
  • Payment Container
  • Tickets Container

 

Components

TicketsContainer

Tickets component will retrieve and show a list of tickets corresponding to selected event, which allows the user to select the desired ticket type and quantity.

The "Get Tickets" button which name is also customizable, allows the user to add the selected tickets to their cart and proceed to the checkout process. Other buttons can be displayed to handle various actions, such as viewing the user's orders or logging out.

Tickets component provides a section for entering an Access Code or Promo Code that applies a discount to the ticket price or hide/unhide some tickets via Access Code. It also containes WaitingLsit that manages and displays waiting list functionality for the event. Props interface partially extends Promo Code Props Interface, Access Code Props Interface, Waiting List Props Interface.

Tickets component displays a list of the top influencers who have promoted the event.

Tickets component is flexible and customizable, allowing for different layouts and behaviors depending on the event's requirements.

Example of usage:

import { TicketsContainer } from 'tf-checkout-react'

<TicketsContainer
  theme="light"
  eventId={event?.id}
  handleNotInvitedModalClose={() => { }}
  handleInvalidLinkModalClose={() => { }}
  onAddToCartSuccess={() => {}}
  isPromotionsEnabled={event?.is_promotions_enabled}
  isAccessCodeEnabled={event?.is_access_code}
  onLogoutSuccess={() => {}}
  hideSessionButtons={true}
  enableAddOns={false}
  showGroupNameBlock={true}
  tableTicketsHeaderComponent={<div className="tickets-container-header">RESERVE TABLES</div>}
  onPendingVerification={() => {}}
/>
PropertyTypeRequiredDefault valueDescription
eventIdstring / numberyesN/AThe unique identifier for the event that the tickets belong to.
getTicketsLabelstringno“Get Tickets"The label for the "Get Tickets" button.
contentStyleCSSPropertiesno{}An object containing styles to apply to the tickets list container.
theme‘light’, ‘dark'no‘light'The theme to use for the tickets list container. Sets as className.
themeOptionsMUI ThemeOptionsnoN/AMUI Theme Provider’s theme options.
queryPromoCode (deprecated)----
isButtonScrollable (deprecated)----
disableCountdownLeadingZero (deprecated)----
isLoggedIn (deprecated)----
isPromotionsEnabledbooleannofalseWhether or not promotions are enabled for the tickets list.
isAccessCodeEnabledbooleannofalseWhether or not access codes are enabled for the tickets list.
hideTicketsHeaderbooleannofalseWhether to hide the tickets header.
hideSessionButtonsbooleannofalseWhether to hide “My Tickets” and “Log Out” buttons.
hideWaitingListbooleannofalseWhether to hide the waiting list.
enableBillingInfoAutoCreatebooleannotrueWhether to enable auto-creation of billing information, instead of manually creation by user.
enableInfluencersSectionbooleannotrueWhether to display the influencers section.
enableAddOnsbooleannotrueWhether to enable add-ons.
sortBySoldOutbooleannofalseWhether to sort tickets by sold-out status. By default tickets will be sorted by sort order.
hideTableTicketsHeaderbooleannofalseWhether to hide table type tickets section header.
showPoweredByImagebooleannofalseWhether to show the "Powered by TheTicketFairy" image.
showGroupNameBlockbooleannofalseWhether to show the ticket group name block.
actionsSectionComponentReactNodenoN/ACustom component instead of “Get Tickets” button.
ticketsHeaderComponentReactNodenoN/AA React component to render the tickets section header.
tableTicketsHeaderComponentReactNodenoN/AA React component to render the table type tickets section header.
ordersPathstringno'/orders'The URL path to the orders page.
currencySybmolstringno' 'The currency symbol to use.
-----
onAddToCartSuccess(data) => voidnovalue => valueA callback function to be called when a ticket is successfully added to the cart.
onAddToCartError(error) => voidnovalue => valueA callback function to be called when there is an error adding a ticket to the cart.
onGetTicketsSuccess(data) => voidnovalue => valueA callback function to be called when the tickets are successfully retrieved.
onGetTicketsError(error) => voidnovalue => valueA callback function to be called when there is an error retrieving the tickets.
onLogoutSuccess() => voidnovalue => valueA callback function to be called when the user successfully logs out.
onLogoutError(error) => voidnovalue => valueA callback function to be called when there is an error logging out.
onLoginSuccess() => voidnovalue => valueA callback function to be called when the user successfully logs in.
handleNotInvitedModalClose() => voidnovalue => valueA callback function to be called when the "Not Invited" modal is closed.
handleInvalidLinkModalClose() => voidnovalue => valueA callback function to be called when the "Invalid Link" modal is closed.
onReserveButtonClick() => voidnovalue => valueA callback function to be called when the 'Select on map' button is clicked.
onPendingVerification() => voidnovalue => valueA callback function to be called when the verification process is passed and pending response.

 

AddOnsContainer

Add-Ons component will retrieve and show a list of add-ons corresponding to selected event.

PropertyTypeRequiredDefault valueDescription
classNamePrefixstringno'add_on'Prefix to use for the CSS class names of the component.
enableBillingInfoAutoCreatebooleannotrueWhether to enable auto-creation of billing information, instead of manually creation by user.
enableTimerbooleannotrueWhether to show a timer for the user.
-----
onGetAddonsPageInfoSuccess(data) => voidnovalue => valueA callback function to be called when the add-ons page information is successfully fetched.
onGetAddonsPageInfoError(error) => voidnovalue => valueA callback function to be called when there is an error while fetching the add-ons page information.
onPostCheckoutSuccess(data) => voidnovalue => valueA callback function to be called when the add-ons are successfully added to the cart.
onPostCheckoutError(error) => voidnovalue => valueA callback function to be called when there is an error while adding add-ons to the cart.
onConfirmSelectionSuccess(data) => voidnovalue => valueA callback function to be called when the add-ons selection is successfully confirmed.
onConfirmSelectionError(error) => voidnovalue => valueA callback function to be called when there is an error while confirming the add-ons selection.
onCountdownFinish() => voidnovalue => valueA callback function that is called when the countdown timer finishes.
onPendingVerification() => voidnovalue => valueA callback function to be called when the verification process is passed and pending response.

 

BillingInfoContainer

The component is responsible for managing the billing information during the checkout process. It provides a form that allows users to enter their billing information, including addresses and ticket holders' information.

Component includes also phone field, which validation functionality is provided by Twilio and integrated into the component. It provides an additional layer of verification and security during the ticket purchase process.

Props interface extends Login Modal Interface, Register Modal Interface, Forgot Password Modal Interface.

PropertyTypeRequiredDefault ValueDescription
dataIBillingInfoData[]no[]Form fields list to be rendered to collect billing info data.
ticketHoldersFieldsIBillingInfoData[]no[{ id: 1, fields: [] }]Form fields list to be rendered to collect ticket holders data.
initialValues (deprecated){ key: string: any }no{}Form’s initial values.
theme'light' / 'dark'no'light'MUI Theme Provider’s theme.
isLoggedIn (deprecated)----
onLogin (deprecated)----
brandOptIn (deprecated)----
shouldFetchCountries (deprecated)----
accountInfoTitlestring / JSX.Elementno“”Render some text or JSX component above Login section. Do not available if there is logged in user.
hideLogobooleannofalseHide TicketFairy logo under “Login” button.
themeOptionsMUI ThemeOptionsnoN/AMUI Theme Provider’s theme.
hideErrorsAlertSectionbooleannofalseHide form submit errors rendered by package.
skipPagebooleannofalseEnable skipping Billing Info page.
canSkipHolderNamesbooleannofalseAllows the user to skip entering ticket holders' names.
enableTimerbooleannofalseEnables the countdown timer.
buttonNamestringnofalseThe text to display on the submit button.
showPoweredByImagebooleannofalseDisplays the "Powered by TheTicketFairy" image.
isCountryCodeEditablebooleannotrueAllows the user to edit the country code.
-----
handleSubmit(values, helpers, eventId, response) => voidnovalue => valueA callback function that is called when the form is submitted.
onSubmitError(error) => voidnovalue => valueA callback function that is called when form submission fails.
onGetCartSuccess(data) => voidnovalue => valueA callback function that is called when the cart data is successfully retrieved.
onGetCartError(error) => voidnovalue => valueA callback function that is called when retrieving the cart data fails.
onErrorClose() => voidnovalue => valueA callback function that is called when the error message is closed.
onSkipBillingPage(data) => voidnovalue => valueA callback function that is called when the billing page skips.
onGetCountriesSuccess(data) => voidnovalue => valueA callback function that is called when the list of countries is successfully retrieved.
onGetCountriesError(error) => voidnovalue => valueA callback function that is called when retrieving the list of countries fails.
onGetStatesSuccess(data) => voidnovalue => valueA callback function that is called when the list of states is successfully retrieved.
onGetCountriesError(error) => voidnovalue => valueA callback function that is called when retrieving the list of states fails.
onAuthorizeSuccess(data) => voidnovalue => valueA callback function that is called when authorization is successful.
onAuthorizeError(error) => voidnovalue => valueA callback function that is called when authorization fails.
onCountdownFinish() => voidnovalue => valueA callback function that is called when the countdown timer finishes.
onPendingVerification() => voidnovalue => valueA callback function that is called when the verification process is passed and pending response.

 

PaymentContainer

The component provides a form for users to enter their payment information and checkout. It accepts various props to customize the form and handle the checkout process.

PropertyTypeRequiredDefault ValueDescription
paymentFieldsIPaymentField[]yes[]An array of payment fields to render in the form.
checkoutData{ hash: string, total: number }yesN/AAn object containing checkout data, such as the order total and hash.
formTitlestringno'Get Your Tickets'Text to display above the payment form.
errorTextstringno''Text to display if there is an error during the payment process.
paymentButtonTextstringno'Pay'Text to display on the payment button.
paymentInfoLabelstringno'Order Confirmation'Text to display above the payment information section.
orderInfoLabelstringno'Order Review'Text to display above the order information section.
stripeCardOptionsStripeCardNumberElementOptionsno{}Options for the Stripe card input element.
elementsOptionsStripeElementsOptionsno{}Options for the Stripe Elements instance.
themeOptionsThemeOptionsno{}An object containing theme options for the payment form.
enableTimerbooleannofalseWhether to show a timer for the user.
disableZipSectionbooleannofalseWhether to show the zip code input field.
enablePaymentPlanbooleannotrueWhether to enable payment plans.
-----
handlePayment(data) => voidyesvalue => valueA callback function to handle the payment process.
onPaymentError(error) => voidnovalue => valueA callback function that is called when the payment process fails.
onErrorClose() => voidnovalue => valueA callback function that is called when the error message is closed.
onGetPaymentDataSuccess(data) => voidnovalue => valueA callback function that is called when the payment data is successfully retrieved.
onGetPaymentDataError(error) => voidnovalue => valueA callback function that is called when retrieving the payment data fails.
onCountdownFinish() => voidnovalue => valueA callback function that is called when the countdown timer finishes.

 

ConfirmationContainer

The component is responsible for displaying the confirmation page after a successful payment.

PropertyTypeRequiredDefault ValueDescription
isReferralEnabledbooleanyesfalseWhether referral functionality is enabled.
showDefaultShareButtonsbooleanyesfalseWhether to display default share buttons.
shareButtonsIShareButton[]yes[]Array of objects representing the share buttons.
messengerAppIdstringyesN/AMessenger App ID for Facebook share button.
orderHashstringnoN/AHash value of the order.
clientLabelstringno'Ticket Fairy'Client's name.
confirmationLabelsIConfirmationLabelsno{}Object containing labels for the confirmation page.
hasCopyIconbooleannotrueWhether to display a copy icon beside the referral link.
showReferralsInfoTextbooleannofalseWhether to display referral information text.
showCopyInfoModalbooleannofalseWhether to display a copy info modal after the link is copied.
showPricingNoteSectionbooleannofalseWhether to display the pricing note section.
-----
onGetConfirmationDataSuccess(data) => voidyesvalue => valueA callback function that is called when the confirmation data is successfully retrieved.
onGetConfirmationDataError(error) => voidyesvalue => valueA callback function that is called when retrieving the confirmation data fails.
onLinkCopied() => voidnovalue => valueA callback function that is called when the referral link is copied.

 

MyTicketsContainer

The component is responsible for rendering a list of orders with details and some customization options.

PropertyTypeRequiredDefault ValueDescription
isReferralEnabledbooleanyesfalseWhether referral functionality is enabled.
showDefaultShareButtonsbooleanyesfalseWhether to display default share buttons.
shareButtonsIShareButton[]yes[]Array of objects representing the share buttons.
messengerAppIdstringyesN/AMessenger App ID for Facebook share button.
orderHashstringnoN/AHash value of the order.
clientLabelstringno'Ticket Fairy'Client's name.
confirmationLabelsIConfirmationLabelsno{}Object containing labels for the confirmation page.
hasCopyIconbooleannotrueWhether to display a copy icon beside the referral link.
showReferralsInfoTextbooleannofalseWhether to display referral information text.
showCopyInfoModalbooleannofalseWhether to display a copy info modal after the link is copied.
showPricingNoteSectionbooleannofalseWhether to display the pricing note section.
-----
onGetConfirmationDataSuccess(data) => voidyesvalue => valueA callback function that is called when the confirmation data is successfully retrieved.
onGetConfirmationDataError(error) => voidyesvalue => valueA callback function that is called when retrieving the confirmation data fails.
onLinkCopied() => voidnovalue => valueA callback function that is called when the referral link is copied.

 

Orders Container

Will show the purchased orders for the logged user.
Orders container interface extends Login Modal Interface.

PropertyTypeRequiredDefault ValueDescription
handleDetailsInfoFunction: (id: string) => voidyesvalue => valueCalled on "Order Details" button click.
onGetOrdersSuccessFunction: (data) => voidyesvalue => valueCalled after fetching orders data request’s success.
onGetOrdersErrorFunction: (error) => voidyesvalue => valueCalled after fetching orders data request’s failure.
theme'light' / 'dark'no‘dark'Main container class.

 

Order Details Container

Will show the purchased order details. Contains order PDF download and ticket resale functionalities. Currently both functionalities are enabled by default.

PropertyTypeRequiredDefault ValueDescription
columns { label: string } yes[]Order details table’s columns’ labels.
ticketsTableColumnsITicketsTableColumns[] 3nodefaultTicketsTableColumns3Order’s tickets table’s columns.
displayColumnNameInRowbooleannofalseDisplay column’s names in row, instead of table header.
canSellTicketbooleannotrueA boolean value indicating whether the user can sell tickets.
ordersPathstringnoA string representing the URL of the page to which the "Back to Orders" and "Return to Order History" buttons will redirect the user.
orderIdstring or numbernoA string or number representing the ID of the order to be displayed. If this prop is not provided, the component will try to get the order ID from the query parameters of the URL.
referralTitlestringno""A string representing the title of the referral section.
itemsTitlestringno""A string representing the title of the items section.
ticketsTitlestringno"Your Tickets"A string representing the title of the tickets table section.
personalLinkIconstringno“”Custom icon to display near personal share link.
onGetOrdersSuccessFunction: (data) => voidnovalue => valueCalled after fetching order data request’s success.
onGetOrdersErrorFunction: (error) => voidnovalue => valueCalled after fetching order data request’s failure.
onResaleTicketSuccessFunction: (data) => voidnovalue => valueCalled after resale ticket request’s success.
onResaleTicketErrorFunction: (error) => voidnovalue => valueCalled after resale ticket request’s failure.
onRemoveFromResaleSuccessFunction: (data) => voidnovalue => valueCalled after remove from resale ticket request’s success.
onRemoveFromResaleErrorFunction: (error) => voidnovalue => valueCalled after remove from resale ticket request’s failure.
onReturnButtonClickFunction: () => voidnoN/ACalled on “Return” button click. If not passed, button click will redirect to ‘/orders’.

 

Ticket Resale Container

Container renders information about accepting or declining of resold tickets. It will automatically redirect to home page, if not valid hash is provided in URL.

PropertyTypeRequiredDefault ValueDescription
onProcessTicketSuccessFunction: (data) => voidnovalue => valueCalled after process ticket request’s success.
onGetOrdersErrorFunction: (error) => voidnovalue => valueCalled after process ticket request’s failure.
onDeclineTicketPurchaseSuccessFunction: (data) => voidnovalue => valueCalled after decline ticket request’s success.
onDeclineTicketPurchaseErrorFunction: (error) => voidnovalue => valueCalled after decline ticket request’s failure.

 

IShareButton {
  mainLabel: string;
  subLabel: string;
  platform: string;
  shareData: any;
}
Default share options if `showDefaultShareButtons` is true, are: "Share on Facebook", "Tweet to your Followers", "Message friends on Facebook" and "Message friends on WhatsApp".
IConfirmationLabels {
  confirmationTitle?: string;
  confirmationMain?: string;
  confirmationHelper?: string
}
const defaultConfirmationLabels = {
  confirmationTitle = "Your Tickets are Confirmed!",
  confirmationMain = "Your tickets are available in My Tickets section",
  confirmationHelper = "Please bring them with you to the event"
}
interface ITicketsTableColumns {
  id?: string | number;
  key: keyof ITicketTypes & keyof IActionColumns;
  label: string | number | null | undefined;
}

interface IActionColumns {
  download?: boolean;
  sell_ticket?: boolean;
}
const defaultTicketsTableColumns = [
  { key: 'ticket_type', label: 'Ticket Type' },
  { key: 'holder_name', label: 'Ticket Holder' },
  { key: 'status', label: 'Status' },
  { key: 'download', label: '' },
  { key: 'sell_ticket', label: '' }
]

Commands

TSDX scaffolds your new library inside /src, and also sets up a Parcel-based playground for it inside /example.

The recommended workflow is to run TSDX in one terminal:

npm start # or yarn start

This builds to /dist and runs the project in watch mode so any edits you save inside src causes a rebuild to /dist.

Then run the example inside another:

cd example
npm i # or yarn to install dependencies
npm start # or yarn start

The default example imports and live reloads whatever is in /dist, so if you are seeing an out of date component, make sure TSDX is running in watch mode like we recommend above. No symlinking required, we use Parcel's aliasing.

To do a one-off build, use npm run build or yarn build.

 

Rollup

TSDX uses Rollup as a bundler and generates multiple rollup configs for various module formats and build settings. See Optimizations for details.

 

TypeScript

tsconfig.json is set up to interpret dom and esnext types, as well as react for jsx. Adjust according to your needs.

GitHub Actions

Two actions are added by default:

  • main which installs deps w/ cache, lints, tests, and builds on all pushes against a Node and OS matrix
  • size which comments cost comparison of your library on every pull request using size-limit
1.6.6-beta.3

4 months ago

1.6.6-beta.4

4 months ago

1.6.6-beta.1

4 months ago

1.6.6-beta.2

4 months ago

1.6.4

7 months ago

1.6.3

7 months ago

1.6.6

6 months ago

1.6.5

7 months ago

1.6.4-beta.1

7 months ago

1.6.5-beta.3

7 months ago

1.6.5-beta.4

6 months ago

1.6.5-beta.1

7 months ago

1.6.5-beta.2

7 months ago

1.6.2

11 months ago

1.6.1

11 months ago

1.6.0

11 months ago

1.5.9

11 months ago

1.5.8

11 months ago

1.4.26-beta.2

11 months ago

1.6.2-beta.1

9 months ago

1.6.2-beta.3

8 months ago

1.6.2-beta.2

8 months ago

1.6.2-beta.4

7 months ago

1.5.9-beta.3

11 months ago

1.5.9-beta.2

11 months ago

1.5.9-beta.1

11 months ago

1.5.9-beta.0

11 months ago

1.4.21-beta.3

11 months ago

1.4.21-beta.5

11 months ago

1.6.1-beta.1

11 months ago

1.3.41-beta.3

1 year ago

1.3.41-beta.2

1 year ago

1.3.48-beta.31

1 year ago

1.3.48-beta.30

1 year ago

1.3.41-beta.4

1 year ago

1.3.48-beta.33

1 year ago

1.3.48-beta.32

1 year ago

1.3.48-beta.34

1 year ago

1.3.50

1 year ago

1.3.12-beta.11

1 year ago

1.3.12-beta.12

1 year ago

1.4.20

1 year ago

1.4.22

1 year ago

1.3.51

1 year ago

1.4.21

1 year ago

1.4.24

1 year ago

1.4.23

1 year ago

1.4.26

1 year ago

1.4.25

1 year ago

1.4.1-beta.4

1 year ago

1.4.1-beta.0

1 year ago

1.4.1-beta.2

1 year ago

1.4.1-beta.1

1 year ago

1.5.5

1 year ago

1.5.4

1 year ago

1.5.3

1 year ago

1.5.2

1 year ago

1.5.1

1 year ago

1.5.0

1 year ago

1.4.13-test.0

1 year ago

1.4.11

1 year ago

1.4.10

1 year ago

1.4.13

1 year ago

1.4.12

1 year ago

1.4.15

1 year ago

1.4.14

1 year ago

1.4.17

1 year ago

1.4.16

1 year ago

1.4.19

1 year ago

1.4.18

1 year ago

1.4.6

1 year ago

1.4.5

1 year ago

1.4.4

1 year ago

1.4.3

1 year ago

1.4.2

1 year ago

1.4.1

1 year ago

1.4.0

1 year ago

1.5.5-beta.0

1 year ago

1.4.13-beta.5

1 year ago

1.4.13-beta.4

1 year ago

1.4.13-beta.3

1 year ago

1.4.13-beta.2

1 year ago

1.4.13-beta.8

1 year ago

1.4.13-beta.7

1 year ago

1.4.13-beta.6

1 year ago

1.4.13-beta.1

1 year ago

1.4.13-beta.0

1 year ago

1.5.7

1 year ago

1.5.6

1 year ago

1.4.20-beta.1

1 year ago

1.4.24-beta.1

1 year ago

1.4.24-beta.0

1 year ago

1.4.26-beta.1

1 year ago

1.4.20-beta.2

1 year ago

1.4.24-beta.2

1 year ago

1.4.9

1 year ago

1.4.8

1 year ago

1.4.7

1 year ago

1.4.18-beta.0

1 year ago

1.4.18-beta.1

1 year ago

1.4.10-beta.0

1 year ago

1.4.23-beta.10

1 year ago

1.5.4-beta.0

1 year ago

1.5.4-beta.1

1 year ago

1.4.21-beta.0

1 year ago

1.4.21-beta.2

12 months ago

1.4.21-beta.1

1 year ago

1.3.49-beta.3

1 year ago

1.3.50-beta.1

1 year ago

1.3.50-beta.0

1 year ago

1.3.50-beta.3

1 year ago

1.3.50-beta.2

1 year ago

1.4.8-beta.1

12 months ago

1.4.22-beta.0

1 year ago

1.5.7-beta.1

12 months ago

1.4.15-beta.5

1 year ago

1.4.15-beta.4

1 year ago

1.4.15-beta.7

1 year ago

1.4.15-beta.6

1 year ago

1.4.15-beta.1

1 year ago

1.4.15-beta.3

1 year ago

1.4.15-beta.2

1 year ago

1.3.48-beta.15

1 year ago

1.3.48-beta.14

1 year ago

1.3.48-beta.17

1 year ago

1.3.48-beta.16

1 year ago

1.3.48-beta.19

1 year ago

1.3.48-beta.18

1 year ago

1.5.2-beta.1

1 year ago

1.4.23-beta.0

1 year ago

1.4.23-beta.7

1 year ago

1.4.23-beta.8

1 year ago

1.4.23-beta.5

1 year ago

1.3.48-beta.20

1 year ago

1.4.23-beta.6

1 year ago

1.4.23-beta.3

1 year ago

1.3.48-beta.22

1 year ago

1.4.23-beta.4

1 year ago

1.3.48-beta.21

1 year ago

1.4.23-beta.1

1 year ago

1.3.48-beta.24

1 year ago

1.4.23-beta.2

1 year ago

1.3.48-beta.23

1 year ago

1.3.48-beta.26

1 year ago

1.3.48-beta.25

1 year ago

1.3.48-beta.28

1 year ago

1.3.48-beta.27

1 year ago

1.3.48-beta.29

1 year ago

1.4.23-beta.9

1 year ago

1.3.38-beta.1

1 year ago

1.3.38-beta.3

1 year ago

1.3.38-beta.2

1 year ago

1.3.41-beta.1

1 year ago

1.3.41-beta.0

1 year ago

1.3.12-beta.10

1 year ago

1.3.31

1 year ago

1.3.13-beta.1

1 year ago

1.3.30

1 year ago

1.3.35

1 year ago

1.3.36

1 year ago

1.3.33

1 year ago

1.3.34

1 year ago

1.3.37

1 year ago

1.3.38

1 year ago

1.3.42

1 year ago

1.3.43

1 year ago

1.3.40

1 year ago

1.3.41

1 year ago

1.3.49-beta.1

1 year ago

1.3.46

1 year ago

1.3.44

1 year ago

1.3.45

1 year ago

1.3.49

1 year ago

1.3.49-beta.2

1 year ago

1.3.10

2 years ago

1.3.13

2 years ago

1.3.14

2 years ago

1.3.11

2 years ago

1.3.12

2 years ago

1.3.17

1 year ago

1.3.18

1 year ago

1.3.15

1 year ago

1.3.16

1 year ago

1.3.19

1 year ago

1.3.20

1 year ago

1.3.24

1 year ago

1.3.25

1 year ago

1.3.22

1 year ago

1.3.23

1 year ago

1.3.28

1 year ago

1.3.29

1 year ago

1.3.26

1 year ago

1.3.27

1 year ago

1.3.39-beta.1

1 year ago

1.3.39-beta.2

1 year ago

1.3.39-beta.3

1 year ago

1.3.7

2 years ago

1.3.6

2 years ago

1.3.5

2 years ago

1.3.4

2 years ago

1.3.3

2 years ago

1.3.2

2 years ago

1.3.37-beta

1 year ago

1.3.12-beta.1

2 years ago

1.3.12-beta.3

2 years ago

1.3.12-beta.2

2 years ago

1.3.12-beta.5

1 year ago

1.3.12-beta.4

2 years ago

1.3.12-beta.6

1 year ago

1.3.12-beta.9

1 year ago

1.3.12-beta.8

1 year ago

1.3.9

2 years ago

1.3.8

2 years ago

1.3.48-beta.9

1 year ago

1.3.48-beta.5

1 year ago

1.3.48-beta.6

1 year ago

1.3.48-beta.7

1 year ago

1.3.47-beta.4

1 year ago

1.3.48-beta.8

1 year ago

1.3.48-beta.1

1 year ago

1.3.47-beta.2

1 year ago

1.3.48-beta.2

1 year ago

1.3.47-beta.3

1 year ago

1.3.48-beta.3

1 year ago

1.3.48-beta.4

1 year ago

1.3.47-beta.1

1 year ago

1.3.48-beta.0

1 year ago

1.3.48-beta.11

1 year ago

1.3.49-beat.0

1 year ago

1.3.48-beta.10

1 year ago

1.3.48-beta.13

1 year ago

1.3.48-beta.12

1 year ago

1.2.12

2 years ago

1.2.13

2 years ago

1.2.10

2 years ago

1.2.11

2 years ago

1.2.16

2 years ago

1.2.17

2 years ago

1.2.14

2 years ago

1.2.15

2 years ago

1.2.9

2 years ago

1.2.18

2 years ago

1.2.19

2 years ago

1.3.1

2 years ago

1.3.0

2 years ago

1.2.20

2 years ago

1.2.23

2 years ago

1.2.24

2 years ago

1.2.21

2 years ago

1.2.22

2 years ago

1.2.27

2 years ago

1.2.28

2 years ago

1.2.25

2 years ago

1.2.26

2 years ago

1.2.29

2 years ago

1.2.30

2 years ago

1.2.31

2 years ago

1.2.0

2 years ago

1.2.8

2 years ago

1.2.7

2 years ago

1.2.6

2 years ago

1.2.5

2 years ago

1.2.4

2 years ago

1.2.3

2 years ago

1.2.2

2 years ago

1.2.1

2 years ago

1.0.99-beta.28

2 years ago

1.0.99-beta.29

2 years ago

1.0.99-beta.27

2 years ago

1.0.100-beta.0

2 years ago

1.0.100-beta.2

2 years ago

1.0.100-beta.1

2 years ago

1.0.106-beta.12

2 years ago

1.0.106-beta.13

2 years ago

1.1.0

2 years ago

1.0.106-beta.10

2 years ago

1.0.106-beta.11

2 years ago

1.0.106-beta.16

2 years ago

1.0.106-beta.17

2 years ago

1.0.106-beta.14

2 years ago

1.0.106-beta.15

2 years ago

1.0.106

2 years ago

1.0.106-beta.9

2 years ago

1.0.106-beta.7

2 years ago

1.0.106-beta.8

2 years ago

1.0.106-beta.5

2 years ago

1.0.106-beta.6

2 years ago

1.0.106-beta.3

2 years ago

1.0.106-beta.1

2 years ago

1.0.99-beta.31

2 years ago

1.0.99-beta.32

2 years ago

1.0.99-beta.30

2 years ago

1.0.99-beta.33

2 years ago

1.0.99-beta.34

2 years ago

1.0.99-beta.20

2 years ago

1.0.99-beta.21

2 years ago

1.0.99-beta.24

2 years ago

1.0.99-beta.25

2 years ago

1.0.99-beta.22

2 years ago

1.0.99-beta.23

2 years ago

1.0.99-beta.26

2 years ago

1.0.99-beta.17

2 years ago

1.0.99-beta.18

2 years ago

1.0.99-beta.19

2 years ago

1.0.99-beta.13

2 years ago

1.0.99-beta.14

2 years ago

1.0.99-beta.12

2 years ago

1.0.99-beta.15

2 years ago

1.0.99-beta.16

2 years ago

1.0.97-beta.0

2 years ago

1.0.62

2 years ago

1.0.66

2 years ago

1.0.65

2 years ago

1.0.64

2 years ago

1.0.63

2 years ago

1.0.69

2 years ago

1.0.68

2 years ago

1.0.67

2 years ago

1.0.99-beta.10

2 years ago

1.0.99-beta.11

2 years ago

1.0.73

2 years ago

1.0.72

2 years ago

1.0.71

2 years ago

1.0.70

2 years ago

1.0.77

2 years ago

1.0.76

2 years ago

1.0.75

2 years ago

1.0.74

2 years ago

1.0.79

2 years ago

1.0.78

2 years ago

1.0.96-beta.0

2 years ago

1.0.98-beta.0

2 years ago

1.0.101

2 years ago

1.0.100

2 years ago

1.0.103

2 years ago

1.0.102

2 years ago

1.0.105

2 years ago

1.0.104

2 years ago

1.0.99-beta.3

2 years ago

1.0.99-beta.2

2 years ago

1.0.99-beta.1

2 years ago

1.0.99-beta.0

2 years ago

1.0.99-beta.7

2 years ago

1.0.99-beta.6

2 years ago

1.0.99-beta.5

2 years ago

1.0.99-beta.4

2 years ago

1.0.99-beta.9

2 years ago

1.0.99-beta.8

2 years ago

1.0.80

2 years ago

1.0.84

2 years ago

1.0.83

2 years ago

1.0.82

2 years ago

1.0.81

2 years ago

1.0.88

2 years ago

1.0.87

2 years ago

1.0.86

2 years ago

1.0.85

2 years ago

1.0.89

2 years ago

1.0.91

2 years ago

1.0.90

2 years ago

1.0.95

2 years ago

1.0.94

2 years ago

1.0.93

2 years ago

1.0.92

2 years ago

1.0.99

2 years ago

1.0.98

2 years ago

1.0.97

2 years ago

1.0.96

2 years ago

1.0.61

2 years ago

1.0.60

2 years ago

1.0.59

2 years ago

1.0.58

2 years ago

1.0.57

2 years ago

1.0.56

2 years ago

1.0.55

2 years ago

1.0.54

2 years ago

1.0.53

2 years ago

1.0.52

2 years ago

1.0.51

2 years ago

1.0.50

2 years ago

1.0.49

2 years ago

1.0.48

2 years ago

1.0.47

2 years ago

1.0.46

2 years ago

1.0.45

2 years ago

1.0.44

2 years ago

1.0.43

2 years ago

1.0.42

2 years ago

1.0.41

2 years ago

1.0.40

2 years ago

1.0.39

2 years ago

1.0.38

2 years ago

1.0.37

2 years ago

1.0.36

2 years ago

1.0.30

2 years ago

1.0.29

2 years ago

1.0.28

2 years ago

1.0.25

2 years ago

1.0.24

2 years ago

1.0.21

2 years ago

1.0.20

2 years ago

1.0.19

2 years ago

1.0.18

2 years ago

1.0.17

2 years ago

1.0.16

2 years ago

1.0.15

2 years ago

1.0.14

2 years ago

1.0.13

2 years ago

1.0.12

2 years ago

1.0.11

2 years ago

1.0.10

2 years ago

1.0.9

2 years ago

0.1.0

2 years ago

1.0.8

2 years ago