Controller.js 2.44 KB
Newer Older
Kim, Chaerin's avatar
Kim, Chaerin committed
1
import ScreenSelect from './ScreenSelect'
우지원's avatar
우지원 committed
2
3
import React, { useState } from 'react';

Kim, Chaerin's avatar
Kim, Chaerin committed
4
const Controller = () => {
Kim, Chaerin's avatar
Kim, Chaerin committed
5
6
7
  const [mic, setMic] = useState(true)
  const [speaker, setSpeaker] = useState(true)
  const [video, setVideo] = useState(true)
우지원's avatar
우지원 committed
8
9
10
11
12
13
14
15

  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
16
  return (
Kim, Chaerin's avatar
Kim, Chaerin committed
17
    <div className="container">
우지원's avatar
우지원 committed
18
19
20
      <div className="row">
        <div
          className="col d-flex justify-content-center"
우지원's avatar
0707    
우지원 committed
21
          style={{ backgroundColor: '#C4C4C4', position: 'absolute', bottom: 0, width: '414px' }}
우지원's avatar
우지원 committed
22
        >
우지원's avatar
0707    
우지원 committed
23

우지원's avatar
우지원 committed
24
25
          {mic ? <div className="col d-flex justify-content-center">
            <button type="button" className="btn" onClick={micOn}>
Kim, Chaerin's avatar
Kim, Chaerin committed
26
              <img src="/micoffbtn.png" width="45" height="40" />
우지원's avatar
우지원 committed
27
28
29
30
            </button>
          </div>
            : <div className="col d-flex justify-content-center">
              <button type="button" className="btn" onClick={micOff}>
Kim, Chaerin's avatar
Kim, Chaerin committed
31
                <img src="/micbtn.png" width="45" height="40" />
seoyeon's avatar
0705    
seoyeon committed
32
33
              </button>
            </div>
우지원's avatar
우지원 committed
34
35
36
          }
          {speaker ? <div className="col d-flex justify-content-center">
            <button type="button" className="btn" onClick={speakerOn}>
Kim, Chaerin's avatar
Kim, Chaerin committed
37
              <img src="/speakeroffbtn.png" width="45" />
우지원's avatar
우지원 committed
38
39
40
            </button>
          </div> : <div className="col d-flex justify-content-center">
            <button type="button" className="btn" onClick={speakerOff}>
Kim, Chaerin's avatar
Kim, Chaerin committed
41
              <img src="/speakerbtn.png" width="45" />
우지원's avatar
우지원 committed
42
43
44
45
46
47
48
49
            </button>
          </div>
          }
          {video ? <div className="col d-flex justify-content-center">
            <button
              type="button"
              className="btn"
              data-bs-toggle="modal"
우지원's avatar
0707    
우지원 committed
50
              data-bs-target="#shareModal"
우지원's avatar
우지원 committed
51
52
53
              onClick="location.href='ScreenSelect.js'"
              onClick={videoOn}
            >
Kim, Chaerin's avatar
Kim, Chaerin committed
54
              <img src="/videooffbtn.png" width="45" />
우지원's avatar
우지원 committed
55
56
            </button>
          </div> :
seoyeon's avatar
0705    
seoyeon committed
57
            <div className="col d-flex justify-content-center">
우지원's avatar
우지원 committed
58
              <button type="button" className="btn" onClick={videoOff}>
Kim, Chaerin's avatar
Kim, Chaerin committed
59
                <img src="/videobtn.png" width="45" />
seoyeon's avatar
0705    
seoyeon committed
60
              </button>
우지원's avatar
우지원 committed
61
            </div>}
Kim, Chaerin's avatar
Kim, Chaerin committed
62
        </div>
우지원's avatar
0707    
우지원 committed
63
        <ScreenSelect videoOff={videoOff} />
Kim, Chaerin's avatar
Kim, Chaerin committed
64
      </div>
우지원's avatar
0707    
우지원 committed
65
66


우지원's avatar
우지원 committed
67
    </div>
Kim, Chaerin's avatar
Kim, Chaerin committed
68
69
  )
}
Kim, Chaerin's avatar
Kim, Chaerin committed
70

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