Commit 617ce4d0 authored by Kim, Subin's avatar Kim, Subin
Browse files

병합 충돌 해결

parent 04f7c521
......@@ -2,22 +2,21 @@ import { useState, useEffect } from 'react';
import { Redirect, useParams } from 'react-router-dom';
import { useAuth } from '../../utils/context.js';
import BtnGroup from "../Buttons/BtnGroup";
import styles from "./form.module.scss";
import subjectApi from '../../apis/subject.api';
import catchErrors from '../../utils/catchErrors.js';
import styles from "./form.module.scss";
const SubjectForm = () => {
const { user } = useAuth();
const { subjectId } = useParams();
const [success, setSuccess] = useState(false)
const [error, setError] = useState("");
const [disabled, setDisabled] = useState(true)
const [subject, setSubject] = useState({
lectureName: "",
prof: "",
classRoom: ""
})
const [disabled, setDisabled] = useState(true)
useEffect(() => {
getInfo(subjectId);
......@@ -39,12 +38,10 @@ const SubjectForm = () => {
function handleChange(e) {
const { name, value } = e.target
setSubject({ ...subject, [name]: value })
}
async function getInfo(id) {
const result = await subjectApi.getSubInfo(id)
console.log('과목수정 result확인', result)
setSubject({
lectureName: result.name,
prof: result.prof,
......@@ -75,14 +72,12 @@ const SubjectForm = () => {
}
}
if (success) {
return <Redirect to="/studyplan" />
}
return (
<>
<div className="position-absolute top-50 start-50 translate-middle" style={{ width: "80%" }}>
<div>
<div className="mb-5 d-flex flex-row">
......@@ -99,10 +94,9 @@ const SubjectForm = () => {
</div>
</div>
<div className="pt-2">
<BtnGroup disabled={disabled} handleSubmit={handleSubmit} />
<BtnGroup text={subjectId} disabled={disabled} handleSubmit={handleSubmit} />
</div>
</div>
</>
)
}
......
import { Link, Redirect } from "react-router-dom";
import { Link } from "react-router-dom";
import { useAuth } from "../../utils/context.js";
import moment from "moment";
import styles from "./menu.module.scss";
const Menu = () => {
const { logout } = useAuth();
return (
<>
<button className="btn btn-crimson shadow-none mt-2" type="button" data-bs-toggle="collapse" data-bs-target="#menuContent" aria-controls="menuContent" aria-expanded="false" aria-label="menu">
......
import { Link } from "react-router-dom";
import StudyPlanCard from "./Card/StudyPlanCard.js";
import StudyPlanCard from "./Card/StudyPlanCard.js";
const StudyPlanList = () => {
return (
<>
<div>
<StudyPlanCard />
</div>
<StudyPlanCard />
<div className="d-flex justify-content-center mt-3">
<Link className="text-decoration-none link-dark" to="/subject/edit" style={{ width: "20rem" }}>
<div className="card">
<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>
</div>
<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>
</div>
</div>
</Link>
......
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