index.jsx 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. import styles from './styles.module.scss'
  2. import {useEffect, useRef} from "react";
  3. import {useThemeProvider} from "@contexts/themeContext";
  4. const WSport=({})=>{
  5. const {isMobile}=useThemeProvider();
  6. const initBetby=()=>{
  7. var bt = new window.BTRenderer().initialize({
  8. brand_id: "2424948766365847552",
  9. token: "",
  10. onTokenExpired: function() {},
  11. themeName: "default-table",
  12. lang: "en",
  13. target: document.getElementById('betby'),
  14. betSlipOffsetBottom: 70,
  15. betSlipOffsetRight: 0,
  16. betSlipOffsetTop: 130,
  17. betslipZIndex: 100,
  18. onRouteChange: function() {},
  19. onLogin: function() {},
  20. onRegister: function() {},
  21. onSessionRefresh: function() {},
  22. onBetSlipStateChange: function() {}
  23. })
  24. return bt;
  25. }
  26. useEffect(()=>{
  27. const bt=initBetby();
  28. return ()=>{
  29. if (bt)bt.kill();
  30. }
  31. },[])
  32. return (
  33. <div id="betby" className={`${styles.container} ${isMobile()?styles.container_m:''}`}></div>
  34. )
  35. }
  36. export default WSport;