You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Hooks.js 3.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. import React, { Component } from 'react';
  2. // var CornerObj = {"ABC":"123"}
  3. var CornerUI = {"ABC":"1234"}
  4. var CornerUI2 = {"ABC":"12345"}
  5. class CornerObj2 extends Component<Props> {
  6. constructor(){
  7. super(...arguments)
  8. clog("hook CornerObj",this,arguments)
  9. }
  10. render() {
  11. // console.log("JDI CO rend SmallVideo",SmallVideo)
  12. // First make sure we are sensitive enough.
  13. // const audioLevel = Math.min(this.props.audioLevel * 1.2, 1);
  14. // const location = "LOCO";
  15. // console.log("jdr CornerObj rend",this,this.corner_data,this.corner_data2)
  16. // Let's now stretch the audio level over the number of dots we have.
  17. // const stretchedAudioLevel = AUDIO_LEVEL_DOTS * audioLevel;
  18. // const audioLevelDots = [];
  19. clog("hook render CornerObj",this,arguments)
  20. clog("hook render CornerObj props",this.props)
  21. // { this.corner_data }
  22. // {window.abc}
  23. return (
  24. <span className="jspan_c">
  25. {this.props.children}
  26. </span>
  27. );
  28. }
  29. }
  30. class CornerObj extends Component<Props> {
  31. constructor(){
  32. super(...arguments)
  33. this._props = $.extend(true,{},this.props)
  34. this._props.className = Object.assign(this._props.className || "" )
  35. this._props.className ? 0 : this._props.className=""
  36. this._props.className = "dev_hook " + this._props.className
  37. // this._props.type ? : = "span"
  38. clog("hook CornerObj",this,arguments)
  39. }
  40. render() {
  41. // type
  42. // console.log("JDI CO rend SmallVideo",SmallVideo)
  43. // First make sure we are sensitive enough.
  44. // const audioLevel = Math.min(this.props.audioLevel * 1.2, 1);
  45. // const location = "LOCO";
  46. // console.log("jdr CornerObj rend",this,this.corner_data,this.corner_data2)
  47. // Let's now stretch the audio level over the number of dots we have.
  48. // const stretchedAudioLevel = AUDIO_LEVEL_DOTS * audioLevel;
  49. // const audioLevelDots = [];
  50. clog("hook render CornerObj",this,arguments)
  51. clog("hook render CornerObj props",this.props)
  52. // { this.corner_data }
  53. // {window.abc}
  54. if (this._props.type == "div"){
  55. return (
  56. <div className={this._props.className}>
  57. {this.props.children}
  58. </div>
  59. );
  60. // } else if (this._props.type == "span"){
  61. } else {
  62. return (
  63. <span className={this._props.className}>
  64. {this.props.children}
  65. </span>
  66. );
  67. }
  68. /*
  69. return (
  70. <{this._props.type} className={this._props.className}>
  71. </{this._props.type}>
  72. );
  73. */
  74. // <span className={this._props.className}>
  75. // </span>
  76. }
  77. // <span {this.props.children}>
  78. // </span>
  79. // {this.props.children}
  80. // {this.props.children}
  81. }
  82. class DevHook extends Component<Props> {
  83. constructor(){
  84. super(...arguments)
  85. this._props = $.extend(true,{},this.props)
  86. this._props.className = Object.assign(this._props.className || "" )
  87. this._props.className ? 0 : this._props.className=""
  88. this._props.className = "dev_hook " + this._props.className
  89. // this._props.type ? : = "span"
  90. // clog("hook CornerObj",this,arguments)
  91. }
  92. render() {
  93. // clog("hook render CornerObj",this,arguments)
  94. // clog("hook render CornerObj props",this.props)
  95. if (this._props.type == "div"){
  96. return (
  97. <div className={this._props.className}>
  98. {this.props.children}
  99. </div>
  100. );
  101. // } else if (this._props.type == "span"){
  102. } else {
  103. return (
  104. <span className={this._props.className}>
  105. {this.props.children}
  106. </span>
  107. );
  108. }
  109. }
  110. }
  111. export {CornerObj,DevHook,CornerUI,CornerUI2};