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 2 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 @@ -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 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';