This file contains 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 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 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 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 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 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 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 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 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 | |
{expanded && ( | |
<div> | |
{loading ? ( | |
<Loading /> | |
) : ( | |
events.map((e) => ( | |
<Event event={e} key={e.id} sportKey={sportKey} /> | |
)) | |
)} |
This file contains 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 | |
const sportMarkets = { | |
'soccer': [MarketType.soccer_match_odds, MarketType.soccer_asian_handicap], | |
'basketball': [MarketType.basketball_1x2], | |
'american-football': [MarketType.american_football_quarter_total] | |
}; |