Commit 088ded29 authored by Choi Ga Young's avatar Choi Ga Young
Browse files

Merge remote-tracking branch 'origin/kimpen' into rkyoung7

parents fd15d0de 6836290e
...@@ -3,17 +3,17 @@ import styles from "./studyplan.module.scss"; ...@@ -3,17 +3,17 @@ import styles from "./studyplan.module.scss";
const PlanLineList = ({ subjectId, planList = [] }) => { const PlanLineList = ({ subjectId, planList = [] }) => {
return ( return (
<Link to={`/studyplan/${subjectId}`}> <>
{planList.length !== 0 ? planList.map(plan => <div className="d-flex justify-content-between"> {planList.length !== 0 ? planList.map(plan => <div className="d-flex justify-content-between">
<p className={`card-text mb-1 ${styles.text}`}>- {plan.title}</p> <Link to={`/studyplan/${subjectId}`} className={`col-11 card-text text-decoration-none link-dark mb-1 ${styles.text}`}>- {plan.title}</Link>
<input className={`form-check-input shadow-none ${styles.checkBox}`} type="checkbox" /> <div className="col d-flex justify-content-end">
</div>) : <Link className="text-decoration-none link-dark" to={`/studyplan/submit/${subjectId}`}> <input className={`form-check-input shadow-none ${styles.checkBox}`} type="checkbox" onClick={() => console.log("checkbox clicke")} />
<div className="d-flex"> </div>
</div>) : <Link className="d-flex text-decoration-none link-dark" to={`/studyplan/submit/${subjectId}`}>
<i className="bi bi-plus"></i> <i className="bi bi-plus"></i>
<p className="card-text mb-1">새로운 계획 추가하기</p> <p className="card-text mb-1">새로운 계획 추가하기</p>
</div>
</Link>} </Link>}
</Link> </>
) )
} }
......
...@@ -4,20 +4,20 @@ import PlanLineList from "./PlanLineList"; ...@@ -4,20 +4,20 @@ import PlanLineList from "./PlanLineList";
const StudyPlanCard = ({ renList, handleClick }) => { const StudyPlanCard = ({ renList, handleClick }) => {
return ( return (
<div className="card text-decoration-none link-dark mb-3" style={{ width: "20rem" }} > <Link className="card text-decoration-none link-dark mb-3" to={`/studyplan/${renList.id}`} style={{ width: "20rem" }} >
<div className="card-body"> <div className="card-body">
<div className="d-flex"> <div className="d-flex">
<h5 className="card-title col-10 text-nowrap" style={{ overflow: "hidden", textOverflow: "ellipsis" }}>{renList.name}</h5> <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"> <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> <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" onClick={() => handleClick(renList.id)}> <i className="bi bi-trash" onClick={(e) => handleClick(e, renList.id)}>
</i> </i>
</div> </div>
</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> <p className="card-subtitle ms-1 mb-2 text-muted">{renList.prof && renList.room ? renList.prof + ' - ' + renList.room : (renList.prof || renList.room)}</p>
<PlanLineList subjectId={renList.id} planList={renList.planList} /> <PlanLineList subjectId={renList.id} planList={renList.planList} />
</div> </div>
</div> </Link>
) )
} }
......
...@@ -27,7 +27,8 @@ const StudyPlanList = () => { ...@@ -27,7 +27,8 @@ const StudyPlanList = () => {
} }
} }
async function delSubject(subjectId) { async function delSubject(e, subjectId) {
e.preventDefault()
try { try {
setError("") setError("")
await subjectApi.removeSubject(subjectId, user.id) await subjectApi.removeSubject(subjectId, user.id)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment