StudyPlanList.js 1020 Bytes
Newer Older
Choi Ga Young's avatar
Choi Ga Young committed
1
import { useState, useEffect } from 'react';
Kim, Subin's avatar
Kim, Subin committed
2
import { useAuth } from "../utils/context";
Choi Ga Young's avatar
Choi Ga Young committed
3
import { Link } from "react-router-dom";
Kim, Subin's avatar
Kim, Subin committed
4
5
import StudyPlanCard from "./Card/StudyPlanCard";
import subjectApi from '../apis/subject.api';
Choi Ga Young's avatar
Choi Ga Young committed
6
7

const StudyPlanList = () => {
Choi Ga Young's avatar
Choi Ga Young committed
8
9
10
11
12
13
14
15
16
  const { user } = useAuth();
  useEffect(() => {
    getList(user.id);
  }, [])

  async function getList(id) {
    const result = await subjectApi.allSubject(id)
  }

Choi Ga Young's avatar
Choi Ga Young committed
17
18
  return (
    <>
Kim, Subin's avatar
Kim, Subin committed
19
      <StudyPlanCard />
Choi Ga Young's avatar
Choi Ga Young committed
20
      <div className="d-flex justify-content-center mt-3">
Kim, Subin's avatar
Kim, Subin committed
21
22
23
24
25
        <Link className="card text-decoration-none link-dark" to="/subject/edit" style={{ width: "20rem" }}>
          <div className="card-body d-flex flex-column bg-secondary bg-opacity-25">
            <div>
              <i className="bi bi-plus-lg d-flex justify-content-center fs-3"></i>
              <p className="card-text mt-2 text-center">새로운 과목 추가하기</p>
Choi Ga Young's avatar
Choi Ga Young committed
26
27
28
29
30
31
32
33
34
            </div>
          </div>
        </Link>
      </div>
    </>
  )
}

export default StudyPlanList;