From c2545c899198e101a81465b52de74634dcbac90c Mon Sep 17 00:00:00 2001 From: ss0526100 Date: Wed, 23 Oct 2024 17:03:22 +0900 Subject: [PATCH 1/3] =?UTF-8?q?feat:=EB=A3=B0=EB=A0=9B=20=EB=A9=94?= =?UTF-8?q?=EC=84=B8=EC=A7=80=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/pages/Bet/BetDetailPage/BetDetailPage.tsx | 15 ++++++++++++++- .../src/pages/Bet/BetResultPage/BetResultPage.tsx | 14 +++++++++++++- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/frontend/src/pages/Bet/BetDetailPage/BetDetailPage.tsx b/frontend/src/pages/Bet/BetDetailPage/BetDetailPage.tsx index 781b3e1b..35fb5fc0 100644 --- a/frontend/src/pages/Bet/BetDetailPage/BetDetailPage.tsx +++ b/frontend/src/pages/Bet/BetDetailPage/BetDetailPage.tsx @@ -38,6 +38,19 @@ const getIsButtonDisabled = (bet?: BetDetail) => { const bitbit = 'bitbit'; +const getPercentString = (bet: BetDetail) => { + const prefix = + bet.myRole === 'NON_MOIMEE' ? '지금 오면 당첨 확률' : '지금 당첨 확률은'; + const motherNumber = + bet.participants.length + (bet.myRole === 'NON_MOIMEE' ? 1 : 0); + const percentNumber = (1 / motherNumber) * 100; + const percentString = + percentNumber % 1 === 0 + ? percentNumber.toString() + : percentNumber.toFixed(1); + return `${prefix} *${percentString}*%`; +}; + export default function BetDetailPage() { const navigate = useNavigate(); const params = useParams(); @@ -113,7 +126,7 @@ export default function BetDetailPage() { { {nameList && ( diff --git a/frontend/src/pages/Bet/BetResultPage/BetResultPage.tsx b/frontend/src/pages/Bet/BetResultPage/BetResultPage.tsx index 56ee0c7f..4c6b0a6b 100644 --- a/frontend/src/pages/Bet/BetResultPage/BetResultPage.tsx +++ b/frontend/src/pages/Bet/BetResultPage/BetResultPage.tsx @@ -4,6 +4,7 @@ import { useMemo, useState } from 'react'; import { useNavigate, useParams } from 'react-router-dom'; import BackArrowButton from '@_components/Button/BackArrowButton/BackArrowButton'; +import { BetDetail } from '@_types/index'; import Button from '@_components/Button/Button'; import GET_ROUTES from '@_common/getRoutes'; import Roulette from '../components/Roulette/Roulette'; @@ -18,6 +19,17 @@ import useBetResult from '@_hooks/queries/useBetResult'; // import StarThreeIcon from '@_components/Icons/StarIcons/StarThreeIcon'; // import StarTwoIcon from '@_components/Icons/StarIcons/StarTwoIcon'; const bitbit = 'bitbit'; + +const getPercentString = (bet: BetDetail) => { + const motherNumber = bet.participants.length; + const percentNumber = (1 / motherNumber) * 100; + const percentString = + percentNumber % 1 === 0 + ? percentNumber.toString() + : percentNumber.toFixed(1); + return `지금 당첨 확률은 *${percentString}*%`; +}; + export default function BetResultPage() { const navigate = useNavigate(); @@ -83,7 +95,7 @@ export default function BetResultPage() {
{nameList && ( From 456f1c3d828c47a7e3abe6e2689ee77a08f3dcfa Mon Sep 17 00:00:00 2001 From: ss0526100 Date: Wed, 23 Oct 2024 17:04:08 +0900 Subject: [PATCH 2/3] =?UTF-8?q?fix:=EB=A3=B0=EB=A0=9B=20=EC=98=A4=EB=A5=98?= =?UTF-8?q?=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/pages/Bet/components/Roulette/DrawRoulette.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/frontend/src/pages/Bet/components/Roulette/DrawRoulette.ts b/frontend/src/pages/Bet/components/Roulette/DrawRoulette.ts index 996e4a9b..40f025e0 100644 --- a/frontend/src/pages/Bet/components/Roulette/DrawRoulette.ts +++ b/frontend/src/pages/Bet/components/Roulette/DrawRoulette.ts @@ -302,6 +302,8 @@ export default function drawRoulette(props: drawRouletteProps) { const ctx = canvas.getContext('2d'); if (!ctx) return { clearCanvas: () => {} }; + canvas.width = widthPx || canvas.width; + canvas.height = heightPx || canvas.height; const { gpw, gph } = getCanvasUtil(canvas, widthPx, heightPx); const FRAME_SECOND = 20; From 252c835fb0969b5c8a8f4a4f86350f5ce1942c32 Mon Sep 17 00:00:00 2001 From: ss0526100 Date: Wed, 23 Oct 2024 17:11:37 +0900 Subject: [PATCH 3/3] =?UTF-8?q?fix:=20=EC=B1=84=ED=8C=85=EB=B0=A9=20?= =?UTF-8?q?=EB=AF=B8=EB=A6=AC=EB=B3=B4=EA=B8=B0=20=EB=B2=84=EA=B7=B8=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/UserPreview/UserPreview.style.ts | 1 + .../ChattingPreviewContainer.style.ts | 2 +- frontend/src/pages/Chatting/ChatPage/ChatPage.tsx | 4 +--- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/frontend/src/components/UserPreview/UserPreview.style.ts b/frontend/src/components/UserPreview/UserPreview.style.ts index 5d53d36e..3e31fb88 100644 --- a/frontend/src/components/UserPreview/UserPreview.style.ts +++ b/frontend/src/components/UserPreview/UserPreview.style.ts @@ -14,6 +14,7 @@ export const preview = ({ height: ${size || '3.5rem'}; background: url(${imageUrl}), url(${defaultProfile}); + background-color: white; background-repeat: no-repeat; background-position: center center; background-size: 100% 100%; diff --git a/frontend/src/layouts/ChattingPreviewLayout/ChattingPreviewContainer/ChattingPreviewContainer.style.ts b/frontend/src/layouts/ChattingPreviewLayout/ChattingPreviewContainer/ChattingPreviewContainer.style.ts index 0c9b383b..520c7bf1 100644 --- a/frontend/src/layouts/ChattingPreviewLayout/ChattingPreviewContainer/ChattingPreviewContainer.style.ts +++ b/frontend/src/layouts/ChattingPreviewLayout/ChattingPreviewContainer/ChattingPreviewContainer.style.ts @@ -5,7 +5,7 @@ export const Container = ({ theme }: { theme: Theme }) => css` display: flex; flex-direction: column; gap: 2rem; - align-items: center; + align-items: flex-start; justify-content: flex-start; width: 100%; diff --git a/frontend/src/pages/Chatting/ChatPage/ChatPage.tsx b/frontend/src/pages/Chatting/ChatPage/ChatPage.tsx index c2506639..1a16f083 100644 --- a/frontend/src/pages/Chatting/ChatPage/ChatPage.tsx +++ b/frontend/src/pages/Chatting/ChatPage/ChatPage.tsx @@ -35,7 +35,7 @@ export default function ChatPage() { - + setNowChatRoomType('BET')} /> - - {isLoading ? ( ) : chatPreviews && chatPreviews.length > 0 ? (