Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save kgravenreuth/9141a96cf691c8cbceb82327895c50dc to your computer and use it in GitHub Desktop.
Save kgravenreuth/9141a96cf691c8cbceb82327895c50dc to your computer and use it in GitHub Desktop.
Cloudbet Market Helper - Render Market Names in Events
//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