Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Chore] 퀴즈 변경된 텍스트 반영과 간단한 리팩토링 #299

Merged
merged 5 commits into from
Jun 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { SellerMypageModifyProfile } from 'pages/Seller/SellerMyPageModifyProfil
import { SellerMypageViewProfile } from 'pages/Seller/SellerMyPageViewProfile';
import { SellerMypage } from 'pages/Seller/SellerMypage';
import { SellerLetterWrite } from 'pages/Seller/SellerLetterWrite';
import { Routes, Route } from 'react-router-dom';
import { Routes, Route, Navigate } from 'react-router-dom';
import { SellerMyPageReview } from 'pages/Seller/SellerMyPageReview';
import { BuyerSignupComplete } from 'pages/Buyer/BuyerSignupComplete';
import { BuyerFindInfo } from 'pages/Buyer/BuyerFindInfo';
Expand Down Expand Up @@ -58,7 +58,7 @@ const Router = () => {
<Route path="/admin" element={<Admin />} />
{/* minder(buyer) */}
<Route path="/share" element={<BuyerHome />} />
<Route path="/" element={<BuyerHome />} />
<Route path="/" element={<Navigate to="/share" />} />
<Route path="/consult" element={<BuyerConsult />} />
<Route path="/open-consult" element={<BuyerOpenConsult />} />
<Route path="/open-consult/:id" element={<BuyerOpenConsultDetail />} />
Expand Down
7 changes: 6 additions & 1 deletion src/components/Seller/SellerVerifyQuiz/IsStopQuizModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,15 @@ import { useNavigate } from 'react-router-dom';
import styled from 'styled-components';
import { Green, Grey4, LightGreen, White } from 'styles/color';
import { Body1, Body3 } from 'styles/font';
//
//
//
interface IsStopQuizModalProps {
setIsStopModalOpen: React.Dispatch<React.SetStateAction<boolean>>;
}

//
//
//
function IsStopQuizModal({ setIsStopModalOpen }: IsStopQuizModalProps) {
const navigate = useNavigate();
return (
Expand Down
6 changes: 6 additions & 0 deletions src/components/Seller/SellerVerifyQuiz/IsSubmitQuizModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,17 @@ import styled from 'styled-components';
import { Green, Grey4, LightGreen, White } from 'styles/color';
import { Body1, Body3 } from 'styles/font';
import { quizAnswerList } from 'utils/constant';
//
//
//
interface IsSubmitQuizModalProps {
setIsSubmitModalOpen: React.Dispatch<React.SetStateAction<boolean>>;
choiceNumberList: number[];
setVerifyStatus: React.Dispatch<React.SetStateAction<string>>;
}
//
//
//
function IsSubmitQuizModal({
setIsSubmitModalOpen,
choiceNumberList,
Expand Down
8 changes: 7 additions & 1 deletion src/components/Seller/SellerVerifyQuiz/VerifyFail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ import { BottomButtonWrapper } from '../Common/BottomButton';
import { useNavigate } from 'react-router-dom';
import { Button } from 'components/Common/Button';
import { Green } from 'styles/color';
//
//
//
function VerifyFail() {
const navigate = useNavigate();
return (
Expand All @@ -31,7 +34,10 @@ function VerifyFail() {
</>
);
}
const VerifyFailSection = styled.div`
//
//
//
const VerifyFailSection = styled.section`
display: flex;
flex-direction: column;
align-items: center;
Expand Down
6 changes: 6 additions & 0 deletions src/components/Seller/SellerVerifyQuiz/VerifyQuizHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,17 @@ import { Heading } from 'styles/font';
import { ProgressBar, ProgressCurrentStatus } from '../Common/ProgressStatus';
import { useNavigate } from 'react-router-dom';
import { ReactComponent as XIcon } from 'assets/icons/icon-x.svg';
//
//
//
interface VerifyQuizHeaderProps {
progress: string;
verifyStatus: string;
setIsStopModalOpen: React.Dispatch<React.SetStateAction<boolean>>;
}
//
//
//
function VerifyQuizHeader({
progress,
verifyStatus,
Expand Down
8 changes: 7 additions & 1 deletion src/components/Seller/SellerVerifyQuiz/VerifySuccess.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ import { BottomButtonWrapper } from '../Common/BottomButton';
import { useNavigate } from 'react-router-dom';
import { Button } from 'components/Common/Button';
import { Green } from 'styles/color';
//
//
//
function VerifySuccess() {
const navigate = useNavigate();
return (
Expand Down Expand Up @@ -32,7 +35,10 @@ function VerifySuccess() {
</>
);
}
const VerifySuccessSection = styled.div`
//
//
//
const VerifySuccessSection = styled.section`
display: flex;
flex-direction: column;
align-items: center;
Expand Down
19 changes: 16 additions & 3 deletions src/pages/Buyer/BuyerOpenConsult.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
import { Header } from 'components/Common/Header';
import { TabA1 } from 'components/Common/TabA1';
import React from 'react';
import { useNavigate } from 'react-router-dom';
import styled from 'styled-components';
import OpenConsultList from 'components/Buyer/BuyerOpenConsult/OpenConsultList';
import HotOpenConsultList from 'components/Buyer/BuyerOpenConsult/HotOpenConsultList';
import { Button } from 'components/Common/Button';
import { Space } from 'components/Common/Space';
function BuyerOpenConsult() {

//
//
//

const BuyerOpenConsult = () => {
kyuhho marked this conversation as resolved.
Show resolved Hide resolved
const navigate = useNavigate();

//
//
//

return (
<Wrapper>
<Header
Expand Down Expand Up @@ -37,7 +46,11 @@ function BuyerOpenConsult() {
</CreateConsultButtonWrapper>
</Wrapper>
);
}
};

//
//
//

const Wrapper = styled.div`
section.hot-consult-list {
Expand Down
29 changes: 23 additions & 6 deletions src/pages/Seller/SellerVerifyQuiz.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,27 +13,44 @@ import { useNavigate } from 'react-router-dom';
import styled from 'styled-components';
import { Green, Grey1, Grey6, LightGreen } from 'styles/color';
import { quizChoiceList, quizList } from 'utils/constant';

//
//
//
export const SellerVerifyQuiz = () => {
// 현재 몇번쨰 문제를 나타내는 상태 (1~5)
const [quizLevel, setQuizLevel] = useState<number>(1);

// 사용자가 문제를 풀며 선택한 답 (리스트), 초기값 : 모두 0
const [choiceNumberList, setChoiceNumberList] = useState<number[]>([
0, 0, 0, 0, 0,
]);

// 모달 오픈 여부에 관한 상태
const [isSubmitModalOpen, setIsSubmitModalOpen] = useState<boolean>(false);
const [isStopModalOpen, setIsStopModalOpen] = useState<boolean>(false);

// 하나의 컴포넌트에 인증 전, 인증 성공, 인증 실패 상태에 따른 뷰 구현을 위한 상태
const [verifyStatus, setVerifyStatus] = useState<string>('인증 전');
const navigate = useNavigate();

useEffect(() => {
const fetchIsPassQuiz = async () => {
const isPassRes: any = await getIsPassQuiz();
// isPassRes
if (!isPassRes?.data) {
alert('접근 권한이 없습니다.');
try {
const res: any = await getIsPassQuiz();
if (res.status === 200) {
if (!res.data) {
alert('접근 권한이 없습니다.');
navigate('/minder/mypage');
}
}
} catch (err) {
alert(err);
navigate('/minder/mypage');
}
};
fetchIsPassQuiz();
}, []);
}, [navigate]);

return (
<>
<VerifyQuizHeader
Expand Down
2 changes: 1 addition & 1 deletion src/utils/constant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export const quizChoiceList = [
'내담자가 도움을 받고자 하지 않더라도 필요한 상담을 이어가야 한다',
],
[
'상담 진행에 필요하다면 자신의 이야기를 길게 늘어나가도 된다',
'이야기가 길어지는 경우 내용을 요약 정리하면서 대화를 이어나간다',
'상담자의 생각, 감정, 행동을 내담자에게 노출시키는 것은 관계형성에 도움이 된다',
'내담자에게 직접적으로 솔루션을 제안해서는 안 된다',
'상담 과정에 저항이 발생하면 상담을 중단해야 한다',
Expand Down
Loading