@codemodity/betting-ui-react
v0.3.11
Published
React component library for the Betting UI of Next Stage Sportsbook.
Readme
Props
tenantRef (optional)
- Type:
string - Description: A reference to the tenant using the sportsbook.
authToken (optional)
- Type:
string - Description: Authentication token for accessing the sportsbook.
language (optional)
- Type:
string - Description: The language code (e.g.,
en,fr) for localizing the sportsbook.
currency (optional)
- Type:
string - Description: The currency code (e.g.,
USD,EUR) for transactions.
themeId (optional)
- Type:
string - Description: The ID of the theme to apply to the sportsbook UI.
onRequireLogin (optional)
- Type:
() => void - Description: Callback function triggered when the sportsbook requires the user to log in.
environment (optional)
- Type:
string - Description: Specifies the environment for the sportsbook (e.g.,
qa,production).
isTestMode (optional)
- Type:
boolean - Description: Enables test mode for the sportsbook.
betslipClassnames (optional)
- Type:
{ trigger?: string; content?: string } - Description: Custom class names for styling the betslip trigger and content.
onLoad (optional)
- Type:
() => void - Description: Callback function triggered when the sportsbook has finished loading.
hideLoading (optional)
- Type:
boolean - Description: If
true, hides the default loading spinner.
loadingSpinnerElement (optional)
- Type:
ReactNode - Description: A custom React element to display as the loading spinner. If omitted, the default spinner will be used (unless
hideLoadingis enabled). When provided, theloadingSpinnerElementwill remain visible until theonLoadcallback is executed.
Usage
import React from 'react'
import { Sportsbook } from './Sportsbook'
const App = () => {
return (
<Sportsbook
tenantRef="exampleTenant"
authToken="yourAuthToken"
language="en"
currency="USD"
themeId="darkTheme"
onRequireLogin={() => console.log('Login required')}
environment="production"
isTestMode={false}
betslipClassnames={{
trigger: 'betslip-trigger',
content: 'betslip-content',
}}
onLoad={() => console.log('Sportsbook loaded')}
hideLoading={false}
loadingSpinnerElement={<div>Loading...</div>}
/>
)
}
export default App