Advertisement
Guest User

Untitled

a guest
Oct 15th, 2019
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. import React from "react";
  2. import "./DetailsQuotasDiv.css";
  3. import QuotasDisplay from "./QuotasDisplay/QuotasDisplay";
  4.  
  5. const detailsQuotasDiv = props => {
  6. let counter = 1;
  7. let oklade = window.Helper.rasclaniObjekatOklada(props.matchData.quotas, 2);
  8. let klase = window.Helper.rasclaniObjekatOklada(props.matchData.quotas, 1);
  9.  
  10. // if sports is equal football and period is second half removes bottom row;
  11. if (props.matchData.sport === "football" && props.oldObj.TrenutniStatusUtakmiceID > 2) {
  12. Object.keys(oklade).forEach(key => {
  13. let okl = oklade[key];
  14. delete okl[2];
  15. oklade[key] = okl;
  16. });
  17. }
  18. let bets = props.betsConfig.map((betConfig, index) => {
  19. if (betConfig.sport !== props.sportConfig) return null;
  20. return (
  21. <QuotasDisplay
  22. betsConfig={props.betsConfig[index]}
  23. matchData={oklade[counter]}
  24. klase={klase[counter++]}
  25. key={`${props.parentKey}${index}`}
  26. parentKey={`${props.parentKey}${index}`}
  27. />
  28. );
  29. });
  30.  
  31. return <div className="DetailsQuotasDiv">{bets}</div>;
  32. };
  33.  
  34. export default detailsQuotasDiv;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement