diff --git a/components/community/Reply.tsx b/components/community/Reply.tsx index a16b27a..1ff3fe7 100644 --- a/components/community/Reply.tsx +++ b/components/community/Reply.tsx @@ -1,18 +1,35 @@ import styled from '@emotion/styled'; -import ReplyContent from './ReplyContent'; +import ReplyContent from '../community/ReplyContent'; +import { useState } from 'react'; export default function Reply() { + const [inputColor, setInputColor] = useState(false); + const [replyText, setReplyText] = useState(''); + + const handleInputText = (e: React.ChangeEvent) => { + setReplyText(e.target.value); + }; + + const handleInputColor = () => { + replyText.length === 0 ? setInputColor(false) : setInputColor(true); + }; + return ( -

댓글

+

댓글

+

23

- -

예현맘

- + + - 등록 + 입력
theme.fonts.t3_19_medium_130} + + h1 { + margin-right: 0.4rem; + + color: ${({ theme }) => theme.colors.black}; + } - font-style: normal; - font-weight: 500; - font-size: 2.8rem; - line-height: 4rem; + p { + color: ${({ theme }) => theme.colors.mainDarkgreen}; + } `; const StInputForm = styled.article` display: flex; @@ -62,53 +85,61 @@ const StInputForm = styled.article` justify-content: space-between; align-items: center; - margin-bottom: 6.9rem; - padding-left: 4.3rem; - padding-right: 3.2rem; + margin-bottom: 4.8rem; width: 77.6rem; - height: auto; - min-height: 13.6rem; - - border: 0.1rem solid ${({ theme }) => theme.colors.gray005}; - border-radius: 1rem; `; -const StInputContent = styled.div` +const StInputContent = styled.div<{ inputColor: boolean }>` display: flex; flex-direction: column; + justify-content: center; + align-items: center; - p { - margin-bottom: 0.3rem; + input { + margin-right: 2.4rem; + padding-left: 1.8rem; - font-style: normal; - font-weight: 500; - font-size: 23.2351px; - line-height: 34px; - } + width: 67.6rem; + height: 4.2rem; - input { font-style: normal; font-weight: 400; font-size: 21.3762px; line-height: 31px; + color: ${({ theme }) => theme.colors.black}; + + ${({ theme }) => theme.fonts.b4_15_regular_146}; + + border: 0.1rem solid + ${({ theme, inputColor }) => + !inputColor ? theme.colors.gray007 : theme.colors.mainDarkgreen}; + border-radius: 0.65rem; + &::placeholder { font-family: Pretendard; + + color: ${({ theme }) => theme.colors.gray005}; } } `; -const StInputBtn = styled.span` - padding: 0.5rem 2.8rem; - - font-style: normal; - font-weight: 400; - font-size: 23.2351px; - line-height: 32px; - - color: ${({ theme }) => theme.colors.mainDarkgreen}; - background-color: ${({ theme }) => theme.colors.lightGreen}; - border: 2px solid ${({ theme }) => theme.colors.mainDarkgreen}; - border-radius: 1rem; +const StInputBtn = styled.span<{ inputColor: boolean }>` + display: flex; + justify-content: center; + align-items: center; + + width: 7.6rem; + height: 4.2rem; + + color: ${({ theme, inputColor }) => + !inputColor ? theme.colors.gray006 : theme.colors.white}; + + background-color: ${({ theme, inputColor }) => + !inputColor ? theme.colors.gray003 : theme.colors.mainDarkgreen}; + + ${({ theme }) => theme.fonts.b2_18_medium_130}; + + border-radius: 0.5rem; cursor: pointer; `; diff --git a/components/community/ReplyContent.tsx b/components/community/ReplyContent.tsx index 0a55c05..1c7260a 100644 --- a/components/community/ReplyContent.tsx +++ b/components/community/ReplyContent.tsx @@ -1,9 +1,9 @@ import styled from '@emotion/styled'; interface ReplyContentProps { - userNickname: string; + userNickname?: string; content: string; - createdAt: string; + createdAt?: string; } export default function ReplyContent(props: ReplyContentProps) { @@ -12,10 +12,10 @@ export default function ReplyContent(props: ReplyContentProps) {

{userNickname}

- {createdAt}

{content}

+ {createdAt} · 신고
); @@ -23,42 +23,37 @@ export default function ReplyContent(props: ReplyContentProps) { const StReplyContentWrapper = styled.section` width: 77.6rem; - margin-bottom: 3.3rem; - - border-bottom: 0.1rem solid ${({ theme }) => theme.colors.gray005}; + margin-bottom: 4rem; `; const StReplyInfo = styled.div` display: flex; - flex-direction: row; - align-items: center; - - margin-bottom: 1.1rem; p { + margin-bottom: 0.8rem; padding-right: 0.9rem; - font-style: normal; - font-weight: 500; - font-size: 23.2351px; - line-height: 34px; - } - - span { - font-style: normal; - font-weight: 350; - font-size: 19.5174px; - line-height: 28px; + ${({ theme }) => theme.fonts.b3_16_semibold_140} } `; const StReplyContents = styled.div` + display: flex; + flex-direction: column; + justify-content: flex-start; + margin-bottom: 2.8rem; p { - font-style: normal; - font-weight: 400; - font-size: 21.3762px; - line-height: 31px; + margin-bottom: 0.8rem; + + color: ${({ theme }) => theme.colors.black}; + ${({ theme }) => theme.fonts.b4_15_regular_146} + } + + span { + color: ${({ theme }) => theme.colors.gray007}; + + ${({ theme }) => theme.fonts.b6_13_regular_120} } `; diff --git a/styles/emotion.d.ts b/styles/emotion.d.ts index de64555..876d91d 100644 --- a/styles/emotion.d.ts +++ b/styles/emotion.d.ts @@ -50,6 +50,7 @@ declare module '@emotion/react' { b5_14_medium_140: SerializedStyles; b5_14_regular_140: SerializedStyles; b6_13_medium_120: SerializedStyles; + b6_13_regular_120: SerializedStyles; b7_12_bold_120: SerializedStyles; b7_12_medium_140: SerializedStyles; b7_12_regular_120: SerializedStyles; diff --git a/styles/theme.ts b/styles/theme.ts index 597ab71..30966fc 100644 --- a/styles/theme.ts +++ b/styles/theme.ts @@ -92,6 +92,7 @@ const fonts = { b5_14_medium_140: FONT({ weight: 500, size: 1.4, height: 1.96, spacing: 0 }), b5_14_regular_140: FONT({ weight: 400, size: 1.4, height: 1.96, spacing: 0 }), b6_13_medium_120: FONT({ weight: 500, size: 1.3, height: 1.56, spacing: 0 }), + b6_13_regular_120: FONT({ weight: 400, size: 1.3, height: 1.56, spacing: 0 }), b7_12_bold_120: FONT({ weight: 700, size: 1.2, height: 1.44, spacing: 0 }), b7_12_medium_140: FONT({ weight: 500, size: 1.2, height: 1.68, spacing: 0 }), b7_12_regular_120: FONT({ weight: 400, size: 1.2, height: 1.44, spacing: 0 }),