HomePage.js 1.76 KB
Newer Older
Choi Ga Young's avatar
Choi Ga Young committed
1
2
3
4
5
6
import React, { useState } from 'react';
import { Row, Col, Modal, Button } from 'react-bootstrap';
import Tabs from 'react-bootstrap/Tabs';
import Tab from 'react-bootstrap/Tab';
import ClosedList from '../Components/ClosedList';
import OpenList from '../Components/OpenList';
Choi Ga Young's avatar
Choi Ga Young committed
7
8
9
10
11
12
import Chat from '../Components/Chat';
// import styled from 'styled-components';

// const List = styled.div`
//   background: #FFFAFA;
// `
Choi Ga Young's avatar
Choi Ga Young committed
13
14
15

function Home() {
  const [show, setShow] = useState(false);
Choi Ga Young's avatar
Choi Ga Young committed
16
  const [chat, setChat] = useState(false);
Choi Ga Young's avatar
Choi Ga Young committed
17
18
19

  const handleClose = () => setShow(false);
  const handleShow = () => setShow(true);
Choi Ga Young's avatar
Choi Ga Young committed
20
21
22
  const handleChato = () => setChat(true);
  const handleChatc = () => setChat(false);
  // variant="pills"
Choi Ga Young's avatar
Choi Ga Young committed
23
24
25

  return (
    <Row className="mr-0">
Choi Ga Young's avatar
Choi Ga Young committed
26
      <Col className="list" md={5}>
Choi Ga Young's avatar
Choi Ga Young committed
27
        <Tabs defaultActiveKey="closed" id="uncontrolled-tab-example">
Choi Ga Young's avatar
Choi Ga Young committed
28
          <Tab eventKey="closed" title="내 채팅" onClick = {handleChato} >
Choi Ga Young's avatar
Choi Ga Young committed
29
30
31
32
33
34
35
36
            <ClosedList />
          </Tab>
          <Tab eventKey="open" title="공개방" >
            <OpenList />
          </Tab>
        </Tabs>
      </Col>
      <Col style={{ padding: "0" }}>
Choi Ga Young's avatar
Choi Ga Young committed
37
38
        {chat ? <Chat handleChatc={handleChatc} /> : null}

Choi Ga Young's avatar
Choi Ga Young committed
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
        <Button variant="primary" onClick={handleShow} style={{ position: "fixed", bottom: "10px", right: "10px" }} >
          생성
        </Button>

        <Modal show={show} onHide={handleClose}>
          <Modal.Header closeButton>
            <Modal.Title> 생성</Modal.Title>
          </Modal.Header>
          <Modal.Body>여기에 form 입력</Modal.Body>
          <Modal.Footer>
            <Button variant="primary" onClick={handleClose}>
              생성
            </Button>
          </Modal.Footer>
        </Modal>
      </Col>
    </Row>
  );
}

export default Home;