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] 3주차 운영 피드백 반영 - 1(#717) #721

Merged
merged 23 commits into from
Nov 8, 2024
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
bdae751
design: 프로필 페이지 이름 아래 잘리는 오류 해결
chlwlstlf Nov 5, 2024
b2f705e
design: 버튼 xSmall 디자인 수정
chlwlstlf Nov 5, 2024
392faf3
feat: 로그인 완료 됐을 때 리다이렉트
chlwlstlf Nov 5, 2024
29d210b
refactor: reviewerInfo에서 reviewInfo로 변경
chlwlstlf Nov 5, 2024
a9dc909
fix: 피드백 모아보기에서 textarea 클릭 막기
chlwlstlf Nov 5, 2024
dbe303f
fix: review 주석 수정, link로 profile 넘기던 것 빈 값으로 수정
chlwlstlf Nov 5, 2024
ffc9df6
design: 확인 모달 버튼 outline 속성 추가
chlwlstlf Nov 5, 2024
590e08f
feat: 피드백 모아보기에서 수정 기능 추가
chlwlstlf Nov 5, 2024
e8c4224
fix: 피드백 모아보기 페이지 키워드 아래로 넘어가는 오류 해결
chlwlstlf Nov 5, 2024
a425dea
fix: 바뀐 정책에 따라 프로세스 설명 변경
chlwlstlf Nov 5, 2024
e5deaed
feat: selectedFeedbackTyped을 세션스토리지로 관리
chlwlstlf Nov 5, 2024
3269934
feat: 피드백 모아보기 페이지에서 selectedFeedbackType과 selectedFeedback를 session …
chlwlstlf Nov 5, 2024
a953c61
design: 상세페이지 각 섹션별 디자인 통일하기
chlwlstlf Nov 5, 2024
6b9abdc
design: 프로필 페이지 모바일 환경 디자인
chlwlstlf Nov 5, 2024
20cf78a
refactor: roomInfo에서 ContentLineBreak 모두 넣기
chlwlstlf Nov 5, 2024
eafe9bb
design: 모바일에서 상위 코멘트 왼쪽 정렬
chlwlstlf Nov 6, 2024
f5626fe
design: 피드백 상세 페이지에 Comment 링크, PR 링크 UI 추가
chlwlstlf Nov 7, 2024
12c6530
feat: 피드백 모아보기에서 pr링크, comment 링크 이동 api 연결
chlwlstlf Nov 7, 2024
62feeac
Merge branch 'develop' into fix/#717
chlwlstlf Nov 8, 2024
573fab0
Merge branch 'develop' of https://github.com/woowacourse-teams/2024-c…
chlwlstlf Nov 8, 2024
49f0d6e
Merge branch 'fix/#717' of https://github.com/woowacourse-teams/2024-…
chlwlstlf Nov 8, 2024
5274776
fix: roomCard에서 키워드 가려져 보였던 오류 해결
chlwlstlf Nov 8, 2024
eb76994
design: 피드백 페이지 개수 제목 옆에 붙이기
chlwlstlf Nov 8, 2024
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
7 changes: 7 additions & 0 deletions frontend/src/@types/review.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export interface ReviewInfo {
userId: number;
username: string;
link: string; // PR 링크, Comment 링크
isReviewed?: boolean;
isWrited: boolean; // 피드백 작성 여부
}
7 changes: 0 additions & 7 deletions frontend/src/@types/reviewer.ts

This file was deleted.

6 changes: 3 additions & 3 deletions frontend/src/apis/reviews.api.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { ReviewerInfo } from "../@types/reviewer";
import { ReviewInfo } from "../@types/review";
import apiClient from "./apiClient";
import { API_ENDPOINTS } from "./endpoints";
import MESSAGES from "@/constants/message";

export const getMyReviewers = async (roomId: number): Promise<ReviewerInfo[]> => {
export const getMyReviewers = async (roomId: number): Promise<ReviewInfo[]> => {
const res = await apiClient.get({
endpoint: API_ENDPOINTS.REVIEWERS(roomId),
errorMessage: MESSAGES.ERROR.GET_MY_REVIEWERS,
Expand All @@ -12,7 +12,7 @@ export const getMyReviewers = async (roomId: number): Promise<ReviewerInfo[]> =>
return res.matchResultResponses;
};

export const getMyReviewees = async (roomId: number): Promise<ReviewerInfo[]> => {
export const getMyReviewees = async (roomId: number): Promise<ReviewInfo[]> => {
const res = await apiClient.get({
endpoint: API_ENDPOINTS.REVIEWEES(roomId),
errorMessage: MESSAGES.ERROR.GET_MY_REVIEWEES,
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/common/button/Button.style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ const sizeStyles = {
xSmall: css`
width: fit-content;
max-width: 120px;
padding: 1rem 0.5rem;
padding: 1rem 0.3rem;

font: ${({ theme }) => theme.TEXT.semiSmall};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import styled from "styled-components";
export const ContentSectionContainer = styled.div`
display: flex;
flex-direction: column;
gap: 2rem;
gap: 1rem;
`;

export const ContentSectionHeader = styled.div`
Expand All @@ -25,6 +25,6 @@ export const ContentSectionTitle = styled.h2`
`;

export const ContentSectionSubtitle = styled.h3`
font: ${({ theme }) => theme.TEXT.medium_bold};
font: ${({ theme }) => theme.TEXT.small_bold};
color: ${({ theme }) => theme.COLOR.grey3};
`;
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,4 @@ export const ConfirmModalContainer = styled.div`
export const ButtonWrapper = styled.div`
display: flex;
justify-content: space-evenly;

.cancel-button {
color: ${({ theme }) => theme.COLOR.primary2};
background-color: ${({ theme }) => theme.COLOR.white};
border: 2px solid ${({ theme }) => theme.COLOR.primary2};
}
`;
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ const ConfirmModal = ({
<S.ConfirmModalContainer>
{rest.children}
<S.ButtonWrapper>
<Button size="small" onClick={rest.onCancel} className="cancel-button">
<Button size="small" onClick={rest.onCancel} outline={true}>
{cancelButtonText}
</Button>
<Button size="small" onClick={rest.onConfirm} className="confirm-button">
<Button size="small" onClick={rest.onConfirm}>
Comment on lines +24 to +27
Copy link
Member

Choose a reason for hiding this comment

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

저번에 버튼 컴포넌트를 재사용성있게 수정한 덕분에 더 간결해지고 좋은 것 같아요 👍

Copy link
Contributor

Choose a reason for hiding this comment

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

원래 쓰고 있던 곳이 없는 줄 알았는데 className 까지 만들어가며 썼더라구요ㅋㅅㅅㅋㅅㅋ 바로 리팩토링 했습니다😁

{confirmButtonText}
</Button>
</S.ButtonWrapper>
Expand Down
44 changes: 33 additions & 11 deletions frontend/src/components/feedback/feedbackCard/FeedbackCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { Textarea } from "@/components/common/textarea/Textarea";
import EvaluationPointBar from "@/components/feedback/evaluationPointBar/EvaluationPointBar";
import * as S from "@/components/feedback/feedbackCard/FeedbackCard.style";
import { FeedbackCardData } from "@/@types/feedback";
import { ReviewerInfo } from "@/@types/reviewer";
import { ReviewInfo } from "@/@types/review";
import { HoverStyledLink } from "@/styles/common";
import { theme } from "@/styles/theme";

Expand All @@ -29,15 +29,15 @@ const FeedbackCard = ({
return feedbackType === "develop" ? "TO. 나의 리뷰이" : "TO. 나의 리뷰어";
};

const reviewInfo: ReviewerInfo = {
const reviewInfo: ReviewInfo = {
userId: feedbackCardData.receiverId,
username: feedbackCardData.username,
link: feedbackCardData.profile,
link: "", //TODO: 서버로부터 받은 PR 링크, comment 링크 넘겨주어야 함
isWrited: feedbackCardData.isWrited,
};

// 피드백 페이지 이동 함수
const handleNavigateFeedbackPage = () => {
// [받은 피드백] 상대 피드백 작성 페이지 이동 함수
const handleNavigateUserFeedbackPage = () => {
navigate(
`/rooms/${feedbackCardData.roomId}/feedback/${feedbackType === "develop" ? "reviewer" : "reviewee"}?username=${feedbackCardData.username}`,
{
Expand All @@ -46,6 +46,16 @@ const FeedbackCard = ({
);
};

// [쓴 피드백] 내가 쓴 피드백 수정 페이지 이동 함수
const handleNavigateMyFeedbackPage = () => {
navigate(
`/rooms/${feedbackCardData.roomId}/feedback/${feedbackType === "develop" ? "reviewee" : "reviewer"}?username=${feedbackCardData.username}`,
{
state: { reviewInfo },
},
);
};

return (
<>
<S.ScreenReader>미션의 상세 피드백 내용입니다.</S.ScreenReader>
Expand All @@ -57,7 +67,7 @@ const FeedbackCard = ({
<p>상대방 피드백을 작성해야 볼 수 있습니다.</p>
<Button
variant={feedbackType === "develop" ? "primary" : "secondary"}
onClick={handleNavigateFeedbackPage}
onClick={handleNavigateUserFeedbackPage}
>
피드백 작성하러가기
</Button>
Expand All @@ -72,6 +82,7 @@ const FeedbackCard = ({
<S.FeedbackTitle>{feedbackCardData.username}</S.FeedbackTitle>
</S.FeedbackProfile>
</HoverStyledLink>

<S.FeedbackType $isTypeDevelop={feedbackType === "develop"}>
{feedbackType === "develop" ? (
<>
Expand Down Expand Up @@ -110,15 +121,26 @@ const FeedbackCard = ({
<S.FeedbackDetailContainer>
<S.FeedbackTitle>세부 피드백</S.FeedbackTitle>
<Textarea
rows={10}
rows={7}
maxLength={2000}
showCharCount={true}
value={
feedbackCardData.feedbackText.length ? feedbackCardData.feedbackText : "미작성"
}
readOnly
placeholder="미작성"
value={feedbackCardData.feedbackText}
disabled
/>
</S.FeedbackDetailContainer>

{selectedFeedbackType === "쓴 피드백" && (
<S.ButtonWrapper>
<Button
onClick={handleNavigateMyFeedbackPage}
variant={feedbackType === "develop" ? "primary" : "secondary"}
size="small"
>
수정하기
</Button>
</S.ButtonWrapper>
)}
</S.FeedbackContent>
</S.FeedbackCardContainer>
</>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,7 @@ export const Default: Story = {
socialFeedback: socialFeedbackData,
},
],
selectedFeedback: 0,
handleSelectedFeedback: () => {},
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ export const FeedbackCount = styled.div`
export const FeedbackKeywordContainer = styled.div`
overflow: hidden;
display: flex;
flex-direction: row;
flex-flow: row wrap;
gap: 1rem;
`;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useEffect, useState } from "react";
import React from "react";
import { FeedbackType } from "@/hooks/feedback/useSelectedFeedbackData";
import Carousel from "@/components/common/carousel/Carousel";
import Label from "@/components/common/label/Label";
Expand All @@ -12,24 +12,16 @@ import { theme } from "@/styles/theme";
interface FeedbackCardListProps {
selectedFeedbackType: FeedbackType;
feedbackData: FeedbackCardDataList[];
selectedFeedback: number | undefined;
handleSelectedFeedback: (roomId: number) => void;
}

const FeedbackCardList = ({ selectedFeedbackType, feedbackData }: FeedbackCardListProps) => {
const [selectedFeedback, setSelectedFeedback] = useState<number>();

const handleSelectedFeedback = (roomId: number) => {
if (selectedFeedback === roomId) {
setSelectedFeedback(undefined);
return;
}

setSelectedFeedback(roomId);
};

useEffect(() => {
setSelectedFeedback(undefined);
}, [feedbackData]);

const FeedbackCardList = ({
selectedFeedbackType,
feedbackData,
selectedFeedback,
handleSelectedFeedback,
}: FeedbackCardListProps) => {
if (feedbackData.length === 0) {
return (
<S.EmptyContainer>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,20 @@ import Label from "@/components/common/label/Label";
import RevieweeFeedbackForm from "@/components/feedback/feedbackForm/RevieweeFeedbackForm";
import * as S from "@/components/feedback/feedbackLayout/FeedbackLayout.style";
import { RevieweeFeedbackData } from "@/@types/feedback";
import { ReviewerInfo } from "@/@types/reviewer";
import { ReviewInfo } from "@/@types/review";
import { RoomInfo } from "@/@types/roomInfo";
import { theme } from "@/styles/theme";
import { FeedbackPageType } from "@/utils/feedbackUtils";

interface RevieweeFeedbackProps {
feedbackPageType: FeedbackPageType;
roomInfo: Pick<RoomInfo, "id" | "title" | "keywords">;
reviewee?: ReviewerInfo;
reviewee?: ReviewInfo;
feedbackData?: RevieweeFeedbackData;
}

const getInitialFormState = (
reviewee?: ReviewerInfo,
reviewee?: ReviewInfo,
feedbackData?: RevieweeFeedbackData,
): RevieweeFeedbackData => ({
feedbackId: feedbackData?.feedbackId || 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,20 @@ import Label from "@/components/common/label/Label";
import ReviewerFeedbackForm from "@/components/feedback/feedbackForm/ReviewerFeedbackForm";
import * as S from "@/components/feedback/feedbackLayout/FeedbackLayout.style";
import { ReviewerFeedbackData } from "@/@types/feedback";
import { ReviewerInfo } from "@/@types/reviewer";
import { ReviewInfo } from "@/@types/review";
import { RoomInfo } from "@/@types/roomInfo";
import { theme } from "@/styles/theme";
import { FeedbackPageType } from "@/utils/feedbackUtils";

interface ReviewerFeedbackProps {
feedbackPageType: FeedbackPageType;
roomInfo: Pick<RoomInfo, "id" | "title" | "keywords">;
reviewer?: ReviewerInfo;
reviewer?: ReviewInfo;
feedbackData?: ReviewerFeedbackData;
}

const getInitialFormState = (
reviewer?: ReviewerInfo,
reviewer?: ReviewInfo,
feedbackData?: ReviewerFeedbackData,
): ReviewerFeedbackData => ({
feedbackId: feedbackData?.feedbackId || 0,
Expand Down
Loading
Loading