diff --git a/public/img/img_01.png b/public/img/img_01.png deleted file mode 100644 index 3866e4d..0000000 Binary files a/public/img/img_01.png and /dev/null differ diff --git a/public/img/img_01.svg b/public/img/img_01.svg new file mode 100644 index 0000000..2e5146d --- /dev/null +++ b/public/img/img_01.svg @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/img/img_02.png b/public/img/img_02.png deleted file mode 100644 index 1af9147..0000000 Binary files a/public/img/img_02.png and /dev/null differ diff --git a/public/img/img_02.svg b/public/img/img_02.svg new file mode 100644 index 0000000..be7714c --- /dev/null +++ b/public/img/img_02.svg @@ -0,0 +1,116 @@ + + + + +👍 + +10 + +24 + + +😍 + +24 + + + + + + + + + + + + + + + +추가 + + + + + +👍 + +24 + + +😍 + +12 + + +🎉 + +24 + + +🥺 + +10 + + +🥳 + +8 + + +👏 + +10 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/components/common/ModalWindow.jsx b/src/components/common/ModalWindow.jsx index de7b1be..e152695 100644 --- a/src/components/common/ModalWindow.jsx +++ b/src/components/common/ModalWindow.jsx @@ -1,4 +1,4 @@ -import { useState } from 'react'; +import { useState, useEffect } from 'react'; import styled from 'styled-components'; // import { useKakaoShare } from './useKakaoShare'; @@ -39,6 +39,10 @@ const CloseBtn = styled.button` letter-spacing: -0.16px; position: absolute; bottom: 40px; + + &:hover { + background: var(--Purple-700, #861dee); + } `; const ModalContents = styled.div` @@ -60,6 +64,8 @@ function ModalWindow({ children }) { setModal((prev) => !prev); }; + useEffect(() => {}, [modal]); + return ( modal && ( diff --git a/src/components/main/MainSection.js b/src/components/main/MainSection.js index 73674fe..ec69df4 100644 --- a/src/components/main/MainSection.js +++ b/src/components/main/MainSection.js @@ -13,7 +13,7 @@ const StyledSection = styled.section` margin: 49px 24px; } - @media (max-width: 768px) { + @media (min-width: 360px) and (max-width: 768px) { margin: 42px 24px 37px; } `; @@ -31,7 +31,7 @@ const SectionContainer = styled.div` gap: 36px; } - @media (max-width: 768px) { + @media (min-width: 360px) and (max-width: 768px) { gap: 48px; } `; @@ -40,7 +40,7 @@ const FirstSectionContainer = styled(SectionContainer)` padding: 60px 0 60px 60px; margin-bottom: 30px; - @media (max-width: 1248px) { + @media (min-width: 360px) and (max-width: 1248px) { padding: 0; } `; @@ -49,7 +49,7 @@ const SecondSectionContainer = styled(SectionContainer)` padding: 60px 60px 60px 0; margin-top: 0; - @media (max-width: 1248px) { + @media (min-width: 360px) and (max-width: 1248px) { padding: 0; flex-direction: column-reverse; } @@ -91,7 +91,7 @@ const ArticleContainer = styled.div` } } - @media (max-width: 768px) { + @media (min-width: 360px) and (max-width: 768px) { padding: 24px; } `; @@ -117,7 +117,7 @@ const BtnContainer = styled.div` justify-content: center; margin-bottom: 150px; - @media (max-width: 1248px) { + @media (min-width: 360px) and (max-width: 1248px) { width: 100%; } `; @@ -135,10 +135,10 @@ function MainSection() {

로그인 없이 자유롭게 만들어요.

- 롤링페이퍼 예시 사진 + 롤링페이퍼 예시 사진 - 이모지 예시 사진 + 이모지 예시 사진 Point. 02

diff --git a/src/components/modal/KakaoModal.jsx b/src/components/modal/KakaoModal.jsx index 0c63a5f..122f011 100644 --- a/src/components/modal/KakaoModal.jsx +++ b/src/components/modal/KakaoModal.jsx @@ -6,6 +6,7 @@ function KakaoModal() { position: relative; width: 100%; height: 100%; + background: #ffeea3; `; const KakaoImg = styled.div` diff --git a/src/components/post/SubHeader.jsx b/src/components/post/SubHeader.jsx index 4438fc5..adfc7f7 100644 --- a/src/components/post/SubHeader.jsx +++ b/src/components/post/SubHeader.jsx @@ -1,11 +1,14 @@ import styled, { css } from 'styled-components'; import { useState, useRef, useEffect } from 'react'; +import { useParams } from 'react-router-dom'; import { ToastContainer } from 'react-toastify'; import EmojiDropDown from './subheader/EmojiDropDown'; +import WrittenByIcons from './subheader/WrittenByIcons'; import ShareToggle from '../modal/ShareToggle'; import KakaoModal from '../modal/KakaoModal'; import ModalPortal from '../modal/ModalPortal'; import Toast from '../common/Toast'; +import { getAllMessages } from '../../api/GetApi'; const Text = css` font-family: Pretendard; @@ -119,11 +122,11 @@ const WrittenBy = styled.div` } `; -const WrittenByIcons = styled.span` - width: 76px; - height: 30px; - border: 1px solid black; -`; +// const WrittenByIcons = styled.span` +// width: 76px; +// height: 30px; +// border: 1px solid black; +// `; const SplitBarVertical = styled.div` width: 1px; @@ -185,8 +188,19 @@ function SubHeader({ name, peopleNum }) { const [shareToggle, setShareToggle] = useState(false); const [isKakaoOpen, setIsKakaoOpen] = useState(false); const [isUrlCopy, setIsUrlCopy] = useState(false); + const [messages, setMessages] = useState(null); + const { id } = useParams(); const ref = useRef(); + const handleMessages = async () => { + try { + const result = await getAllMessages(id); + setMessages(result.results); + } catch (error) { + // console.error(error); + } + }; + const handleOutsideClick = (e) => { if (shareToggle && (!ref.current || !ref.current.contains(e.target))) { setShareToggle(false); @@ -200,6 +214,10 @@ function SubHeader({ name, peopleNum }) { }; }, [shareToggle]); + useEffect(() => { + handleMessages(id); + }, []); + const handleClickShare = (e) => { e.preventDefault(); setShareToggle(!shareToggle); @@ -212,7 +230,7 @@ function SubHeader({ name, peopleNum }) { - + {peopleNum}명이 작성했어요! diff --git a/src/components/post/subheader/ProfileUser.jsx b/src/components/post/subheader/ProfileUser.jsx new file mode 100644 index 0000000..a0115c7 --- /dev/null +++ b/src/components/post/subheader/ProfileUser.jsx @@ -0,0 +1,54 @@ +import styled from 'styled-components'; + +function ProfileUser({ src, last, peopleNum }) { + const ProfileContainer = styled.div` + display: flex; + position: relative; + `; + + const ImageBox = styled.div` + width: 28px; + height: 28px; + margin-right: ${last ? '0' : '-24px'}; + + img { + width: 100%; + height: 100%; + border-radius: 140px; + border: 1.4px solid #e3e3e3; + position: relative; + z-index: ${last ? '2' : '1'}; + } + `; + + const RemainBox = styled.div` + width: 28px; + height: 28px; + margin-left: -12px; + background: #fff; + border-radius: 140px; + border: 1.4px solid #e3e3e3; + z-index: 3; + text-align: center; + + p { + font-size: 12px; + color: #484848; + } + `; + + return ( + + + 프로필 이미지 + + {peopleNum > 0 && ( + +

{peopleNum}

+
+ )} +
+ ); +} + +export default ProfileUser; diff --git a/src/components/post/subheader/WrittenByIcons.jsx b/src/components/post/subheader/WrittenByIcons.jsx new file mode 100644 index 0000000..f7aa1ca --- /dev/null +++ b/src/components/post/subheader/WrittenByIcons.jsx @@ -0,0 +1,34 @@ +import ProfileUser from './ProfileUser'; + +function WrittenByIcons({ messages, peopleNum }) { + if (!messages || messages.length === 0) { + return null; // Return early if messages are null or empty + } + + const uniqueUsers = [...new Set(messages.map((message) => message.id))]; + const limitedUsers = uniqueUsers.slice(0, 3); + + return ( + <> + {/* {으앙~} */} + {limitedUsers.map((userId, index) => { + const userMessages = messages.filter( + (message) => message.id === userId, + ); + const last = index === limitedUsers.length - 1; + + return ( + + ); + })} + + ); +} + +export default WrittenByIcons; diff --git a/src/pages/PostId.jsx b/src/pages/PostId.jsx index b57f747..621daac 100644 --- a/src/pages/PostId.jsx +++ b/src/pages/PostId.jsx @@ -27,11 +27,11 @@ const userBackgroundColors = { }; export const PostIdWrapper = styled.div` - background-color: ${(props) => { - const colorInfo = userBackgroundColors[props.color]; + background-color: ${($props) => { + const colorInfo = userBackgroundColors[$props.color]; return colorInfo && colorInfo.background; }}; - background-image: url(${(props) => props.$image || 'none'}); + background-image: url(${($props) => $props.image || 'none'}); background-attachment: fixed; background-size: cover; background-position: center;