이수빈

사계절 결과 도출

This diff is collapsed. Click to expand it.
import React from 'react';
import './spring.css?ver=1.4';
import summer from './season/summer.jpg';
const Summer = ( { history } ) =>
{
return (
<div className='summer_class'>
<img src = {summer} width='1300' height='600' alt = "summer"/>
<div id="btn_back">
<button id="back_btn" onClick={ () => {history.push("/")}}>back</button>
</div>
</div>
);
}
export default Summer;
\ No newline at end of file
......
......@@ -42,7 +42,7 @@ const Test2 = ( { history } ) =>
const [score, setPersonal] = useState(""); //퍼스널컬러 결과
const handleAnswerOptionClick = (isCorrect) => {
const handleAnswerOptionClick = (isCorrect) => { //함수3_여쿨, 겨쿨 점수 +1
if (isCorrect) {
setScore_cool_summer(score_c_s + 1);
}
......@@ -60,7 +60,7 @@ const Test2 = ( { history } ) =>
}; //함수1 끝.
const handlePersonalScore_cool = (score_c_s,score_c_w) =>{ //함수3_여쿨, 겨쿨 점수로 결과 구하기
const handlePersonalScore_cool = (score_c_s,score_c_w) =>{ //함수2_여쿨, 겨쿨 점수로 결과 구하기
if(score_c_s>score_c_w){
setPersonal('summer cool');
}
......@@ -70,7 +70,7 @@ const handlePersonalScore_cool = (score_c_s,score_c_w) =>{ //함수3_여쿨, 겨
else{
setPersonal('restart');
}
}; //함수3 끝.
}; //함수2 끝.
return (
<div className='app'>
......@@ -78,8 +78,8 @@ const handlePersonalScore_cool = (score_c_s,score_c_w) =>{ //함수3_여쿨, 겨
<span className='score-section'>
You scored {score} out of {questions_cool.length}
<button onClick={() => handlePersonalScore_cool(score_c_s,score_c_w)}>result</button>
{score === "cool" ? <button onClick={ () => {history.push("/test2")}}>next</button>
: <button onClick={ () => {history.push("/test3")}}>next</button>}
{score === "summer cool" ? <button onClick={ () => {history.push("/summer")}}>next</button>
: <button onClick={ () => {history.push("/winter")}}>next</button>}
</span>
) : (
<>
......
......@@ -43,13 +43,13 @@ const Test3 = ( { history } ) =>
const [score, setPersonal] = useState(""); //퍼스널컬러 결과
const handleAnswerOptionClick = (isCorrect) => { //main 함수 1_웜쿨 검사
const handleAnswerOptionClick = (isCorrect) => { //main 함수 1_봄, 가을 검사
if (isCorrect) {
setScore_warm_spring(score_w_s+1);
}
else{
setScore_warm_autumn(score_w_a+1);
} ///웜,쿨 if문으로 점수 올리기
} ///봄, 가을 if문으로 점수 올리기
const nextQuestion = currentQuestion_w + 1;
if (nextQuestion < questions_warm.length) {
......@@ -61,7 +61,7 @@ const Test3 = ( { history } ) =>
}; //함수1 끝.
const handlePersonalScore_warm = (score_w_s,score_w_a) =>{ //함수3_여쿨, 겨쿨 점수로 결과 구하기
const handlePersonalScore_warm = (score_w_s,score_w_a) =>{ //함수2_봄, 가을 점수로 결과 구하기
if(score_w_s>score_w_a){
setPersonal('spring warm');
}
......@@ -71,7 +71,7 @@ const handlePersonalScore_warm = (score_w_s,score_w_a) =>{ //함수3_여쿨, 겨
else{
setPersonal('restart');
}
}; //함수3 끝.
}; //함수2 끝.
return (
<div className='app'>
......
import React from 'react';
import './spring.css?ver=1.4';
import winter from './season/winter.png';
const Winter = ( { history } ) =>
{
return (
<div className='winter_class'>
<img src = {winter} width='1300' height='600' alt = "winter"/>
<div id="btn_back">
<button id="back_btn" onClick={ () => {history.push("/")}}>back</button>
</div>
</div>
);
}
export default Winter;
\ No newline at end of file
......