diff --git a/frontend/src/@types/feedback.ts b/frontend/src/@types/feedback.ts index 0ebeafed2..1f1cf70d6 100644 --- a/frontend/src/@types/feedback.ts +++ b/frontend/src/@types/feedback.ts @@ -17,6 +17,7 @@ export interface FeedbackCardData { readonly feedbackKeywords: NonEmptyArray; readonly feedbackText: string; readonly evaluationPoint: 1 | 2 | 3 | 4 | 5; + readonly isWrited: boolean; } export interface RevieweeFeedbackData { diff --git a/frontend/src/@types/reviewer.ts b/frontend/src/@types/reviewer.ts index 987dca011..19c38e1ab 100644 --- a/frontend/src/@types/reviewer.ts +++ b/frontend/src/@types/reviewer.ts @@ -2,6 +2,6 @@ export interface ReviewerInfo { userId: number; username: string; link: string; - isReviewed: boolean; + isReviewed?: boolean; isWrited: boolean; } diff --git a/frontend/src/components/common/button/Button.style.ts b/frontend/src/components/common/button/Button.style.ts index 170e5e3ad..68ca029e3 100644 --- a/frontend/src/components/common/button/Button.style.ts +++ b/frontend/src/components/common/button/Button.style.ts @@ -1,22 +1,22 @@ import { ButtonSize, ButtonVariant } from "./Button"; import { css, styled } from "styled-components"; +import { ThemeType } from "@/styles/theme"; export const ButtonContainer = styled.button<{ $variant: ButtonVariant; $size: ButtonSize; + $outline?: boolean; }>` display: flex; align-items: center; justify-content: center; - - color: ${({ theme }) => theme.COLOR.white}; text-align: center; - ${(props) => variantStyles[props.$variant]} - ${(props) => sizeStyles[props.$size]} + ${({ $variant, $outline }) => variantStyles($variant, $outline)} + ${({ $size }) => sizeStyles[$size]} - ${(props) => - props.$variant !== "disable" + ${({ $variant }) => + $variant !== "disable" ? css` &:hover { cursor: pointer; @@ -28,27 +28,40 @@ export const ButtonContainer = styled.button<{ `} `; -const variantStyles = { - default: css` - color: ${({ theme }) => theme.COLOR.black}; - background-color: ${({ theme }) => theme.COLOR.white}; - `, - primary: css` - background-color: ${({ theme }) => theme.COLOR.primary2}; - `, - secondary: css` - background-color: ${({ theme }) => theme.COLOR.secondary}; - `, - disable: css` - background-color: ${({ theme }) => theme.COLOR.grey1}; - `, - confirm: css` - color: ${({ theme }) => theme.COLOR.black}; - background-color: ${({ theme }) => theme.COLOR.lightGrass}; - `, - error: css` - background-color: ${({ theme }) => theme.COLOR.error}; - `, +const variantStyles = (variant: ButtonVariant, outline?: boolean) => { + return css` + ${outline + ? css` + color: ${({ theme }) => getColor(theme, variant)}; + background-color: ${({ theme }) => theme.COLOR.white}; + border: 2px solid ${({ theme }) => getColor(theme, variant)}; + ` + : css` + color: ${({ theme }) => + variant === "default" || variant === "confirm" ? theme.COLOR.black : theme.COLOR.white}; + background-color: ${({ theme }) => getColor(theme, variant)}; + border: 2px solid ${({ theme }) => getColor(theme, variant)}; + `} + `; +}; + +const getColor = (theme: ThemeType, variant: ButtonVariant) => { + switch (variant) { + case "default": + return theme.COLOR.white; + case "primary": + return theme.COLOR.primary2; + case "secondary": + return theme.COLOR.secondary; + case "disable": + return theme.COLOR.grey1; + case "confirm": + return theme.COLOR.lightGrass; + case "error": + return theme.COLOR.error; + default: + return theme.COLOR.black; + } }; const sizeStyles = { diff --git a/frontend/src/components/common/button/Button.tsx b/frontend/src/components/common/button/Button.tsx index 0b8bf95f6..d74efe6cc 100644 --- a/frontend/src/components/common/button/Button.tsx +++ b/frontend/src/components/common/button/Button.tsx @@ -7,15 +7,20 @@ export type ButtonSize = "xSmall" | "small" | "medium" | "large"; export interface ButtonProps extends ButtonHTMLAttributes { variant?: ButtonVariant; size?: ButtonSize; + outline?: boolean; } const Button = forwardRef( - ({ children, variant = "primary", size = "medium", disabled = false, ...rest }, ref) => { + ( + { children, variant = "primary", size = "medium", disabled = false, outline = false, ...rest }, + ref, + ) => { return ( { + + + )} + @@ -51,35 +87,39 @@ const FeedbackCard = ({ - - 피드백 점수 - - + + + 피드백 점수 + + - - 피드백 키워드 - - {feedbackCardData.feedbackKeywords.map((keyword) => ( - {keyword} - ))} - - + + 피드백 키워드 + + {feedbackCardData.feedbackKeywords.map((keyword) => ( + {keyword} + ))} + + - - 세부 피드백 -