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] 데모데이 피드백 반영(#698) #699

Merged
merged 9 commits into from
Oct 28, 2024
3 changes: 2 additions & 1 deletion frontend/src/@types/icon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ type IconKind =
| "arrowRenew"
| "check"
| "menu"
| "close";
| "close"
| "githubLogo";

export default IconKind;
88 changes: 3 additions & 85 deletions frontend/src/assets/etc/spinner.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions frontend/src/components/common/button/Button.style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ const variantStyles = {
const sizeStyles = {
xSmall: css`
width: fit-content;
max-width: 110px;
padding: 1rem;
max-width: 120px;
padding: 1rem 0.5rem;

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,19 @@ export const ContentSectionHeader = styled.div`
justify-content: space-between;
`;

export const TitleContainer = styled.div`
display: flex;
gap: 1rem;
align-items: flex-end;
justify-content: center;
`;

export const ContentSectionTitle = styled.h2`
font: ${({ theme }) => theme.TEXT.xLarge_bold};
color: ${({ theme }) => theme.COLOR.grey4};
`;

export const ContentSectionSubtitle = styled.h3`
font: ${({ theme }) => theme.TEXT.medium_bold};
color: ${({ theme }) => theme.COLOR.grey3};
`;
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,20 @@ interface ContentSectionButton extends ButtonProps {

interface ContentSectionProps {
title: string;
subtitle?: string;
children?: ReactNode;
button?: ContentSectionButton | undefined;
}

const ContentSection = ({ title, children, button }: ContentSectionProps) => {
const ContentSection = ({ title, subtitle, children, button }: ContentSectionProps) => {
return (
<S.ContentSectionContainer>
<S.ContentSectionHeader>
<S.ContentSectionTitle>{title}</S.ContentSectionTitle>
<S.TitleContainer>
<S.ContentSectionTitle>{title}</S.ContentSectionTitle>
<S.ContentSectionSubtitle>{subtitle}</S.ContentSectionSubtitle>
</S.TitleContainer>

{button && (
<Button onClick={button.onClick} size="small">
{button.label}
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/common/header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const headerItems = [
path: "/intro",
},
{
name: "코드리뷰가이드",
name: "가이드",
path: "/guide",
},
// {
Expand Down
8 changes: 4 additions & 4 deletions frontend/src/components/common/header/ProfileDropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ import FocusTrap from "@/components/common/focusTrap/FocusTrap";
import * as S from "@/components/common/header/ProfileDropdown.style";

const dropdownItems = [
{
name: "피드백 모아보기",
path: "/feedback",
},
{
name: "마이페이지",
path: "/profile",
},
{
name: "피드백 모아보기",
path: "/feedback",
},
];

const ProfileDropdown = () => {
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/components/common/header/SideNavBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const loggedInMenuItems = [
path: "/intro",
},
{
name: "코드리뷰가이드",
name: "가이드",
path: "/guide",
},
];
Expand All @@ -35,7 +35,7 @@ const commonMenuItems = [
path: "/intro",
},
{
name: "코드리뷰가이드",
name: "가이드",
path: "/guide",
},
];
Expand Down
2 changes: 2 additions & 0 deletions frontend/src/components/common/icon/Icon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
FaRegFaceMeh,
FaRegFaceSmile,
} from "react-icons/fa6";
import { IoLogoGithub } from "react-icons/io";
import { IconType } from "react-icons/lib";
import {
MdArrowBackIos,
Expand Down Expand Up @@ -55,6 +56,7 @@ const ICON: { [key in IconKind]: IconType } = {
check: MdCheck,
menu: MdMenu,
close: MdClear,
githubLogo: IoLogoGithub,
};

interface IconProps {
Expand Down
11 changes: 11 additions & 0 deletions frontend/src/components/common/label/Label.style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,17 @@ export const LabelWrapper = styled.div<LabelWrapperProps>`
background-color: ${theme.COLOR.error};
border: 1px solid ${theme.COLOR.error};
`;
case "MANAGER":
return css`
display: flex;
gap: 0.4rem;

font: ${({ theme }) => theme.TEXT.small};
color: ${theme.COLOR.black};

background-color: ${theme.COLOR.grey0};
border: 1px solid ${theme.COLOR.grey0};
`;
}
}}
`;
22 changes: 19 additions & 3 deletions frontend/src/components/common/label/Label.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,27 @@
import Icon from "@/components/common/icon/Icon";
import * as S from "@/components/common/label/Label.style";
import { ThemeType } from "@/styles/theme";
import { ThemeType, theme } from "@/styles/theme";

export type LabelType =
| "KEYWORD"
| "PARTICIPATED"
| "OPEN"
| "PROGRESS"
| "CLOSE"
| "FAIL"
| "MANAGER";

export type LabelType = "KEYWORD" | "PARTICIPATED" | "OPEN" | "PROGRESS" | "CLOSE" | "FAIL";
export type LabelSize = keyof ThemeType["TEXT"];

interface LabelProps {
text?: string;
managerText?: string;
type: LabelType;
size?: LabelSize;
backgroundColor?: string;
}

const Label = ({ text, type, size = "semiSmall", backgroundColor }: LabelProps) => {
const Label = ({ text, managerText, type, size = "semiSmall", backgroundColor }: LabelProps) => {
return (
<S.LabelWrapper type={type} $size={size} $backgroundColor={backgroundColor}>
{type === "KEYWORD" && `#${text}`}
Expand All @@ -20,6 +30,12 @@ const Label = ({ text, type, size = "semiSmall", backgroundColor }: LabelProps)
{type === "PROGRESS" && "진행 중"}
{type === "CLOSE" && "종료"}
{type === "FAIL" && "매칭 실패"}
{type === "MANAGER" && (
<>
<Icon kind="person" size="1.6rem" color={theme.COLOR.grey4} />
{managerText}
</>
)}
</S.LabelWrapper>
);
};
Expand Down
11 changes: 8 additions & 3 deletions frontend/src/components/feedback/feedbackCard/FeedbackCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,12 @@ const FeedbackCard = ({
feedbackCardData,
feedbackType,
}: FeedbackCardProps) => {
const feedbackTarget = selectedFeedbackType === "받은 피드백" ? "FROM" : "TO";
const getFeedbackTarget = (feedbackType: "develop" | "social") => {
if (selectedFeedbackType === "받은 피드백") {
return feedbackType === "develop" ? "FROM. 나의 리뷰어" : "FROM. 나의 리뷰이";
}
return feedbackType === "develop" ? "TO. 나의 리뷰이" : "TO. 나의 리뷰어";
};

return (
<>
Expand All @@ -35,12 +40,12 @@ const FeedbackCard = ({
{feedbackType === "develop" ? (
<>
개발 역량 피드백
<p>{feedbackTarget}. 나의 리뷰어</p>
<p>{getFeedbackTarget(feedbackType)}</p>
</>
) : (
<>
소프트스킬 역량 피드백
<p>{feedbackTarget}. 나의 리뷰이</p>
<p>{getFeedbackTarget(feedbackType)}</p>
</>
)}
</S.FeedbackType>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,12 @@ export const FeedbackMissionPrompt = styled.span<{ $isSelected: boolean }>`

export const FeedbackMissionInfo = styled.div`
display: flex;
align-items: center;
align-items: start;

margin-right: 1rem;

font: ${({ theme }) => theme.TEXT.medium_bold};
color: ${({ theme }) => theme.COLOR.black};
`;

export const FeedbackCount = styled.div`
Expand All @@ -136,3 +139,10 @@ export const NoKeywordText = styled.span`
export const ScreenReader = styled.div`
${VisuallyHidden}
`;

export const FeedbackLink = styled.button`
display: flex;
align-items: center;
color: ${({ theme }) => theme.COLOR.black};
background-color: transparent;
`;
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import FeedbackCard from "@/components/feedback/feedbackCard/FeedbackCard";
import * as S from "@/components/feedback/feedbackCardList/FeedbackCardList.style";
import { FeedbackCardDataList } from "@/@types/feedback";
import { defaultCharacter } from "@/assets";
import { HoverStyledLink } from "@/styles/common";
import { theme } from "@/styles/theme";

interface FeedbackCardListProps {
Expand All @@ -25,12 +26,9 @@ const FeedbackCardList = ({ selectedFeedbackType, feedbackData }: FeedbackCardLi
setSelectedFeedback(roomId);
};

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

if (feedbackData.length === 0) {
return (
Expand Down Expand Up @@ -97,6 +95,11 @@ const FeedbackCardList = ({ selectedFeedbackType, feedbackData }: FeedbackCardLi
>
피드백을 보려면 클릭해주세요
</S.FeedbackMissionPrompt>
{selectedFeedback === feedback.roomId && (
<HoverStyledLink to={`/rooms/${feedback.roomId}`}>
상세페이지로 이동하기
</HoverStyledLink>
)}
</S.FeedbackMissionWrapper>
<S.FeedbackInfoWrapper
$isVisible={feedback.roomId === selectedFeedback}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,12 @@ export const ProfileWrapper = styled.div`
`;

export const ProfileNickname = styled.div`
display: flex;
gap: 0.5rem;
align-items: center;

max-width: 108px;

font: ${({ theme }) => theme.TEXT.medium_bold};
color: ${({ theme }) => theme.COLOR.grey3};
text-align: center;
Expand Down
5 changes: 4 additions & 1 deletion frontend/src/components/profile/profileCard/ProfileCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ const ProfileCard = (profileData: ProfileData) => {
>
<S.ProfileWrapper>
<Profile imgSrc={profileData.profileImage} size={110} />
<S.ProfileNickname>{profileData.nickname}</S.ProfileNickname>
<S.ProfileNickname>
<Icon kind="githubLogo" size="2.5rem" />
{profileData.nickname}
</S.ProfileNickname>
</S.ProfileWrapper>
</HoverStyledLink>

Expand Down
Loading
Loading