Controller.js 2.69 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
  const [mic, setMic] = useState("true")
  const [speaker, setSpeaker] = useState("true")
우지원's avatar
0707    
우지원 committed
13
  const [video, setVideo] = useState("true")
우지원's avatar
우지원 committed
14
15
16
17
18
19
20
21

  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"
우지원's avatar
0707    
우지원 committed
27
          style={{ backgroundColor: '#C4C4C4', position: 'absolute', bottom: 0, width: '414px' }}
우지원's avatar
우지원 committed
28
        >
우지원's avatar
0707    
우지원 committed
29

우지원's avatar
우지원 committed
30
31
32
33
34
35
36
37
          {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
38
39
              </button>
            </div>
우지원's avatar
우지원 committed
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
          }
          {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"
우지원's avatar
0707    
우지원 committed
56
              data-bs-target="#shareModal"
우지원's avatar
우지원 committed
57
58
59
60
61
62
              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
0707    
우지원 committed
69
        <ScreenSelect videoOff={videoOff} />
Kim, Chaerin's avatar
Kim, Chaerin committed
70
      </div>
우지원's avatar
0707    
우지원 committed
71
72


우지원's avatar
우지원 committed
73
    </div>
Kim, Chaerin's avatar
Kim, Chaerin committed
74
75
  )
}
Kim, Chaerin's avatar
Kim, Chaerin committed
76

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