Skip to content

Commit

Permalink
Merge branch 'fix/hojin' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
banhogu committed Jun 12, 2024
2 parents 4ee4257 + 8c06c91 commit 1f9c70c
Show file tree
Hide file tree
Showing 19 changed files with 74 additions and 62 deletions.
15 changes: 7 additions & 8 deletions src/components/home/MainHeader.tsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
'use client';
import Link from 'next/link';
import { useRouter } from 'next/router';
import React from 'react';

const MainHeader = () => {
const router = useRouter();
return (
<header>
<div className="flex justify-between items-center py-2">
<div className="w-[116px] h-8">
<div className="w-[116px] h-8 cursor-pointer">
<img src="/officelogowhite.svg" alt="" className="w-full" />
</div>
<div className="flex justify-center items-center gap-6">
<div>
<div onClick={() => router.push('mypage/question')}>
<img src="/home/Inquiry_white.svg" alt="" />
</div>
<Link href={'/notification'}>
<div>
<img src="/home/Notification_white.svg" alt="" />
</div>
</Link>
<div onClick={() => router.push('/notification')}>
<img src="/home/Notification_white.svg" alt="" />
</div>
</div>
</div>
</header>
Expand Down
21 changes: 11 additions & 10 deletions src/components/home/OfficeInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,17 @@ const OfficeInfo = () => {

return (
<div>
{data.length == 0 ? <OfficeInfoNone /> : null}
{data.map((room: todayListData, i: number) => {
if (room.spaceType == 'FOCUSDESK') {
return <OfficeInfoFocus data={room} key={i} />;
} else if (room.spaceType == 'MEETINGROOM') {
return <OfficeInfoMeeting data={room} key={i} />;
} else {
return <OfficeInfoRecharging data={room} key={i} />;
}
})}
{data && data.length == 0 ? <OfficeInfoNone /> : null}
{data &&
data.map((room: todayListData, i: number) => {
if (room.spaceType == 'FOCUSDESK') {
return <OfficeInfoFocus data={room} key={i} />;
} else if (room.spaceType == 'MEETINGROOM') {
return <OfficeInfoMeeting data={room} key={i} />;
} else {
return <OfficeInfoRecharging data={room} key={i} />;
}
})}
</div>
);
};
Expand Down
2 changes: 1 addition & 1 deletion src/components/layout/header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const Header = () => {
<img src="/officelogo.svg" alt="" />
</div>
<div className="flex items-center justify-center gap-6">
<div className="cursor-pointer">
<div onClick={() => router.push('mypage/question')} className="cursor-pointer">
<img src="/Inquiry.svg" alt="" />
</div>
<Link href={'/notification'}>
Expand Down
1 change: 1 addition & 0 deletions src/components/reservation/model/myreservation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export interface reservationDetailData {
participants: participantsType[];
myMemberType: string;
reservationProgress: string;
reservationStatus: string;
}

export interface Representative {
Expand Down
26 changes: 13 additions & 13 deletions src/components/sign/backarrow/BackArrow.tsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
import Link from 'next/link';
import { useRouter } from 'next/router';

interface BackArrowProps {
width: string;
height: string;
name?: string;
link: string;
}
export const BackArrow = ({ width, height, name, link }: BackArrowProps) => {
export const BackArrow = ({ width, height, name }: BackArrowProps) => {
const router = useRouter();
return (
<div className="h-[48px] flex flex-row justify-start items-center">
<Link href={`/${link}`}>
<img
src="/mypage/passwordchange/BackArrow.svg"
alt="Back"
className="cursor-pointer"
width={width}
height={height}
/>
</Link>
<div
onClick={() => router.back()}
className="h-[48px] flex flex-row justify-start items-center">
<img
src="/mypage/passwordchange/BackArrow.svg"
alt="Back"
className="cursor-pointer"
width={width}
height={height}
/>
<div className="ml-3 text-center text-black text-lg font-bold font-['Pretendard'] ">
{name}
</div>
Expand Down
4 changes: 0 additions & 4 deletions src/components/sign/signup/EmailVerification.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,6 @@ const EmailVerification = ({ onNext }: EmailVerification) => {
}
}, [emailValid]);

useEffect(() => {
startRef.current?.focus();
}, []);

useEffect(() => {
let timeoutId: NodeJS.Timeout;
if (errorMessage != '') {
Expand Down
17 changes: 16 additions & 1 deletion src/components/sign/signup/PasswordVerification.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import Terms from './Terms';
import { JobPositionType } from '@/models/jobPosition';
import { jobPosition } from '@/constant/jobPosition';
import ToBack from '@/components/shared/sign/ToBack';
import { TermsType } from '@/models/terms';
import { 약관목록 } from '@constant/temrs';
/* eslint-disable no-unused-vars */
const JobPosition = dynamic(() => import('./JobPosition'), {
ssr: false
Expand Down Expand Up @@ -33,6 +35,10 @@ const PasswordVerification = ({ onNext, applyValues }: PasswordVerificationProps

const [isAllDataValid, setIsAllDataValid] = useState(false); // 모두동의 job선택됨 비밀번호 통과

const [termsAgreements, setTermsAgreements] = useState(() =>
setInitialValues(약관목록)
);

useEffect(() => {
if (isAllAgreeChecked && selectedJob != '' && !passwordError && password != '') {
setIsAllDataValid(true);
Expand Down Expand Up @@ -240,7 +246,12 @@ const PasswordVerification = ({ onNext, applyValues }: PasswordVerificationProps
/>
</div>
</div>
<Terms setIsSmsAgree={setIsSmsAgree} setIsAllAgreeChecked={setIsAllAgreeChecked} />
<Terms
setIsSmsAgree={setIsSmsAgree}
setIsAllAgreeChecked={setIsAllAgreeChecked}
termsAgreements={termsAgreements}
setTermsAgreements={setTermsAgreements}
/>
<div className="w-full flex justify-center items-center mx-auto mb-6">
<button
disabled={!isAllDataValid}
Expand All @@ -256,4 +267,8 @@ const PasswordVerification = ({ onNext, applyValues }: PasswordVerificationProps
);
};

function setInitialValues(terms: TermsType[]) {
return terms.map((term) => ({ ...term, checked: false }));
}

export default PasswordVerification;
5 changes: 0 additions & 5 deletions src/components/sign/signup/PhoneCertification.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,6 @@ const PhoneCertification = ({ onNext }: PhoneCertificationProps) => {
setValidNumber(regex);
};

useEffect(() => {
startRef.current?.focus();
}, []);

useEffect(() => {
if (phoneNumber.length === 13) {
setBtnStatus('SECOND');
Expand Down Expand Up @@ -135,7 +131,6 @@ const PhoneCertification = ({ onNext }: PhoneCertificationProps) => {
const select = signError.find((item) => item.errorCode === errorCode);
if (select) {
setErrorMessage(select.message);

setValidNumber('');
inputRef.current?.focus();
return;
Expand Down
19 changes: 10 additions & 9 deletions src/components/sign/signup/Terms.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React, { Dispatch, MouseEvent, useEffect, useState } from 'react';
import TermsTitle from './terms/TermsTitle';
import { 약관목록 } from '@constant/temrs';
import { TermsType } from '@/models/terms';
import TermsItem from './terms/TermsItem';
import dynamic from 'next/dynamic';
Expand All @@ -12,16 +11,22 @@ const TermsModal = dynamic(() => import('./terms/TermsModal'), {
interface TermsProps {
setIsSmsAgree: Dispatch<React.SetStateAction<boolean>>;
setIsAllAgreeChecked: Dispatch<React.SetStateAction<boolean>>;
termsAgreements: TermsType[];
setTermsAgreements: Dispatch<React.SetStateAction<TermsType[]>>;
}

const Terms = ({ setIsSmsAgree, setIsAllAgreeChecked }: TermsProps) => {
const [termsAgreements, setTermsAgreements] = useState(() =>
setInitialValues(약관목록)
);
const Terms = ({
setIsSmsAgree,
setIsAllAgreeChecked,
termsAgreements,
setTermsAgreements
}: TermsProps) => {
const [openModal, setOpenModal] = useState(false);
const [modalDescription, setModalDescription] = useState<string | null>(null);
const [modalSubTitle, setModalSubTitle] = useState<string | null>(null);

console.log(termsAgreements);

useEffect(() => {
const isAllRequireChecked = termsAgreements
.filter((term) => term.required)
Expand Down Expand Up @@ -89,8 +94,4 @@ const Terms = ({ setIsSmsAgree, setIsAllAgreeChecked }: TermsProps) => {
);
};

function setInitialValues(terms: TermsType[]) {
return terms.map((term) => ({ ...term, checked: false }));
}

export default Terms;
9 changes: 6 additions & 3 deletions src/constant/temrs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ export const 약관목록 = [
4) "멤버"는 "Offispace"에서 제공하는 "웹사이트 등" 에 게시된 이 약관에 따라 가입한 하나의 계정으로 모든 "웹사이트 등"에 로그인하여 이용할 수 있습니다.
#### 상기 본인은 위와 같이 서비스 이용약관에 동의함.`,
required: true
required: true,
checked: false
},
{
id: 2,
Expand All @@ -48,7 +49,8 @@ Offispace는 「개인정보보호법」 및 관계 법령에 의거하여 고
- 직무 정보
#### 상기 본인은 위와 같이 개인정보 수집 및 활용에 동의함.`,
required: true
required: true,
checked: false
},
{
id: 3,
Expand Down Expand Up @@ -78,6 +80,7 @@ Offispace는 개인정보보호법 및 정보통신망이용촉진 및 정보보
Offispace 정보수정 페이지에서 개별서비스의 마케팅 수신동의를 변경(동의/철회)할 수 있으며, 동의일로부터 회원 탈퇴 혹은 마케팅 수신 동의 해제 시까지 광고성 정보 전달을 위하여 보유ㆍ이용됩니다.
#### 상기 본인은 위와 같이 마케팅 정보 수신에 동의함.`,
required: false
required: false,
checked: false
}
];
1 change: 1 addition & 0 deletions src/models/terms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ export interface TermsType {
description: string;
required: boolean;
subTitle: string;
checked: boolean;
}
2 changes: 1 addition & 1 deletion src/pages/mypage/changepassword/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export default function PasswordChange() {
/>
</Link> */}

<BackArrow width="40px" height="24px" link="/mypage/changeprofile" />
<BackArrow width="40px" height="24px" />
<h2 className=" mt-[23px] text-2xl font-bold ">새로 사용할 </h2>
<h2 className="text-2xl font-bold mb-[62px]"> 비밀번호를 설정해주세요. </h2>

Expand Down
2 changes: 1 addition & 1 deletion src/pages/mypage/changeprofile/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export default function Profile() {
return (
<div className="w-full flex items-center justify-center">
<div className="w-full max-w-md bg-white p-6 rounded-lg ">
<BackArrow width="40px" height="24px" name="프로필 수정" link="/mypage" />
<BackArrow width="40px" height="24px" name="프로필 수정" />
<div className="flex flex-col items-center mb-[12px] mt-[22px]">
<div className="w-[100px] relative">
<label className=" cursor-pointer" htmlFor="fileInput">
Expand Down
2 changes: 1 addition & 1 deletion src/pages/mypage/guide/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const GuidePage = () => {
return (
<div className="w-full max-w-md mx-auto bg-white flex flex-col gap-8">
<div className=" mt-[40px] ml-[20px] mb-[2px]">
<BackArrow width="40px" height="24px" name="이용 가이드" link="/mypage" />
<BackArrow width="40px" height="24px" name="이용 가이드" />
</div>

<div className="px-4 ">
Expand Down
2 changes: 1 addition & 1 deletion src/pages/mypage/notice/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const NoticePage = () => {
return (
<MainContainer>
<div className="mt-[40px] ml-[10px] mb-[22px]">
<BackArrow width="40px" height="24px" name="공지사항" link="/mypage" />
<BackArrow width="40px" height="24px" name="공지사항" />
</div>

<div className="w-full flex items-center justify-center mt-3">
Expand Down
2 changes: 1 addition & 1 deletion src/pages/mypage/question/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ const InquiryPage = () => {
return (
<div className=" max-w-[393px] h-[890px] mx-auto relative overflow-hidden">
<div className="mt-[20px] ml-[10px] ">
<BackArrow width="40px" height="24px" name="1:1 문의" link="/mypage" />
<BackArrow width="40px" height="24px" name="1:1 문의" />
</div>
<div className="w-full h-[900px] bg-white flex flex-col justify-between items-center">
<div className="w-full flex justify-center items-center border-b border-neutral-200 mt-[13px]">
Expand Down
2 changes: 1 addition & 1 deletion src/pages/mypage/withdraw/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const MemberWithdrawal = () => {
return (
<MainContainer>
<div className="mt-[20px] ml-[10px] ">
<BackArrow width="40px" height="24px" name="회원 탈퇴" link="/mypage" />
<BackArrow width="40px" height="24px" name="회원 탈퇴" />
</div>
<div className="w-full h-screen bg-white flex flex-col items-center">
<div className="flex flex-col p-[16px] items-start mt-3">
Expand Down
2 changes: 1 addition & 1 deletion src/pages/notification/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ const Notification = () => {

<div className="sticky top-0 bg-white z-[10]">
<div className="pt-[20px] ml-[10px] ">
<BackArrow width="40px" height="24px" name="알림" link="/" />
<BackArrow width="40px" height="24px" name="알림" />
</div>

<div className="w-full bg-white flex flex-col justify-between items-center">
Expand Down
2 changes: 1 addition & 1 deletion src/pages/signup/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { useMutation } from 'react-query';

const SignUpPage = () => {
const [applyValues, setApplyValues] = useState<Partial<ApplyValues>>({
step: 0
step: 2
});

const { mutateAsync: signUpReq } = useMutation(
Expand Down

0 comments on commit 1f9c70c

Please sign in to comment.