Commit 287f9033 authored by Jiwon Yoon's avatar Jiwon Yoon
Browse files

질문수정확인, 홈화면 이미지

parent 343e8706
......@@ -19,7 +19,7 @@ export const AEssayForm = ({ element, answerQuestion }: AnswerProps) => {
<div className="flex mt-3 w-full justify-center">
<input
type="text"
className="border w-11/12 h-36 my-3"
className="border w-11/12 h-24 my-3"
id={element._id}
onChange={handleChange}
value={answer}
......
import React, { FormEvent } from "react";
import { useAuth } from "../auth/auth.context";
import SurveyImg from "../icons/surveyimg.png";
import homeImg from "../icons/homeImg.png";
export const Home = () => {
const { user } = useAuth();
......@@ -30,10 +30,10 @@ export const Home = () => {
+
</button>
</div>
<p className="text-center text-xl text-black mt-3">Create now!</p>
<p className="text-center text-xl text-black my-3">Create now!</p>
</div>
<div className="flex justify-center mt-3">
<img src={SurveyImg} className="object-scale-down justify-center" />
<div className="flex mt-5 md:px-48 bg-themeColor">
<img src={homeImg} className="m-3" />
</div>
</div>
);
......
......@@ -77,17 +77,22 @@ export const CreateSurvey = () => {
async function handleSubmit(event: FormEvent) {
event.preventDefault();
try {
const newSurvey: SurveyType = await surveyApi.editSurvey(survey);
console.log(newSurvey);
setSuccess(true);
alert("저장되었습니다");
navigate("/profile");
setError("");
} catch (error) {
catchErrors(error, setError);
} finally {
setLoading(false);
const notEditComplete = isEditing?.find((el) => el.isEditing);
if (notEditComplete) {
alert("아직 수정이 완료되지 않은 질문이 존재합니다.");
} else {
try {
const newSurvey: SurveyType = await surveyApi.editSurvey(survey);
console.log(newSurvey);
setSuccess(true);
alert("저장되었습니다");
navigate("/profile");
setError("");
} catch (error) {
catchErrors(error, setError);
} finally {
setLoading(false);
}
}
}
......
......@@ -79,17 +79,22 @@ export const EditSurvey = () => {
async function handleSubmit(event: FormEvent) {
event.preventDefault();
try {
const newSurvey: SurveyType = await surveyApi.editSurvey(survey);
console.log(newSurvey);
setSuccess(true);
alert("저장되었습니다");
navigate("/profile");
setError("");
} catch (error) {
catchErrors(error, setError);
} finally {
setLoading(false);
const notEditComplete = isEditing?.find((el) => el.isEditing);
if (notEditComplete) {
alert("아직 수정이 완료되지 않은 질문이 존재합니다.");
} else {
try {
const newSurvey: SurveyType = await surveyApi.editSurvey(survey);
console.log(newSurvey);
setSuccess(true);
alert("저장되었습니다");
navigate("/profile");
setError("");
} catch (error) {
catchErrors(error, setError);
} finally {
setLoading(false);
}
}
}
......
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