ScheduleForm.js 2.84 KB
Newer Older
Kim, Subin's avatar
Kim, Subin committed
1
import { useState, useEffect } from "react";
Kim, Subin's avatar
Kim, Subin committed
2
import BtnGroup from "../Buttons/BtnGroup.js";
Kim, Subin's avatar
Kim, Subin committed
3
import catchErrors from "../../utils/catchErrors.js";
Kim, Subin's avatar
Kim, Subin committed
4
5
6
import styles from "./form.module.scss";

const ScheduleForm = () => {
Kim, Subin's avatar
Kim, Subin committed
7
8
9
10
11
12
13
14
15
16
17
18
19
20
    const [schedule, setSchedule] = useState({})
    const [error, setError] = useState("")

    useEffect(() => {
    }, [])

    async function handleSubmit(e) {
        e.preventDefault()
        try {
            setError("")
        } catch (error) {
            catchErrors(error, setError)
        }
    } 
Kim, Subin's avatar
Kim, Subin committed
21
22

    return (
Kim, Subin's avatar
Kim, Subin committed
23
        <form className="pt-5" onSubmit={handleSubmit}>
Kim, Subin's avatar
Kim, Subin committed
24
            <input className={`form-control form-control-lg shadow-none px-1 mb-5 ${styles.textInput}`} type="text" placeholder="제목" aria-label="title" autoFocus />
Kim, Subin's avatar
Kim, Subin committed
25
            <div className="d-flex mb-4">
Kim, Subin's avatar
Kim, Subin committed
26
                <label className="col col-form-label align-self-center py-0">시작</label>
Kim, Subin's avatar
Kim, Subin committed
27
                <div className="col-5">
Kim, Subin's avatar
Kim, Subin committed
28
                    <input className={`form-control shadow-none ${styles.dateInput}`} type="date" aria-label="startDate" />
Kim, Subin's avatar
Kim, Subin committed
29
                </div>
Kim, Subin's avatar
Kim, Subin committed
30
                <div className="col-5">
Kim, Subin's avatar
Kim, Subin committed
31
                    <input className={`form-control shadow-none ${styles.dateInput}`} type="time" aria-label="startTime" />
Kim, Subin's avatar
Kim, Subin committed
32
33
34
                </div>
            </div>
            <div className="d-flex mb-3">
Kim, Subin's avatar
Kim, Subin committed
35
                <label className="col col-form-label align-self-center py-0">종료</label>
Kim, Subin's avatar
Kim, Subin committed
36
                <div className="col-5">
Kim, Subin's avatar
Kim, Subin committed
37
                    <input className={`form-control shadow-none ${styles.dateInput}`} type="date" aria-label="endDate" />
Kim, Subin's avatar
Kim, Subin committed
38
                </div>
Kim, Subin's avatar
Kim, Subin committed
39
                <div className="col-5">
Kim, Subin's avatar
Kim, Subin committed
40
                    <input className={`form-control shadow-none ${styles.dateInput}`} type="time" aria-label="endTime" />
Kim, Subin's avatar
Kim, Subin committed
41
42
                </div>
            </div>
Kim, Subin's avatar
Kim, Subin committed
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
            <div className="d-flex justify-content-end form-check mb-4">
                <input className={`form-check-input shadow-none ${styles.checkBox}`} type="checkbox" value="" id="allDay" />
                <label className="form-check-label ms-2" htmlFor="allDay">하루 종일</label>
            </div>
            <div className="d-flex justify-content-between align-items-center mb-4">
                <i className="col bi bi-geo-alt fs-3"></i>
                <div className="col-10">
                    <input className={`form-control shadow-none px-1 ${styles.textInput}`} type="text" placeholder="장소" aria-label="location" />
                </div>
            </div>
            <div className="d-flex justify-content-between mb-5">
                <i className="col bi bi-journal-text fs-3"></i>
                <div className="col-10">
                    <textarea className={`form-control shadow-none ${styles.textArea}`} rows="5"></textarea>
                </div>
Kim, Subin's avatar
Kim, Subin committed
58
59
60
61
62
63
64
            </div>
            <BtnGroup />
        </form>
    )
}

export default ScheduleForm