This package contains all widgets for coachlist and coachlist pro. Available Widgets:
- Booking Widget
- ISP Widget
Install the package as a dependency.
npm i coachlist-widgets
Here is a guide to integrate widgets into your application:
Note: Don't forget to import styles: import 'coachlist-widgets/dist/cjs/main.css'
import BookingWidget from "coachlist-widgets"
import 'coachlist-widgets/dist/cjs/main.css'
const YourComponent = () => {
return (
<>
<BookingWidget
onShare={onShare}
baseURL={baseURL}
selectedSport={selectedSport}
handler={handler}
nickname={nickname}
sportsID={sportsID}
onSessionSelectionChange={onSessionSelectionChange}
/>
</>
)
}
export default YourComponent
Prop Types
nickname: string
sportsID?: string
selectedSport?: string
onShare?: (data: any) => void
baseURL: string
onSessionSelectionChange: (data: any) => void
handler?: {
fetchRecord: () => void
}
######################################
import ISPWidget from "coachlist-widgets"
import 'coachlist-widgets/dist/cjs/main.css'
const YourComponent = () => {
return (
<>
<ISPWidget
authToken={authToken}
baseURL={baseURL}
profileId={profileId}
route={{
currentRoute: string
getCurrentRoute: (route: string) => void
}}
viewProfileClickHandler={viewProfileClickHandler}
/>
</>
)
}
export default YourComponent
Prop Typesp
baseURL: string
profileId: string
authToken: string
route: {
currentRoute: string
getCurrentRoute: (route: string) => void
}
viewProfileClickHandler: (url: string) => void