HomePage.js 4.22 KB
Newer Older
Kim, Subin's avatar
Kim, Subin committed
1
import React, { useState, useEffect, useRef } from 'react';
Kim, Subin's avatar
Kim, Subin committed
2
import Menu from '../Components/Menu';
Kim, Subin's avatar
Kim, Subin committed
3
import Schedule from '../Components/Schedule';
Kim, Subin's avatar
Home    
Kim, Subin committed
4
import styled from 'styled-components';
Kim, Subin's avatar
Kim, Subin committed
5
6
import Tabs from 'react-bootstrap/Tabs';
import Tab from 'react-bootstrap/Tab';
Kim, Subin's avatar
기간    
Kim, Subin committed
7

Kim, Subin's avatar
Kim, Subin committed
8
9
10
11
12
// const Tab = styled.ul`
//     & a, a:hover, a:active {
//         color: black;
//     }
// `
Kim, Subin's avatar
Kim, Subin committed
13
14

function Home() {
Kim, Subin's avatar
Kim, Subin committed
15
16
17
    const [sched1, setSched1] = useState();
    const [sched2, setSched2] = useState();
    const [sched3, setSched3] = useState();
Kim, Subin's avatar
기간    
Kim, Subin committed
18
19

    useEffect(() => {
Kim, Subin's avatar
Kim, Subin committed
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
        const dd = [{
            id: '1',
            calendarId: 'Subject',
            category: 'time',
            start: '2020-11-02T11:00:00',
            end: '2020-11-02T12:00:00',
        }, {
            id: '2',
            calendarId: 'Subject',
            category: 'time',
            start: '2020-11-03T10:00:00',
            end: '2020-11-03T11:00:00',
        }];
        setSched1(dd)
        const dd2 = [{
            id: '3',
            calendarId: 'Subject',
            category: 'time',
            start: '2020-11-03T12:00:00',
            end: '2020-11-03T13:00:00',
        }, {
            id: '4',
            calendarId: 'Subject',
            category: 'time',
            start: '2020-11-04T10:00:00',
            end: '2020-11-04T11:00:00',
        }];
        setSched2(dd2)
        const dd3 = [{
            id: '5',
            calendarId: 'Subject',
            category: 'time',
            start: '2020-11-04T12:00:00',
            end: '2020-11-04T13:00:00',
        }, {
            id: '6',
            calendarId: 'Subject',
            category: 'time',
            start: '2020-11-05T10:00:00',
            end: '2020-11-05T11:00:00',
        }];
        setSched3(dd3)
Kim, Subin's avatar
기간    
Kim, Subin committed
62
63
    }, []);

Kim, Subin's avatar
Kim, Subin committed
64
65
66
    return (
        <div>
            <Menu />
Lee Jin Ju's avatar
Lee Jin Ju committed
67
            <div className="container mt-3">
Lee Jin Ju's avatar
Lee Jin Ju committed
68
69
70
71
72
73
74
75
                <h2>대관 현황</h2>
                <p>
                    <strong>대관 가능 시간</strong>
                    <ul>
                        <li>평일: 9 - 22/ 예약가능 시간 이후 폐쇄</li>
                        <li>주말: 이용 불가</li>
                    </ul>
                </p>
Kim, Subin's avatar
Kim, Subin committed
76
77
78
79
80
81
82
83
84
85
86
87
                <Tabs defaultActiveKey="9-116" id="uncontrolled-tab-example">
                    <Tab eventKey="9-116" title="9-116">
                        <Schedule schedules={sched1} />
                    </Tab>
                    <Tab eventKey="7-234" title="7-234">
                        <Schedule schedules={sched2} />
                    </Tab>
                    <Tab eventKey="25-101" title="25-101">
                        <Schedule schedules={sched3} />
                    </Tab>
                </Tabs>
                {/* <Tab className="nav nav-tabs nav-justified mt-4" id="myTab" role="tablist" style={show ? {} : { display: "none" }}>
Lee Jin Ju's avatar
Lee Jin Ju committed
88
                    <li className="nav-item">
Kim, Subin's avatar
Kim, Subin committed
89
                        <a className="nav-link active" id="7-tab" data-toggle="tab" href="#tab-7" role="tab" aria-controls="7" aria-selected="true"> 7-223 </a>
Lee Jin Ju's avatar
Lee Jin Ju committed
90
                    </li>
Kim, Subin's avatar
Kim, Subin committed
91
92
93
                </Tab>
                <div className="tab-content row justify-content-center" id="myTabContent" style={show ? {} : { display: "none" }}>
                    <div className="tab-pane fade show active col-md-11 col-12" id="tab-7" role="tabpanel" aria-labelledby="7-tab">
Kim, Subin's avatar
Kim, Subin committed
94
95
                        <Schedule day={sendDate} schedules={sched1}/>
                        {console.log(sched1)}
Lee Jin Ju's avatar
Lee Jin Ju committed
96
                    </div>
Kim, Subin's avatar
Kim, Subin committed
97
                </div> */}
Kim, Subin's avatar
Kim, Subin committed
98
99
100
101
102
103
104
105
106
107
                <h3>유의사항</h3>
                <p>
                    <ul>
                        <li>강의실을 대관하는 대표자를 기준으로 최대  6시간까지 대관이 가능합니다.</li>
                        <li>1 대관시 최대 3시간까지 이용이 가능합니다. (1시간 단위로 대관 가능)</li>
                        <li><strong style={{ color: "red" }}>대관 시간 이외 강의실을 이용하다 적발될 경우 한달  강의실 이용이 불가합니다.</strong></li>
                    </ul>
                </p>
                <div className="bg-white">
                    <h6>고려대학교 대관시스템</h6>
Lee Jin Ju's avatar
Lee Jin Ju committed
108
                </div>
Kim, Subin's avatar
Kim, Subin committed
109
110
111
112
113
            </div>
        </div>
    )
}

Lee Jin Ju's avatar
Lee Jin Ju committed
114
export default Home;