From 656d62fd3fcd17bcdc2e2917964167e3ae4d04ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E1=84=8B=E1=85=B5=E1=84=8C=E1=85=A2=E1=84=92=E1=85=A1?= Date: Tue, 17 Oct 2023 01:29:39 +0900 Subject: [PATCH 1/4] =?UTF-8?q?feat:=20=EC=B0=B8=EC=97=AC=EC=A4=91?= =?UTF-8?q?=EC=9D=BC=EC=8B=9C=20=EC=B9=A9=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/app/vote/[id]/components/ChipContainer.tsx | 5 ++++- .../src/app/vote/[id]/components/VoteDescription.tsx | 1 - apps/jurumarble/src/app/vote/page.tsx | 1 + apps/jurumarble/src/components/Chip.tsx | 11 +++++++++-- 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/apps/jurumarble/src/app/vote/[id]/components/ChipContainer.tsx b/apps/jurumarble/src/app/vote/[id]/components/ChipContainer.tsx index 62001cfa..02cfefde 100644 --- a/apps/jurumarble/src/app/vote/[id]/components/ChipContainer.tsx +++ b/apps/jurumarble/src/app/vote/[id]/components/ChipContainer.tsx @@ -15,6 +15,7 @@ import { formatDate } from "lib/utils/formatDate"; import NonWriterBox from "app/vote/components/NonWriterBox"; import { toast } from "react-toastify"; import useVoteReportService from "../services/useVoteReportService"; +import { AorB } from "lib/apis/vote"; interface Props { title: string; @@ -25,6 +26,7 @@ interface Props { isBookmark: boolean; postedUserId: number; voteId: number; + select: AorB | null; } const ChipContainer = ({ @@ -36,6 +38,7 @@ const ChipContainer = ({ mutateBookMark, isBookmark, postedUserId, + select, }: Props) => { const { userInfo } = useGetUserInfo(); const { onDelete } = useVoteDeleteService(voteId); @@ -53,7 +56,7 @@ const ChipContainer = ({ {region && {region}} - {/* 122명이 즐겼어요 */} + {select && 참여중} {isBookmark ? ( diff --git a/apps/jurumarble/src/app/vote/[id]/components/VoteDescription.tsx b/apps/jurumarble/src/app/vote/[id]/components/VoteDescription.tsx index 2e8a243d..6bfb7ddf 100644 --- a/apps/jurumarble/src/app/vote/[id]/components/VoteDescription.tsx +++ b/apps/jurumarble/src/app/vote/[id]/components/VoteDescription.tsx @@ -58,7 +58,6 @@ function VoteDescription({ drinkAId, drinkBId, }: Props) { - const { userInfo } = useGetUserInfo(); const router = useRouter(); const getAB = (direction: Direction) => { diff --git a/apps/jurumarble/src/app/vote/page.tsx b/apps/jurumarble/src/app/vote/page.tsx index 8120aa9a..b77821bd 100644 --- a/apps/jurumarble/src/app/vote/page.tsx +++ b/apps/jurumarble/src/app/vote/page.tsx @@ -124,6 +124,7 @@ function VoteHomePage() { description={detail} mutateBookMark={mutateBookMark} isBookmark={isBookmark} + select={select.choice} /> css` background-color: ${theme.colors.bg_01}; - color: ${theme.colors.black_02}; + color: ${theme.colors.black_01}; + `} + `, + isVote: css` + ${({ theme }) => css` + background-color: ${theme.colors.bg_01}; + color: ${theme.colors.black_01}; + line-height: 12px; `} `, }; From 7835f70b009d07340fd1ec82f2e7787ea87def03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E1=84=8B=E1=85=B5=E1=84=8C=E1=85=A2=E1=84=92=E1=85=A1?= Date: Tue, 17 Oct 2023 02:08:01 +0900 Subject: [PATCH 2/4] =?UTF-8?q?feat:=20A=20or=20B=20=EC=84=A0=ED=83=9D?= =?UTF-8?q?=EC=8B=9C=20=EC=84=A0=ED=83=9D=EC=A7=80=20=ED=85=8D=EC=8A=A4?= =?UTF-8?q?=ED=8A=B8=20=EC=BB=AC=EB=9F=AC=EB=8F=84=20=EA=B0=99=EC=9D=B4=20?= =?UTF-8?q?=EB=B3=80=ED=95=98=EA=B2=8C=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../vote/[id]/components/VoteDescription.tsx | 41 +++++++++++-------- 1 file changed, 23 insertions(+), 18 deletions(-) diff --git a/apps/jurumarble/src/app/vote/[id]/components/VoteDescription.tsx b/apps/jurumarble/src/app/vote/[id]/components/VoteDescription.tsx index 6bfb7ddf..2dd65674 100644 --- a/apps/jurumarble/src/app/vote/[id]/components/VoteDescription.tsx +++ b/apps/jurumarble/src/app/vote/[id]/components/VoteDescription.tsx @@ -1,16 +1,14 @@ import AorBMark from "components/AorBMark"; -import { postExecuteVote } from "lib/apis/vote"; import Path from "lib/Path"; import { media } from "lib/styles"; import depths from "lib/styles/depths"; -import Image, { StaticImageData } from "next/image"; -import { useParams, useRouter } from "next/navigation"; +import Image from "next/image"; +import { useRouter } from "next/navigation"; import { ExImg1 } from "public/images"; import React from "react"; -import useGetUserInfo from "services/useGetUserInfo"; -import SvgIcPrev from "src/assets/icons/components/IcPrev"; +import { SvgArrowDown, SvgIcCheck } from "src/assets/icons/components"; +import SvgIcExpandMore from "src/assets/icons/components/IcExpandMore"; import styled, { css } from "styled-components"; -import useExecuteVoteService from "../services/useExecuteVoteService"; type AorB = "A" | "B"; type ActiveType = "active" | "inactive" | null; @@ -130,9 +128,14 @@ function VoteDescription({ - {titleA} - - {titleB} + + {select === "A" && } + {titleA} + + + {select === "B" && } + {titleB} + ); @@ -150,16 +153,17 @@ const ImageWrapper = styled.div` gap: 9px; `; -const SmallTitle = styled.div` - margin-top: 20px; - padding: 4px; - width: 100%; - display: flex; - align-items: center; - gap: 8px; - ${({ theme }) => css` - border-bottom: 1px solid ${theme.colors.line_01}; +const SmallTitle = styled.div<{ isSelect: boolean }>` + ${({ theme, isSelect }) => css` ${theme.typography.body_long03} + color: ${isSelect ? theme.colors.main_01 : theme.colors.black_01}; + border-bottom: 1px solid ${theme.colors.line_01}; + margin-top: 20px; + padding: 4px; + width: 100%; + display: flex; + align-items: center; + gap: 8px; `}; `; @@ -271,6 +275,7 @@ const VoteImageWrapper = styled.div` flex-direction: column; align-items: center; justify-content: center; + border-radius: 10px; ${media.medium} { height: 340px; From e0919c531bda7ffafaf82c9065aa9edd90706d91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E1=84=8B=E1=85=B5=E1=84=8C=E1=85=A2=E1=84=92=E1=85=A1?= Date: Tue, 17 Oct 2023 02:08:38 +0900 Subject: [PATCH 3/4] =?UTF-8?q?feat:=20=EC=B0=B8=EC=97=AC=ED=95=9C=20?= =?UTF-8?q?=ED=88=AC=ED=91=9C=20=EC=9D=B8=EC=9B=90=20=ED=91=9C=EC=8B=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/jurumarble/src/app/search/components/ChipContainer.tsx | 5 +++-- apps/jurumarble/src/app/search/components/DrinkVoteItem.tsx | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/apps/jurumarble/src/app/search/components/ChipContainer.tsx b/apps/jurumarble/src/app/search/components/ChipContainer.tsx index 1ff0a1cb..d08530c8 100644 --- a/apps/jurumarble/src/app/search/components/ChipContainer.tsx +++ b/apps/jurumarble/src/app/search/components/ChipContainer.tsx @@ -11,15 +11,16 @@ interface Props { region: string; mutateBookMark: UseMutateFunction; isBookmark: boolean; + votedCount: number; } -const ChipContainer = ({ date, title, region, mutateBookMark, isBookmark }: Props) => { +const ChipContainer = ({ date, title, region, mutateBookMark, isBookmark, votedCount }: Props) => { return ( <> {region && {region}} - 122명이 즐겼어요 + {votedCount}명이 즐겼어요 {isBookmark ? ( diff --git a/apps/jurumarble/src/app/search/components/DrinkVoteItem.tsx b/apps/jurumarble/src/app/search/components/DrinkVoteItem.tsx index 9784430d..c61ec0d8 100644 --- a/apps/jurumarble/src/app/search/components/DrinkVoteItem.tsx +++ b/apps/jurumarble/src/app/search/components/DrinkVoteItem.tsx @@ -14,7 +14,7 @@ interface Props { * @Todo 타입 더 깔끔하게 정의 필요 */ function DrinkVoteItem({ voteDrink }: Props) { - const { voteId, region, title, imageA, imageB } = voteDrink; + const { voteId, region, title, imageA, imageB, votedCount } = voteDrink; const { isBookmark, mutateBookMark } = useBookmarkService(voteId); @@ -31,6 +31,7 @@ function DrinkVoteItem({ voteDrink }: Props) { region={region} mutateBookMark={mutateBookMark} isBookmark={isBookmark} + votedCount={votedCount} /> From dae84443d60d0bc081014a29eebaa354d9d3bd36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E1=84=8B=E1=85=B5=E1=84=8C=E1=85=A2=E1=84=92=E1=85=A1?= Date: Tue, 17 Oct 2023 02:16:37 +0900 Subject: [PATCH 4/4] =?UTF-8?q?feat:=20=ED=88=AC=ED=91=9C=20=EC=83=81?= =?UTF-8?q?=EC=84=B8=20=ED=8E=98=EC=9D=B4=EC=A7=80=EC=97=90=EB=8F=84=20?= =?UTF-8?q?=EC=B0=B8=EC=97=AC=20=EC=97=AC=EB=B6=80=EB=A5=BC=20=EC=95=8C=20?= =?UTF-8?q?=EC=88=98=20=EC=9E=88=EB=8A=94=20=EC=B9=A9=20=EC=B6=94=EA=B8=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/app/vote/[id]/components/VoteDescription.tsx | 3 +-- apps/jurumarble/src/app/vote/[id]/page.tsx | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/jurumarble/src/app/vote/[id]/components/VoteDescription.tsx b/apps/jurumarble/src/app/vote/[id]/components/VoteDescription.tsx index 2dd65674..0a757ee6 100644 --- a/apps/jurumarble/src/app/vote/[id]/components/VoteDescription.tsx +++ b/apps/jurumarble/src/app/vote/[id]/components/VoteDescription.tsx @@ -6,8 +6,7 @@ import Image from "next/image"; import { useRouter } from "next/navigation"; import { ExImg1 } from "public/images"; import React from "react"; -import { SvgArrowDown, SvgIcCheck } from "src/assets/icons/components"; -import SvgIcExpandMore from "src/assets/icons/components/IcExpandMore"; +import { SvgIcCheck } from "src/assets/icons/components"; import styled, { css } from "styled-components"; type AorB = "A" | "B"; diff --git a/apps/jurumarble/src/app/vote/[id]/page.tsx b/apps/jurumarble/src/app/vote/[id]/page.tsx index b602a273..dccba602 100644 --- a/apps/jurumarble/src/app/vote/[id]/page.tsx +++ b/apps/jurumarble/src/app/vote/[id]/page.tsx @@ -126,6 +126,7 @@ function Detail() { mutateBookMark={mutateBookMark} isBookmark={isBookmark} postedUserId={data.postedUserId} + select={select.choice} />