Controller.js 2.9 KB
Newer Older
Kim, Chaerin's avatar
Kim, Chaerin committed
1
2
3
4
import ScreenSelect from './ScreenSelect'
import video_btn from '../../videobtn.png'
import speaker_btn from '../../speakerbtn.png'
import mic_btn from '../../micbtn.png'
seoyeon's avatar
0705    
seoyeon committed
5
6
7
import videooff_btn from '../../videooffbtn.png'
import speakeroff_btn from '../../speakeroffbtn.png'
import micoff_btn from '../../micoffbtn.png'
우지원's avatar
우지원 committed
8
9
import React, { useState } from 'react';

Kim, Chaerin's avatar
Kim, Chaerin committed
10
const Controller = () => {
우지원's avatar
우지원 committed
11
12
13
14
15
16
17
18
19
20
21
  const [mic, setMic] = useState("true")
  const [video, setVideo] = useState("true")
  const [speaker, setSpeaker] = useState("true")

  const micOn = (() => setMic(false));
  const micOff = (() => setMic(true));
  const speakerOn = (() => setSpeaker(false));
  const speakerOff = (() => setSpeaker(true));
  const videoOn = (() => setVideo(false));
  const videoOff = (() => setVideo(true));

Kim, Chaerin's avatar
Kim, Chaerin committed
22
  return (
Kim, Chaerin's avatar
Kim, Chaerin committed
23
    <div className="container">
우지원's avatar
우지원 committed
24
25
26
27
28
29
      <div className="row">
        <div
          className="col d-flex justify-content-center"
          style={{ backgroundColor: '#C4C4C4', position: 'absolute', bottom: 0 }}
        >
          {/* <div className="col d-flex justify-content-center"> 
Kim, Chaerin's avatar
Kim, Chaerin committed
30
31
32
            <button type="button" className="btn">
              <img src={mic_btn} width="45" height="40" />
            </button>
seoyeon's avatar
0705    
seoyeon committed
33
          </div> */}
우지원's avatar
우지원 committed
34
35
36
37
38
39
40
41
          {mic ? <div className="col d-flex justify-content-center">
            <button type="button" className="btn" onClick={micOn}>
              <img src={micoff_btn} width="45" height="40" />
            </button>
          </div>
            : <div className="col d-flex justify-content-center">
              <button type="button" className="btn" onClick={micOff}>
                <img src={mic_btn} width="45" height="40" />
seoyeon's avatar
0705    
seoyeon committed
42
43
              </button>
            </div>
우지원's avatar
우지원 committed
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
          }
          {speaker ? <div className="col d-flex justify-content-center">
            <button type="button" className="btn" onClick={speakerOn}>
              <img src={speakeroff_btn} width="45" />
            </button>
          </div> : <div className="col d-flex justify-content-center">
            <button type="button" className="btn" onClick={speakerOff}>
              <img src={speaker_btn} width="45" />
            </button>
          </div>
          }
          {video ? <div className="col d-flex justify-content-center">
            <button
              type="button"
              className="btn"
              data-bs-toggle="modal"
              data-bs-target="#exampleModal"
              src={video_btn}
              onClick="location.href='ScreenSelect.js'"
              onClick={videoOn}
            >
              <img src={videooff_btn} width="45" />
            </button>
          </div> :
seoyeon's avatar
0705    
seoyeon committed
68
            <div className="col d-flex justify-content-center">
우지원's avatar
우지원 committed
69
70
              <button type="button" className="btn" onClick={videoOff}>
                <img src={video_btn} width="45" />
seoyeon's avatar
0705    
seoyeon committed
71
              </button>
우지원's avatar
우지원 committed
72
            </div>}
Kim, Chaerin's avatar
Kim, Chaerin committed
73
        </div>
우지원's avatar
우지원 committed
74
        <ScreenSelect />
Kim, Chaerin's avatar
Kim, Chaerin committed
75
      </div>
우지원's avatar
우지원 committed
76
    </div>
Kim, Chaerin's avatar
Kim, Chaerin committed
77
78
  )
}
Kim, Chaerin's avatar
Kim, Chaerin committed
79

Kim, Chaerin's avatar
Kim, Chaerin committed
80
export default Controller