Skip to content

Commit

Permalink
Merge pull request #210 from YAPP-Github/dev
Browse files Browse the repository at this point in the history
Release 0.1.16
  • Loading branch information
Jeong-jeong authored Jul 30, 2022
2 parents 5894fe6 + 32053a6 commit 0874044
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 5 deletions.
1 change: 1 addition & 0 deletions src/components/base/Modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ const ModalInner = styled.div<IModalInnerProps>`
height: ${({ height }) => height}px;
border-radius: 4px;
animation: ${({ isClose }) => (isClose ? transitions.popOut : transitions.popIn)} 0.2s ease-in-out;
word-break: keep-all;
`;

const ModalTitle = styled.h2`
Expand Down
2 changes: 1 addition & 1 deletion src/components/domain/matching/WaitingBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ function WaitingBox() {
<StringEle>
매칭은 <strong>매일밤 10시</strong>에 이루어집니다.
<br />
매칭이 되면 카톡과 이메일로 링크를 보내드릴게요.
매칭이 되면 이메일로 링크를 보내드릴게요.
</StringEle>
</>
);
Expand Down
28 changes: 26 additions & 2 deletions src/components/domain/matching/buttons/EndButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useToggle } from '@/hooks/common';
import { postReMatchMeetingSurvey } from '@/lib/api/meeting';
import { postReMatchDatingSurvey } from '@/lib/api/dating';
import { useLocation } from 'react-router-dom';
import React, { useState } from 'react';
import React, { useEffect, useState } from 'react';
import { Status } from '@/pages/MatchingPage';

interface EndButtonProps {
Expand All @@ -12,12 +12,18 @@ interface EndButtonProps {

function EndButton({ handleStatus }: EndButtonProps) {
const location = useLocation();
const [isModal, onToggleModal] = useToggle();
const [isErrorModal, onToggleErrorModal] = useToggle();
const [errorMessage, setErrorMessage] = useState('에러가 발생했습니다😭 다시한번 시도해 주세요!');
const [isConfirm, setConfirm] = useState(false);

const handleClick = async () => {
const matchMeeting = location.pathname.includes('meeting');
onToggleModal();
};

const handleRematch = async () => {
try {
const matchMeeting = location.pathname.includes('meeting');
matchMeeting ? await postReMatchMeetingSurvey() : await postReMatchDatingSurvey();
handleStatus('waiting');
} catch (e) {
Expand All @@ -26,11 +32,29 @@ function EndButton({ handleStatus }: EndButtonProps) {
onToggleErrorModal();
}
};

useEffect(() => {
if (isConfirm) {
handleRematch();
}
}, [isConfirm]);

return (
<>
<Button onClick={handleClick} size="medium">
다시 매칭하기
</Button>
{isModal && (
<Modal
width={200}
height={140}
bottonName="확인"
title="다시 매칭하시겠습니까?"
text=" 이전 설문 내용을 토대로  다시 매칭해드립니다"
onToggleModal={onToggleModal}
onClick={() => setConfirm(true)}
/>
)}
{isErrorModal && (
<Modal
width={200}
Expand Down
5 changes: 4 additions & 1 deletion src/components/domain/matching/buttons/NoneButton.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import { Button } from '@/components/base';
import React from 'react';
import Path from '@/router/Path';
import { useNavigate } from 'react-router-dom';

function NoneButton() {
const navigate = useNavigate();
const handleClick = () => {
console.log('asd');
navigate(Path.TypeOfMeetingSurvey);
};
return (
<Button onClick={handleClick} size="medium" variant={'default'}>
Expand Down
2 changes: 1 addition & 1 deletion src/components/domain/survey/SurveyTemplate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export const Logo = styled(Link)`
`;

const ContentsWrapper = styled.div`
overflow: scroll;
overflow: auto;
height: calc(100% - 56px - 117px - 38px - 20px);
`;

Expand Down

0 comments on commit 0874044

Please sign in to comment.