diff --git a/components/common/Header.tsx b/components/common/Header.tsx index c39d4a6..549e9c1 100644 --- a/components/common/Header.tsx +++ b/components/common/Header.tsx @@ -96,6 +96,10 @@ const StSearchBar = styled.div` background: ${({ theme }) => theme.colors.white_opacity_14}; border-radius: 0.8rem; + & > svg { + cursor: pointer; + } + input { height: 2.2rem; width: 22rem; diff --git a/components/community/CommunityFloatingBtn.tsx b/components/community/CommunityFloatingBtn.tsx new file mode 100644 index 0000000..649379f --- /dev/null +++ b/components/community/CommunityFloatingBtn.tsx @@ -0,0 +1,40 @@ +import { css } from '@emotion/react'; +import styled from '@emotion/styled'; +import Link from 'next/link'; +import { IcWriteBtn, IcTopBtn } from '../../public/assets/icons'; + +export default function CommunityFloatingBtn() { + const handleTopScroll = () => { + if (!window.scrollY) return; + + window.scrollTo({ + top: 0, + behavior: 'smooth', + }); + }; + return ( + + + + + + + ); +} + +const StCommunityFloatingBtnWrapper = styled.section` + display: flex; + flex-direction: column; + row-gap: 2.4rem; + align-items: cetner; + position: sticky; + top: 43rem; + + height: 30rem; + margin-top: 8.8rem; + margin-left: 3.4rem; + + & > svg { + cursor: pointer; + } +`; diff --git a/components/community/CommunityList.tsx b/components/community/CommunityList.tsx index 83fa759..6b5f12c 100644 --- a/components/community/CommunityList.tsx +++ b/components/community/CommunityList.tsx @@ -1,6 +1,9 @@ import styled from '@emotion/styled'; +// import { useState } from 'react'; +import { IcCommunitySearchIcon } from '../../public/assets/icons'; import ContentCard from './ContentsCard'; import { CommunityData } from '../../types/community'; +import CommunityFloatingBtn from './CommunityFloatingBtn'; interface CommunityListProps { contentsList: CommunityData[]; @@ -8,6 +11,9 @@ interface CommunityListProps { export default function CommunityList(props: CommunityListProps) { const { contentsList } = props; +export default function CommunityList() { + // const [category, setCategory] = useState('모든 글'); + return ( {contentsList.map((content, idx) => ( @@ -22,6 +28,42 @@ export default function CommunityList(props: CommunityListProps) { img={content.image} /> ))} + + + + + + + + + + + + + ); } @@ -34,3 +76,45 @@ const StCommunityListWrapper = styled.section` margin-bottom: 4.8rem; `; + + width: 57.6rem; + height: 4.5rem; + border-bottom: 0.2rem solid ${({ theme }) => theme.colors.gray008}; + margin-bottom: 7.9rem; + + input { + margin-left: 0.9rem; + + width: 60rem; + height: 3.3rem; + + font-size: 2.5rem; + + color: ${({ theme }) => theme.colors.gray006}; + ${({ theme }) => theme.fonts.b10_22_regular_150} + + &::placeholder { + font-family: Pretandard; + color: ${({ theme }) => theme.colors.gray006}; + ${({ theme }) => theme.fonts.b10_22_regular_150} + } + + :focus::placeholder { + opacity: 0; + } + } + & > svg { + margin-right: 0.9rem; + + cursor: pointer; + } +`; +const StMainArticle = styled.article` + display: flex; +`; + +const StFloatingBlock = styled.div` + width: 9rem; +`; + +const StContentCardList = styled.div``; diff --git a/components/community/ContentsCard.tsx b/components/community/ContentsCard.tsx index eb38388..ed14da1 100644 --- a/components/community/ContentsCard.tsx +++ b/components/community/ContentsCard.tsx @@ -1,6 +1,6 @@ import styled from '@emotion/styled'; import { useState } from 'react'; -import { IcComment, IcHeart } from '../../public/assets/icons'; +import { IcReply, IcHeart } from '../../public/assets/icons'; interface ContentInfoProps { category: string; @@ -33,11 +33,13 @@ export default function ContentCard(props: ContentInfoProps) { {createdAt} - + {/* + 12 */} + {replyCount} - {img === undefined ? <> : }; + {img === undefined ? <> : } ); } @@ -49,18 +51,20 @@ const StContentsCardWrapper = styled.div` margin-bottom: 4.8rem; padding-bottom: 4.5rem; - width: 120rem; + width: 97.6rem; height: auto; border-bottom: 0.1rem solid #d6d6d6; h1 { - margin-bottom: 1.1rem; + margin-bottom: 0.7rem; font-style: normal; font-weight: 500; font-size: 2.3rem; line-height: 3.3rem; + + ${({ theme }) => theme.fonts.b9_24_medium_150} } p { @@ -70,6 +74,14 @@ const StContentsCardWrapper = styled.div` font-weight: 400; font-size: 1.6rem; line-height: 2.9rem; + + display: -webkit-box; + -webkit-line-clamp: 2; + -webkit-box-orient: vertical; + overflow: hidden; + + color: ${({ theme }) => theme.colors.gray009}; + ${({ theme }) => theme.fonts.t6_17_regular_140} } `; const StContentInfo = styled.section` @@ -82,10 +94,10 @@ const StCategory = styled.div` justify-content: center; align-items: center; - width: 10.2rem; - height: 3.2rem; + width: 7.6rem; + height: 2.6rem; - margin-bottom: 2.6rem; + margin-bottom: 1.6rem; border-radius: 4.5rem; @@ -95,19 +107,24 @@ const StCategory = styled.div` line-height: 2.6rem; color: ${({ theme }) => theme.colors.white}; + ${({ theme }) => theme.fonts.b5_14_medium_140} `; const StCategoryReview = styled(StCategory)` background-color: ${({ theme }) => theme.colors.mainGreen}; `; const StCategoryQuestion = styled(StCategory)` - background-color: ${({ theme }) => theme.colors.black}; + color: ${({ theme }) => theme.colors.gray009}; + background-color: ${({ theme }) => theme.colors.subYellow}; `; const StCategoryInfo = styled(StCategory)` background-color: ${({ theme }) => theme.colors.mainDarkgreen}; `; const StContentImg = styled.img` - width: 26rem; - height: 25.5rem; + width: 21.6rem; + height: 21.6rem; + + border: 0.1rem solid ${({ theme }) => theme.colors.gray005}; + border-radius: 0.5rem; `; const StWriteInfo = styled.div` margin-bottom: 1.2rem; @@ -119,6 +136,9 @@ const StWriteInfo = styled.div` font-weight: 500; font-size: 1.7rem; line-height: 2.5rem; + + color: ${({ theme }) => theme.colors.gray008}; + ${({ theme }) => theme.fonts.b4_15_semibold_146} } span:last-child { @@ -126,6 +146,9 @@ const StWriteInfo = styled.div` font-weight: 350; font-size: 1.7rem; line-height: 2.5rem; + + color: ${({ theme }) => theme.colors.gray008}; + ${({ theme }) => theme.fonts.b4_15_regular_146}; } `; const StReplyInfo = styled.div` @@ -140,5 +163,8 @@ const StReplyInfo = styled.div` font-weight: 400; font-size: 1.76rem; line-height: 2.5rem; + + color: ${({ theme }) => theme.colors.gray008}; + ${({ theme }) => theme.fonts.b4_15_medium_140}; } `; diff --git a/components/community/index.ts b/components/community/index.ts index 164b282..d38f26c 100644 --- a/components/community/index.ts +++ b/components/community/index.ts @@ -1,3 +1,4 @@ export { default as ReplyContent } from './ReplyContent'; export { default as CommunityList } from './CommunityList'; export { default as Reply } from './Reply'; +export { default as CommunityFloatingBtn } from './CommunityFloatingBtn'; diff --git a/public/assets/icons/CommunitySearchIcon.svg b/public/assets/icons/CommunitySearchIcon.svg index af3a3fb..8928e63 100644 --- a/public/assets/icons/CommunitySearchIcon.svg +++ b/public/assets/icons/CommunitySearchIcon.svg @@ -1,3 +1,3 @@ - - + + diff --git a/public/assets/icons/commentIcon.svg b/public/assets/icons/commentIcon.svg deleted file mode 100644 index 561d409..0000000 --- a/public/assets/icons/commentIcon.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/public/assets/icons/heartIcon.svg b/public/assets/icons/heartIcon.svg index 72b00ae..713b208 100644 --- a/public/assets/icons/heartIcon.svg +++ b/public/assets/icons/heartIcon.svg @@ -1,3 +1,13 @@ - - + + + + + + + + + + + + diff --git a/public/assets/icons/index.ts b/public/assets/icons/index.ts index 3d997ef..012060a 100644 --- a/public/assets/icons/index.ts +++ b/public/assets/icons/index.ts @@ -10,6 +10,8 @@ export { default as IcToyMark } from './toyMark.svg'; export { default as IcFillToyMark } from './fillToyMark.svg'; export { default as IcMenu } from './menuIcon.svg'; export { default as IcCommunitySearchIcon } from './communitySearchIcon.svg'; -export { default as IcComment } from './commentIcon.svg'; +export { default as IcReply } from './replyIcon.svg'; export { default as IcHeart } from './heartIcon.svg'; export { default as IcWriteHeaderLogo } from './writeHeaderIcon.svg'; +export { default as IcWriteBtn } from './writeBtnIcon.svg'; +export { default as IcTopBtn } from './topBtnIcon.svg'; diff --git a/public/assets/icons/replyIcon.svg b/public/assets/icons/replyIcon.svg new file mode 100644 index 0000000..a1bad2e --- /dev/null +++ b/public/assets/icons/replyIcon.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/public/assets/icons/topBtnIcon.svg b/public/assets/icons/topBtnIcon.svg new file mode 100644 index 0000000..c47647e --- /dev/null +++ b/public/assets/icons/topBtnIcon.svg @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/public/assets/icons/writeBtnIcon.svg b/public/assets/icons/writeBtnIcon.svg new file mode 100644 index 0000000..c3a2dfc --- /dev/null +++ b/public/assets/icons/writeBtnIcon.svg @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/styles/emotion.d.ts b/styles/emotion.d.ts index cc738b6..c32244c 100644 --- a/styles/emotion.d.ts +++ b/styles/emotion.d.ts @@ -31,6 +31,7 @@ declare module '@emotion/react' { t3_19_medium_130: SerializedStyles; t4_18_semibold_150: SerializedStyles; t4_18_regular_150: SerializedStyles; + t6_17_regular_140: SerializedStyles; b1_20_bold_140: SerializedStyles; b2_18_bold_140: SerializedStyles; b2_18_medium_130: SerializedStyles; @@ -39,12 +40,16 @@ declare module '@emotion/react' { b3_16_semibold_140: SerializedStyles; b3_16_medium_140: SerializedStyles; b4_15_semibold_146: SerializedStyles; + b4_15_regular_146: SerializedStyles; + b4_15_medium_140: SerializedStyles; b5_14_semibold_140: SerializedStyles; b5_14_medium_140: SerializedStyles; b6_13_medium_120: SerializedStyles; b7_12_bold_120: SerializedStyles; b7_12_medium_140: SerializedStyles; b7_12_regular_120: SerializedStyles; + b9_24_medium_150: SerializedStyles; + b10_22_regular_150: SerializedStyles; }; } } diff --git a/styles/theme.ts b/styles/theme.ts index 148354a..aeda002 100644 --- a/styles/theme.ts +++ b/styles/theme.ts @@ -48,6 +48,7 @@ const fonts = { t3_19_medium_130: FONT({ weight: 500, size: 1.8, height: 2.47, spacing: 0 }), t4_18_semibold_150: FONT({ weight: 600, size: 1.8, height: 2.7, spacing: 0 }), t4_18_regular_150: FONT({ weight: 400, size: 1.8, height: 2.7, spacing: 0 }), + t6_17_regular_140: FONT({ weight: 400, size: 1.7, height: 2.38, spacing: 0 }), b1_20_bold_140: FONT({ weight: 700, size: 2, height: 2.8, spacing: 0 }), b2_18_bold_140: FONT({ weight: 700, size: 1.8, height: 2.52, spacing: 0 }), b2_18_medium_130: FONT({ weight: 500, size: 1.8, height: 2.34, spacing: 0 }), @@ -66,6 +67,8 @@ const fonts = { height: 2.19, spacing: 0, }), + b4_15_medium_140: FONT({ weight: 500, size: 1.5, height: 2.1, spacing: 0 }), + b4_15_regular_146: FONT({ weight: 400, size: 1.5, height: 2.19, spacing: 0 }), b5_14_semibold_140: FONT({ weight: 600, size: 1.4, @@ -77,6 +80,8 @@ const fonts = { 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 }), + b9_24_medium_150: FONT({ weight: 500, size: 2.4, height: 3.6, spacing: 0 }), + b10_22_regular_150: FONT({ weight: 400, size: 2.2, height: 3.3, spacing: 0 }), }; const theme: Theme = {