Created
January 5, 2022 06:22
-
-
Save kgravenreuth/9141a96cf691c8cbceb82327895c50dc to your computer and use it in GitHub Desktop.
Cloudbet Market Helper - Render Market Names in Events
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 | |
return ( | |
<div> | |
<div className="event-title">{event.name}</div> | |
{eventMarkets.map((market) => { | |
if (!market.lines.length) { | |
return null; | |
} | |
const lines = market.lines.map(line => ( | |
<div className="selections"> | |
{line.map((outcome) => ( | |
<div className="selection"> | |
{outcome.name} <br /> | |
{outcome.back.price} | |
</div> | |
))} | |
</div> | |
)); | |
return ( | |
<> | |
{market.name}<br/> | |
{lines} | |
</> | |
) | |
})} | |
</div> | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment