Skip to content

Commit

Permalink
Merge pull request #187 from YAPP-Github/dev
Browse files Browse the repository at this point in the history
Release 0.1.8
  • Loading branch information
Jeong-jeong authored Jul 26, 2022
2 parents 1ab92a5 + 4263cdc commit 396851d
Show file tree
Hide file tree
Showing 13 changed files with 60 additions and 8 deletions.
Binary file added src/assets/img/email-01.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/img/email-02.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/img/email-03.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/img/email-04.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/img/email-05.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/img/email-06.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
35 changes: 35 additions & 0 deletions src/components/base/LoginCheck.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import React, { useEffect } from 'react';
import Cookies from 'js-cookie';
import { Modal } from '@/components/base/index';
import { useToggle } from '@/hooks/common';
import { useLocation, useNavigate } from 'react-router-dom';

const LoginCheck = () => {
const navigate = useNavigate();
const location = useLocation();
const [isErrorModal, onToggleErrorModal] = useToggle();

useEffect(() => {
const token = Cookies.get('AccessToken');
const invalidToken = !token || token === 'undefined';
invalidToken && onToggleErrorModal();
}, [location]);

return (
<>
{isErrorModal && (
<Modal
width={200}
height={140}
bottonName="확인"
title="알림"
text="로그인 후에 설문 진행 가능합니다."
onToggleModal={onToggleErrorModal}
onClick={() => navigate('/')}
/>
)}
</>
);
};

export default LoginCheck;
2 changes: 2 additions & 0 deletions src/components/domain/matching/MatchingTemplete.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ const initMeetingSurvey: MeetingPartnerSurvey = {
mindset: '',
play: '',
universities: '',
payDeadline: '',
};

const initDatingSurvey: DatingPartnerSurvey = {
Expand All @@ -46,6 +47,7 @@ const initDatingSurvey: DatingPartnerSurvey = {
isSmoke: false,
kakaoId: '',
university: '',
payDeadline: '',
};

const MatchingTemplete = ({ meeting, dating, btnName, title, handleStatus }: MatchingTemplateProps) => {
Expand Down
7 changes: 2 additions & 5 deletions src/components/domain/matching/MeetingEndBox.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
import { palette } from '@/lib/styles/palette';
import { schools } from '@/mock/schools';
import styled from 'styled-components';
import KakaoCopyBox from './KakaoCopyBox';
import { conversionDepartment, conversionDomesticArea, conversionMindset, conversionPlay } from '@/utils/converson';
import { conversionDepartment, conversionMindset, conversionPlay } from '@/utils/converson';
import { addComma } from '@/utils/addComma';
import { addCommaTail } from '@/utils/addCommaTail';
import { DatingPartnerSurvey } from '@/types/dating';
import { memo } from 'react';
import { Departments, MeetingPartnerSurvey, MindSet, Play } from '@/types/meeting';
import { MeetingPartnerSurvey } from '@/types/meeting';

function MeetingEndBox({ areas, averageAge, averageHeight, departments, kakaoId, mindset, play, universities }: MeetingPartnerSurvey) {
return (
Expand Down
14 changes: 14 additions & 0 deletions src/components/domain/survey/Template.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import React from 'react';
import { Outlet } from 'react-router-dom';
import LoginCheck from '@/components/base/LoginCheck';

const Template = () => {
return (
<>
<Outlet />
<LoginCheck />
</>
);
};

export default Template;
2 changes: 2 additions & 0 deletions src/components/header/UserHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { Outlet } from 'react-router-dom';
import styled from 'styled-components';
import { HeaderWrapper, Logo } from '../domain/survey/SurveyTemplate';
import MenuBlock from './MenuBlock';
import LoginCheck from '@/components/base/LoginCheck';

const UserHeader = () => {
const [isMenu, onToggleMenu] = useToggle();
Expand All @@ -18,6 +19,7 @@ const UserHeader = () => {
</HeaderLayout>
<MenuBlock isMenu={isMenu} onToggleMenu={onToggleMenu} />
<Outlet />
<LoginCheck />
</>
);
};
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/common/useDateLabel.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function useDateLabel(date: string) {
function useDateLabel(date: string): string {
const parseDate = new Date(date);

const month = parseDate.getMonth() + 1;
Expand Down
6 changes: 4 additions & 2 deletions src/router/Routing.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ import {
import Test from '@/components/base/Test';
import UserHeader from '@/components/header/UserHeader';
import { palette } from '@/lib/styles/palette';
import LoginCheck from '@/components/base/LoginCheck';
import Template from '@/components/domain/survey/Template';

function Routing() {
return (
Expand All @@ -53,7 +55,7 @@ function Routing() {
<Route path={Path.TypeOfMeetingSurvey} element={<TypeOfMeetingSurvey />} />
<Route path={Path.OauthKakao} element={<OauthKakao />} />
<Route path={Path.EndSurvey} element={<EndSurvey />} />
<Route path={'/meeting'} element={<Outlet />}>
<Route path={'/meeting'} element={<Template />}>
<Route path={Path.GenderAverageAgeSurvey} element={<GenderAverageAgeSurvey />} />
<Route path={Path.OurUniversitiesSurvey} element={<OurUniversitiesSurvey />} />
<Route path={Path.OurDepartmentsAverageHeightSurvey} element={<OurDepartmentsAverageHeightSurvey />} />
Expand All @@ -70,7 +72,7 @@ function Routing() {
<Route path={Path.AgreementSurvey} element={<AgreementSurvey />} />
<Route path={Path.KakaoIdSurvey} element={<KakaoIdSurvey />} />
</Route>
<Route path={'/dating'} element={<Outlet />}>
<Route path={'/dating'} element={<Template />}>
<Route path={Path.MyGenderAge} element={<MyGenderAge />} />
<Route path={Path.MyDepartmentCharacter} element={<MyDepartmentCharacter />} />
<Route path={Path.MyMbtiHeight} element={<MyMbtiHeight />} />
Expand Down

0 comments on commit 396851d

Please sign in to comment.