HomePage.js 2.56 KB
Newer Older
Choi Ga Young's avatar
Choi Ga Young committed
1
import React, { useState } from 'react';
2
import { Row, Col, Modal, Button, Navbar, Nav } from 'react-bootstrap';
Choi Ga Young's avatar
Choi Ga Young committed
3
4
5
6
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
import Chat from '../Components/Chat';
// import styled from 'styled-components';
9

Choi Ga Young's avatar
Choi Ga Young committed
10
11
12
// const List = styled.div`
//   background: #FFFAFA;
// `
13
14
15
const userName = "정연우";


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

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

  return (
27
28
29
30
31
32
33
34
35
36
    <>
      <Navbar bg="dark" variant="dark">
        <Navbar.Brand href="/homepage">YDK Messenger</Navbar.Brand>
        <div className='ml-1 mr-2' style={{ color: 'white' }}>{userName}  환영합니다</div>
        <Nav className="mr-auto">
          <Nav.Link href="/homepage">Home</Nav.Link>
          <Nav.Link href="/profilepage">Profile</Nav.Link>
          <Nav.Link href="/hello">Hello</Nav.Link>
        </Nav>
        {/* <Form inline>
37
38
39
                    <FormControl type="text" placeholder="Search" className="mr-sm-2" />
                    <Button variant="outline-info">Search</Button>
                </Form> */}
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
        <Button variant="light" className="ml-3">Logout</Button>
      </Navbar>
      <Row className="mr-0">
        <Col className="list" md={5}>
          <Tabs defaultActiveKey="closed" id="uncontrolled-tab-example">
            <Tab eventKey="closed" title="내 채팅" onClick={handleChato} >
              <ClosedList />
            </Tab>
            <Tab eventKey="open" title="공개방" >
              <OpenList />
            </Tab>
          </Tabs>
        </Col>
        <Col style={{ padding: "0" }}>
          {chat ? <Chat handleChatc={handleChatc} /> : null}
55

56
57
          <Button variant="primary" onClick={handleShow} style={{ position: "fixed", bottom: "10px", right: "10px" }} >
            생성
Choi Ga Young's avatar
Choi Ga Young committed
58
        </Button>
59

60
61
62
63
64
65
66
67
          <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}>
                생성
Choi Ga Young's avatar
Choi Ga Young committed
68
            </Button>
69
70
71
72
73
            </Modal.Footer>
          </Modal>
        </Col>
      </Row>
    </>
Choi Ga Young's avatar
Choi Ga Young committed
74
  );
75
76
}

Choi Ga Young's avatar
Choi Ga Young committed
77
export default Home;