From a3194e819e757083fdf37100251e828341d97bdc Mon Sep 17 00:00:00 2001 From: dlsxjzld Date: Sat, 27 Apr 2024 15:31:56 +0900 Subject: [PATCH 1/3] =?UTF-8?q?[=E2=9C=A8feat]:=20highlight.js=20java=20?= =?UTF-8?q?=EC=96=B8=EC=96=B4=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/GamePage/GameCode/CodeContainer.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/GamePage/GameCode/CodeContainer.tsx b/src/pages/GamePage/GameCode/CodeContainer.tsx index 3ade8090..f7b49479 100644 --- a/src/pages/GamePage/GameCode/CodeContainer.tsx +++ b/src/pages/GamePage/GameCode/CodeContainer.tsx @@ -10,7 +10,7 @@ const CodeContainer = ({ codeItem }: CodeContainerProps) => { return ( <>
- {codeItem} + {codeItem}
); From ad8fe77680f1d2a4043e9d1be063b45330c313ad Mon Sep 17 00:00:00 2001 From: dlsxjzld Date: Sat, 27 Apr 2024 15:32:50 +0900 Subject: [PATCH 2/3] =?UTF-8?q?[=E2=99=BB=EF=B8=8Frefactor]:=20=EC=A2=8C?= =?UTF-8?q?=EC=9A=B0=20=EA=B8=B8=EC=9D=B4=EA=B0=80=20=EA=B8=B4=20code=20?= =?UTF-8?q?=EC=9C=A0=ED=98=95=EC=9D=98=20=EB=AC=B8=EC=A0=9C=20=EC=A0=81?= =?UTF-8?q?=EC=A0=88=ED=95=98=EA=B2=8C=20=EB=82=98=EB=88=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/GamePage/GameCode/GameCode.tsx | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/pages/GamePage/GameCode/GameCode.tsx b/src/pages/GamePage/GameCode/GameCode.tsx index ab952d1a..df188abc 100644 --- a/src/pages/GamePage/GameCode/GameCode.tsx +++ b/src/pages/GamePage/GameCode/GameCode.tsx @@ -20,7 +20,19 @@ const GameCode = ({ publishIngame, userId }: GameCodeProps) => { const codeList = useRef(ingameRoomRes.questions!); const convertedCodeList = codeList.current.map(({ question }) => - question.split('\n').map((code) => code.trim()) + question.split('\n').flatMap((code) => { + const trimedCode = code.trim(); + const splitedTrimedCode = trimedCode.split(' '); + const SPLIT_INDEX = Math.floor((splitedTrimedCode.length - 1) / 2); + + if (splitedTrimedCode.length > 1 && trimedCode.length > 50) { + return [ + splitedTrimedCode.slice(0, SPLIT_INDEX).join(' '), + splitedTrimedCode.slice(SPLIT_INDEX).join(' '), + ]; + } + return [trimedCode]; + }) ); const handleNextRound = useCallback(() => { From 679d31898c4f22d90bb298711ccafb5266f3da9f Mon Sep 17 00:00:00 2001 From: dlsxjzld Date: Sat, 27 Apr 2024 15:58:46 +0900 Subject: [PATCH 3/3] =?UTF-8?q?[=E2=99=BB=EF=B8=8Frefactor]:=20=EC=A2=8C?= =?UTF-8?q?=EC=9A=B0=20=EA=B8=B8=EC=9D=B4=20=EA=B8=B0=EC=A4=80=2065?= =?UTF-8?q?=EB=A1=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/GamePage/GameCode/GameCode.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/GamePage/GameCode/GameCode.tsx b/src/pages/GamePage/GameCode/GameCode.tsx index df188abc..b56f2c9c 100644 --- a/src/pages/GamePage/GameCode/GameCode.tsx +++ b/src/pages/GamePage/GameCode/GameCode.tsx @@ -25,7 +25,7 @@ const GameCode = ({ publishIngame, userId }: GameCodeProps) => { const splitedTrimedCode = trimedCode.split(' '); const SPLIT_INDEX = Math.floor((splitedTrimedCode.length - 1) / 2); - if (splitedTrimedCode.length > 1 && trimedCode.length > 50) { + if (splitedTrimedCode.length > 1 && trimedCode.length > 65) { return [ splitedTrimedCode.slice(0, SPLIT_INDEX).join(' '), splitedTrimedCode.slice(SPLIT_INDEX).join(' '),