Controller.js 2.7 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
      <div className="row">
        <div
          className="col d-flex justify-content-center"
seoyeon's avatar
seoyeon committed
27
          style={{ backgroundColor: '#C4C4C4', position: 'absolute', bottom: 0, width:'414px' }}
우지원's avatar
우지원 committed
28
29
30
31
32
33
34
35
36
        >
          {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
37
38
              </button>
            </div>
우지원's avatar
우지원 committed
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
          }
          {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
63
            <div className="col d-flex justify-content-center">
우지원's avatar
우지원 committed
64
65
              <button type="button" className="btn" onClick={videoOff}>
                <img src={video_btn} width="45" />
seoyeon's avatar
0705    
seoyeon committed
66
              </button>
우지원's avatar
우지원 committed
67
            </div>}
Kim, Chaerin's avatar
Kim, Chaerin committed
68
        </div>
우지원's avatar
우지원 committed
69
        <ScreenSelect />
Kim, Chaerin's avatar
Kim, Chaerin committed
70
      </div>
우지원's avatar
우지원 committed
71
    </div>
Kim, Chaerin's avatar
Kim, Chaerin committed
72
73
  )
}
Kim, Chaerin's avatar
Kim, Chaerin committed
74

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