This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //Event.js | |
| import "./styles.css"; | |
| import React from "react"; | |
| import { | |
| MarketType, | |
| getMarket, | |
| } from "@cloudbet/market-helper"; | |
| const sportMarkets = { | |
| soccer: [MarketType.soccer_match_odds], | |
| basketball: [MarketType.basketball_1x2], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { | |
| MarketType, | |
| getMarket | |
| } from "@cloudbet/market-helper"; | |
| const sportMarkets = { | |
| "soccer": [MarketType.soccer_match_odds], | |
| "basketball": [MarketType.basketball_1x2], | |
| "american-football": [MarketType.american_football_quarter_total] | |
| }; | |
| function getMarkets(event, sportKey) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //App.js | |
| {loading ? <Loading /> : competitions.map((c) => ( | |
| <Competition | |
| competition={c} | |
| apiKey={apiKey} | |
| key={c.key} | |
| sportKey={sport} | |
| /> | |
| ))} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //Competition.js | |
| import "./styles.css"; | |
| import React from "react"; | |
| function getCompetition(competition) { | |
| return fetch( | |
| `https://sports-api.cloudbet.com/pub/v2/odds/competitions/${competition}`, | |
| { | |
| headers: { | |
| "X-Api-Key": "", | |
| "cache-control": "max-age=600" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function getCompetition(competition, apiKey) { | |
| return fetch( | |
| `https://sports-api.cloudbet.com/pub/v2/odds/competitions/${competition}`, | |
| { | |
| headers: { | |
| "X-Api-Key": "", | |
| "cache-control": "max-age=600" | |
| } | |
| } | |
| ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //App.js | |
| import "./styles.css"; | |
| import React from "react"; | |
| import { Locale, getSportsName } from "@cloudbet/market-helper"; | |
| function getSport(sport) { | |
| return fetch(`https://sports-api.cloudbet.com/pub/v2/odds/sports/${sport}`, { | |
| headers: { | |
| "X-Api-Key": "", | |
| "cache-control": "max-age=600" | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //App.js | |
| import "./styles.css"; | |
| import React from "react"; | |
| import { Locale, getSportsName } from "@cloudbet/market-helper"; | |
| function getSport(sport, apiKey) { | |
| return fetch(`https://sports-api.cloudbet.com/pub/v2/odds/sports/${sport}`, { | |
| headers: { | |
| "X-Api-Key": "", | |
| "cache-control": "max-age=600" | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function getSport(sportKey) { | |
| return fetch(`https://sports-api.cloudbet.com/pub/v2/odds/sports/${sportKey}`, { | |
| headers: { | |
| "X-Api-Key": "", | |
| "cache-control": "max-age=600" | |
| } | |
| }); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //App.js | |
| import "./styles.css"; | |
| import React from "react"; | |
| import { Locale, getSportsName } from "@cloudbet/market-helper"; | |
| const sports = ["soccer", "basketball", "american-football"]; | |
| export default function App() { | |
| const [sport, setSport] = React.useState(sports[0]); | |
| return ( | |
| <div className="App"> | |
| <div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //App.js | |
| import "./styles.css"; | |
| import React from "react"; | |
| const sports = ["soccer", "basketball", "american-football"]; | |
| export default function App() { | |
| const [apiKey, setApiKey] = React.useState(""); | |
| const [sport, setSport] = React.useState(sports[0]); | |
| return ( | |
| <div className="App"> |