StudyPlanCard.js 2.2 KB
Newer Older
Choi Ga Young's avatar
Choi Ga Young committed
1
import { Link } from "react-router-dom";
Kim, Subin's avatar
Kim, Subin committed
2
import styles from "../Form/form.module.scss";
Choi Ga Young's avatar
Choi Ga Young committed
3

Choi Ga Young's avatar
Choi Ga Young committed
4
5
const StudyPlanCard = ({ renList }) => {
  console.log('props 확인', renList)
Choi Ga Young's avatar
Choi Ga Young committed
6
  return (
Choi Ga Young's avatar
Choi Ga Young committed
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
    <div className="d-flex justify-content-center mt-3">
      <Link className="card text-decoration-none link-dark" style={{ width: "20rem" }} to={`/studyplan/${renList.id}`}>
        <div className="card-body">
          <div className="d-flex">
            <h5 className="card-title col-10 text-nowrap" style={{ overflow: "hidden", textOverflow: "ellipsis" }}>{renList.name}</h5>
            <div className="col-2 d-flex justify-content-end">
              <Link className="text-decoration-none link-dark" to={`/subject/edit/${renList.id}`}><i className="bi bi-pencil-square pe-2"></i></Link>
              <i className="bi bi-trash"></i>
            </div>
          </div>
          <p className="card-subtitle ms-1 mb-2 text-muted">{renList.prof && renList.room ? renList.prof + '-' + renList.room : (renList.prof || renList.room)}</p>
          {renList.planList.length !== 0 ?
            renList.planList.map((info, idx) => <><div key={idx} className="d-flex justify-content-between">
              <p className="card-text mb-1">- {info.title}</p>
              <input className={`form-check-input shadow-none ${styles.checkBox}`} type="checkbox" />
            </div><div key={idx} className="d-flex justify-content-between">
                <p className="card-text mb-1">- {info.title}</p>
Choi Ga Young's avatar
Choi Ga Young committed
24
                <input className={`form-check-input shadow-none ${styles.checkBox}`} type="checkbox" />
Choi Ga Young's avatar
Choi Ga Young committed
25
26
              </div> <div key={idx} className="d-flex justify-content-between">
                <p className="card-text mb-1">- {info.title}</p>
Choi Ga Young's avatar
Choi Ga Young committed
27
                <input className={`form-check-input shadow-none ${styles.checkBox}`} type="checkbox" />
Choi Ga Young's avatar
Choi Ga Young committed
28
29
30
              </div></>)

            : <Link className="text-decoration-none link-dark" to={`/studyplan/edit/add/${renList.id}`}>
Choi Ga Young's avatar
Choi Ga Young committed
31
              <div className="d-flex">
Kim, Subin's avatar
Kim, Subin committed
32
                <i className="bi bi-plus"></i>
Choi Ga Young's avatar
Choi Ga Young committed
33
34
                <p className="card-text mb-1">새로운 계획 추가하기</p>
              </div>
Choi Ga Young's avatar
Choi Ga Young committed
35
            </Link>}
Choi Ga Young's avatar
Choi Ga Young committed
36
        </div>
Choi Ga Young's avatar
Choi Ga Young committed
37
38
      </Link>
    </div>
Choi Ga Young's avatar
Choi Ga Young committed
39
40
41
  )
}

Choi Ga Young's avatar
Choi Ga Young committed
42
export default StudyPlanCard;