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

[FE] fix: 리뷰 연결 페이지 이름 수정 및 EyeButton이 가려지는 문제 해결 #428

Merged
merged 3 commits into from
Aug 19, 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
File renamed without changes
2 changes: 1 addition & 1 deletion frontend/src/constants/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ export const ROUTES = {
reviewWriting: 'user/review-writing',
reviewWritingComplete: 'user/review-writing-complete',
detailedReview: 'user/detailed-review',
reviewDashboard: 'user/reviewDashboard',
reviewZone: 'user/review-zone',
};
6 changes: 3 additions & 3 deletions frontend/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
ReviewListPage,
ReviewWritingCompletePage,
ReviewWritingCardFormPage,
ReviewDashboardPage,
ReviewZonePage,
} from '@/pages';

import { ErrorSuspenseContainer } from './components';
Expand Down Expand Up @@ -87,10 +87,10 @@ const router = createBrowserRouter([
),
},
{
path: `user/reviewDashboard/:${ROUTE_PARAM.reviewRequestCode}`, // NOTE: 임시 경로, 추후 논의 및 상수화 필요
path: `${ROUTES.reviewZone}/:${ROUTE_PARAM.reviewRequestCode}`, // NOTE: 임시 경로, 추후 논의 및 상수화 필요
element: (
<ErrorSuspenseContainer>
<ReviewDashboardPage />
<ReviewZonePage />
</ErrorSuspenseContainer>
),
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ import Checkbox from '@/components/common/Checkbox';
import { CopyTextButton } from '../index';

import * as S from './styles';
interface ReviewDashboardURLModalProps {
reviewDashboardURL: string;
interface ReviewZoneURLModalProps {
reviewZoneURL: string;
closeModal: () => void;
}

const ReviewURLModal = ({ reviewDashboardURL, closeModal }: ReviewDashboardURLModalProps) => {
const ReviewZoneURLModal = ({ reviewZoneURL, closeModal }: ReviewZoneURLModalProps) => {
const [isChecked, setIsChecked] = useState(false);

const handleCheckboxClick = () => {
Expand All @@ -28,13 +28,13 @@ const ReviewURLModal = ({ reviewDashboardURL, closeModal }: ReviewDashboardURLMo
handleClose={null}
isClosableOnBackground={false}
>
<S.ReviewDashboardURLModal>
<S.ReviewZoneURLModal>
<S.ModalTitle>아래 요청 URL을 확인해주세요</S.ModalTitle>
<S.ReviewDashboardURLModalItem>
<S.ReviewZoneURLModalItem>
<S.DataName>리뷰 요청 URL</S.DataName>
<S.Data>{reviewDashboardURL}</S.Data>
<CopyTextButton targetText={reviewDashboardURL} alt="리뷰 대시보드 페이지 링크 복사하기"></CopyTextButton>
</S.ReviewDashboardURLModalItem>
<S.Data>{reviewZoneURL}</S.Data>
<CopyTextButton targetText={reviewZoneURL} alt="리뷰 공간 페이지 링크 복사하기"></CopyTextButton>
</S.ReviewZoneURLModalItem>
<S.CheckContainer>
<Checkbox
id="is-confirmed-checkbox"
Expand All @@ -45,9 +45,9 @@ const ReviewURLModal = ({ reviewDashboardURL, closeModal }: ReviewDashboardURLMo
<S.CheckMessage>링크를 저장해두었어요!</S.CheckMessage>
</S.CheckContainer>
<S.WarningMessage>* 창이 닫히면 링크를 다시 확인할 수 없어요!</S.WarningMessage>
</S.ReviewDashboardURLModal>
</S.ReviewZoneURLModal>
</AlertModal>
);
};

export default ReviewURLModal;
export default ReviewZoneURLModal;
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import styled from '@emotion/styled';

export const ReviewDashboardURLModal = styled.div`
export const ReviewZoneURLModal = styled.div`
display: flex;
flex-direction: column;
width: 52rem;
Expand All @@ -13,7 +13,7 @@ export const ModalTitle = styled.p`
font-weight: ${({ theme }) => theme.fontWeight.bold};
`;

export const ReviewDashboardURLModalItem = styled.div`
export const ReviewZoneURLModalItem = styled.div`
display: flex;
gap: 1.8rem;
align-items: center;
Expand Down
19 changes: 8 additions & 11 deletions frontend/src/pages/HomePage/components/URLGeneratorForm/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
MIN_PASSWORD_INPUT,
isValidPasswordInput,
} from '../../utils/validateInput';
import { FormLayout, ReviewDashboardURLModal } from '../index';
import { FormLayout, ReviewZoneURLModal } from '../index';

import * as S from './styles';

Expand All @@ -39,7 +39,7 @@ const URLGeneratorForm = () => {
// groupAccessCode로 통일하기로 했지만 이미 이 페이지에서는 pwd로 작업한 게 많아서 놔두고
// API 요청 함수와 리액트 쿼리 코드에서는 groupAccessCode: password로 전달합니다
const [password, setPassword] = useState('');
const [reviewDashboardURL, setReviewDashboardURL] = useState('');
const [reviewZoneURL, setReviewZoneURL] = useState('');

const [revieweeNameErrorMessage, setRevieweeNameErrorMessage] = useState('');
const [projectNameErrorMessage, setProjectNameErrorMessage] = useState('');
Expand All @@ -59,8 +59,8 @@ const URLGeneratorForm = () => {

mutation.mutate(dataForReviewRequestCode, {
onSuccess: (data) => {
const completeReviewDashboardURL = getCompleteReviewDashboardURL(data.reviewRequestCode);
setReviewDashboardURL(completeReviewDashboardURL);
const completeReviewZoneURL = getCompleteReviewZoneURL(data.reviewRequestCode);
setReviewZoneURL(completeReviewZoneURL);

resetInputs();
},
Expand All @@ -73,8 +73,8 @@ const URLGeneratorForm = () => {
setPassword('');
};

const getCompleteReviewDashboardURL = (reviewRequestCode: string) => {
return `${window.location.origin}/${ROUTES.reviewDashboard}/${reviewRequestCode}`;
const getCompleteReviewZoneURL = (reviewRequestCode: string) => {
return `${window.location.origin}/${ROUTES.reviewZone}/${reviewRequestCode}`;
};

const handleNameInputChange = (event: React.ChangeEvent<HTMLInputElement>) => {
Expand Down Expand Up @@ -159,7 +159,7 @@ const URLGeneratorForm = () => {
onChange={handlePasswordInputChange}
type={isOff ? 'password' : 'text'}
placeholder="abc123"
$style={{ width: '100%' }}
$style={{ width: '100%', paddingRight: '3rem' }}
/>
<EyeButton isOff={isOff} handleEyeButtonToggle={handleEyeButtonToggle} />
</S.PasswordInputContainer>
Expand All @@ -174,10 +174,7 @@ const URLGeneratorForm = () => {
리뷰 링크 생성하기
</Button>
{isOpen(MODAL_KEYS.confirm) && (
<ReviewDashboardURLModal
reviewDashboardURL={reviewDashboardURL}
closeModal={() => closeModal(MODAL_KEYS.confirm)}
/>
<ReviewZoneURLModal reviewZoneURL={reviewZoneURL} closeModal={() => closeModal(MODAL_KEYS.confirm)} />
)}
</FormLayout>
</S.URLGeneratorForm>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/HomePage/components/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export { default as FormBody } from './FormBody';
export { default as FormLayout } from './FormLayout';
export { default as ReviewDashboardURLModal } from './ReviewDashboardURLModal';
export { default as ReviewZoneURLModal } from './ReviewZoneURLModal';
export { default as URLGeneratorForm } from './URLGeneratorForm';
export { default as CopyTextButton } from './CopyTextButton';
export { default as ReviewMeOverview } from './ReviewMeOverview';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,25 +1,22 @@
import { useState } from 'react';
import { useNavigate } from 'react-router';

import { Input, Button } from '@/components';
// import { Input, Button, EyeButton } from '@/components';
import { Input, Button, EyeButton } from '@/components';
import ContentModal from '@/components/common/modals/ContentModal';
import { ROUTES } from '@/constants/routes';
// import { useEyeButton } from '@/hooks';
import { useEyeButton } from '@/hooks';

import * as S from './styles';
interface PasswordModalProps {
closeModal: () => void;
}

// NOTE : EyeButton이 있는 PR merge시 pull 받아온 뒤 주석 해제 코드 사용

const PasswordModal = ({ closeModal }: PasswordModalProps) => {
const [password, setPassword] = useState('');
const [errorMessage, setErrorMessage] = useState('');

const navigate = useNavigate();
//const { isOff, handleEyeButtonToggle } = useEyeButton();
const { isOff, handleEyeButtonToggle } = useEyeButton();

const handleConfirmButtonClick = () => {
// NOTE: 추후 이곳에 API 호출 함수 추가
Expand All @@ -35,22 +32,22 @@ const PasswordModal = ({ closeModal }: PasswordModalProps) => {
<ContentModal handleClose={closeModal}>
<S.PasswordModal>
<S.ModalTitle>리뷰 확인을 위해 설정한 비밀 번호를 입력해주세요</S.ModalTitle>
{/* <S.InputContainer>
<S.InputContainer>
<S.PasswordInputContainer>
<Input
id="password"
value={password}
onChange={handlePasswordInputChange}
type={isOff ? 'password' : 'text'}
placeholder="abc123"
$style={{ flex: '8' }}
$style={{ width: '100%', paddingRight: '3rem' }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

리팩토링 시, 눈 모양 이모티콘 크기를 상수 처림하면 좋을 것 같아요.

/>
<EyeButton isOff={isOff} handleEyeButtonToggle={handleEyeButtonToggle} />
</S.PasswordInputContainer>
<Button styleType="primary" type="button" onClick={handleConfirmButtonClick}>
확인
</Button>
</S.InputContainer> */}
</S.InputContainer>
{errorMessage && <S.ErrorMessage>{errorMessage}</S.ErrorMessage>}
</S.PasswordModal>
</ContentModal>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ export const ModalTitle = styled.h3`

export const InputContainer = styled.div`
display: flex;
gap: 2rem;
gap: 1rem;

justify-content: space-between;
width: 100%;
`;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { useNavigate } from 'react-router';

import DashboardIcon from '@/assets/dashboard.svg';
import ReviewZoneIcon from '@/assets/reviewZone.svg';
import { Button } from '@/components';

// TODO: ROUTES 상수명을 단수로 고치기
import { ROUTES } from '@/constants/routes';
import useModals from '@/hooks/useModals';
Expand All @@ -14,7 +13,7 @@ const MODAL_KEYS = {
content: 'CONTENT_MODAL',
};

const ReviewDashboardPage = () => {
const ReviewZonePage = () => {
const { isOpen, openModal, closeModal } = useModals();
const navigate = useNavigate();

Expand All @@ -27,8 +26,8 @@ const ReviewDashboardPage = () => {
};

return (
<S.ReviewDashboardPage>
<S.DashboardMainImg src={DashboardIcon} alt="" />
<S.ReviewZonePage>
<S.ReviewZoneMainImg src={ReviewZoneIcon} alt="" />
<S.ReviewGuideContainer>
{/* NOTE: 추후 API 연동되면 서버에서 받아온 이름들을 출력하도록 수정해야 함 */}
<S.ReviewGuide>{`${'임시 프로젝트 이름'}를 함께한`}</S.ReviewGuide>
Expand Down Expand Up @@ -59,8 +58,8 @@ const ReviewDashboardPage = () => {
</Button>
</S.ButtonContainer>
{isOpen(MODAL_KEYS.content) && <PasswordModal closeModal={() => closeModal(MODAL_KEYS.content)} />}
</S.ReviewDashboardPage>
</S.ReviewZonePage>
);
};

export default ReviewDashboardPage;
export default ReviewZonePage;
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import styled from '@emotion/styled';

export const ReviewDashboardPage = styled.div`
export const ReviewZonePage = styled.div`
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
`;

export const DashboardMainImg = styled.img`
export const ReviewZoneMainImg = styled.img`
width: 43rem;
height: 23rem;
`;
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ export { default as LoadingPage } from './LoadingPage';
export { default as ReviewListPage } from './ReviewListPage';
export { default as ReviewWritingCardFormPage } from './ReviewWritingCardFromPage';
export { default as ReviewWritingCompletePage } from './ReviewWritingCompletePage';
export { default as ReviewDashboardPage } from './ReviewDashboardPage';
export { default as ReviewZonePage } from './ReviewZonePage';