diff --git a/__mocks__/handlers/boardHandlers.ts b/__mocks__/handlers/boardHandlers.ts index ef06f7d..5007c0a 100644 --- a/__mocks__/handlers/boardHandlers.ts +++ b/__mocks__/handlers/boardHandlers.ts @@ -10,7 +10,7 @@ interface BoardsInfo { [key: string]: { myMatchRound: number; myMatchId: number; - channelBoardLoadDtdList: Channels[]; + channelBoardLoadDtoList: Channels[]; }; } @@ -45,7 +45,7 @@ const boardsInfo: BoardsInfo = { '123': { myMatchRound: 0, myMatchId: 0, - channelBoardLoadDtdList: [ + channelBoardLoadDtoList: [ { boardId: 'aaa', boardTitle: '공지사항', @@ -66,7 +66,7 @@ const boardsInfo: BoardsInfo = { '234': { myMatchRound: 1, myMatchId: 1, - channelBoardLoadDtdList: [ + channelBoardLoadDtoList: [ { boardId: 'bbb', boardTitle: '리그 공지사항', @@ -87,7 +87,7 @@ const boardsInfo: BoardsInfo = { '456': { myMatchRound: 2, myMatchId: 2, - channelBoardLoadDtdList: [ + channelBoardLoadDtoList: [ { boardId: 'eee', boardTitle: '리그 공지사항', diff --git a/__mocks__/handlers/matchHandlers.ts b/__mocks__/handlers/matchHandlers.ts index 60b01d2..50c3c44 100644 --- a/__mocks__/handlers/matchHandlers.ts +++ b/__mocks__/handlers/matchHandlers.ts @@ -105,7 +105,7 @@ const players: GetMatchPlayerScoreInfos = { matchPlayerResultStatus: '진행중', }, ], - matchMessage: [ + matchMessages: [ { channelId: 123, content: '안녕하세요', diff --git a/src/components/RoundCheckIn/CallAdminChat.tsx b/src/components/RoundCheckIn/CallAdminChat.tsx index b8c3245..4e21cc3 100644 --- a/src/components/RoundCheckIn/CallAdminChat.tsx +++ b/src/components/RoundCheckIn/CallAdminChat.tsx @@ -5,12 +5,13 @@ import Image from 'next/image'; import { Client } from '@stomp/stompjs'; import React, { useEffect, useState, ChangeEvent } from 'react'; import { useRouter } from 'next/router'; +import { BASE_PROFILE_IMG } from '@config/index'; interface CallAdminChatProps { client: Client | undefined; matchId: string; players: MatchPlayerScoreInfos[]; - matchMessage: MatchMessages[]; + matchMessages: MatchMessages[]; requestUser: number; } @@ -18,7 +19,7 @@ const CallAdminChat = ({ client, matchId, players, - matchMessage, + matchMessages, requestUser, }: CallAdminChatProps) => { const [chats, setChats] = useState([]); @@ -60,13 +61,13 @@ const CallAdminChat = ({ const findUserIMG = (playerParticipantId: number): string => { const user = players.find((player) => player.participantId === playerParticipantId); - if (!user) return ''; + if (!user) return BASE_PROFILE_IMG; return user.profileSrc; }; const findUserName = (playerParticipantId: number): string => { const user = players.find((player) => player.participantId === playerParticipantId); - if (!user) return ''; + if (!user) return '관리자'; return user.gameId; }; @@ -88,9 +89,9 @@ const CallAdminChat = ({ }, [client]); useEffect(() => { - if (!matchMessage || matchMessage.length === 0) return; - setChats(matchMessage); - }, [matchMessage]); + if (!matchMessages || matchMessages.length === 0) return; + setChats(matchMessages); + }, [matchMessages]); return ( diff --git a/src/components/RoundCheckIn/CheckInPage.tsx b/src/components/RoundCheckIn/CheckInPage.tsx index deb4394..5694808 100644 --- a/src/components/RoundCheckIn/CheckInPage.tsx +++ b/src/components/RoundCheckIn/CheckInPage.tsx @@ -10,7 +10,7 @@ interface CheckInPageProps { client: Client | undefined; matchId: string; players: MatchPlayerScoreInfos[]; - matchMessage: MatchMessages[]; + matchMessages: MatchMessages[]; requestUser: number; checkInUser: number[]; currentMatchRound: number; @@ -21,7 +21,7 @@ const CheckInPage = ({ client, matchId, players, - matchMessage, + matchMessages, requestUser, checkInUser, currentMatchRound, @@ -105,7 +105,7 @@ const CheckInPage = ({ client={client} matchId={matchId} players={players} - matchMessage={matchMessage} + matchMessages={matchMessages} requestUser={requestUser} /> diff --git a/src/components/RoundCheckIn/index.tsx b/src/components/RoundCheckIn/index.tsx index 5920c25..6cbb037 100644 --- a/src/components/RoundCheckIn/index.tsx +++ b/src/components/RoundCheckIn/index.tsx @@ -36,7 +36,7 @@ export interface GetMatchPlayerScoreInfos { matchCurrentSet: number; matchSetCount: number; matchPlayerInfos: MatchPlayerScoreInfos[]; - matchMessage: MatchMessages[]; + matchMessages: MatchMessages[]; } interface RoundCheckInProps { @@ -176,7 +176,7 @@ const RoundCheckIn = ({ channelLink, matchId }: RoundCheckInProps) => { client={client} matchId={matchId} players={matchPlayers ? matchPlayers.matchPlayerInfos : []} - matchMessage={matchPlayers ? matchPlayers.matchMessage : []} + matchMessages={matchPlayers ? matchPlayers.matchMessages : []} requestUser={matchPlayers ? matchPlayers.requestMatchPlayerId : -1} checkInUser={checkInUser} currentMatchRound={matchPlayers ? matchPlayers.matchCurrentSet : -1} diff --git a/src/config/index.ts b/src/config/index.ts index 97f0f53..ebdcc87 100644 --- a/src/config/index.ts +++ b/src/config/index.ts @@ -5,4 +5,7 @@ if (process.env.NODE_ENV === 'development') { SERVER_URL = 'http://localhost:8080'; } -export { SERVER_URL, SOCKET_URL }; +const BASE_PROFILE_IMG = + 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAOEAAADhCAMAAAAJbSJIAAAAdVBMVEX////MzMxNTU3JycnOzs7R0dFLS0tCQkJISEjT09M9PT1FRUXm5ubq6upAQEDj4+P4+Pja2tq3t7ewsLA6OjpqampTU1PDw8OFhYXy8vJ0dHSVlZW/v79/f3+tra1jY2OdnZ1dXV2NjY2AgIB3d3cyMjKkpKSyTp11AAAIfElEQVR4nO2diXKjOBCGjd3itPHB4fiI8TV5/0dcMEnGydjhbyQB2eq/aqumamoHPkvqS1IzGolEIpFIJBKJRCKRSCQSiUQikUgkEolEIpFIJBL937RYbGbT+XxZaT6fzjabRd+vZEyLzXypHGfyLufzj45azn8952K6pJrqscq/o+X011LOKrqncPeYtJz1/bJ8zQKI7u9YBr8KcrOs8AgnrCmXm75fHNRMcYbvC6P6DQM5p3Z475A07xugQXNHh+/G6AyZcdpyen6HnPYN8kQzrfn5BZGGuB4XgSm+G2MwuDBgapLvxjisqVoOINP7AYhDGsaZ6QF8ZxzMalzaASwRl32j3bRQ5mfoJyINYKZuWgwg4xeZ9B6rGrehX0W929Q5A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fB6BNNT/bsjXcaxIf0Fi+2FmPaq4251yq1Enmnq77B/mpWmHcbYTGYj5LdlGg1GvhXftq7Df2u2dbganTT67AGsNYk1+lFd684t7u/1F5JaqIW5YWDm6B3emt51eJTrue99Q3xsxaHsUZRww3zwwC+B9ikfdFysvppse/75UEtzzE7/ffj+DyMT1aCWl/T8IdPWX3HC9NrT4UKDS0m5/Efr5HS9b0/+bnbaq9BzZPXPE6fYZZwaZy/JoPIHzQ0cw6Xwk/DOPa8qJbnxWEY+sXl4AwxdGmnzZz2yeF43O12x+Mh2dO890+oikQikUgkEolEIpFIJBKJRCKRSCQSiUQikUgkEhnXf0N8pV5TYj8dAAAAAElFTkSuQmCC'; + +export { SERVER_URL, SOCKET_URL, BASE_PROFILE_IMG }; diff --git a/src/contexts/CustomContextMenu.tsx b/src/contexts/CustomContextMenu.tsx new file mode 100644 index 0000000..26cf7cb --- /dev/null +++ b/src/contexts/CustomContextMenu.tsx @@ -0,0 +1,30 @@ +import React from 'react'; +import styled from '@emotion/styled'; + +interface CustomContextMenuProps { + x: number; + y: number; +} + +const CustomContextMenu = ({ x, y }: CustomContextMenuProps) => { + return ( + +
    +
  • 메뉴 항목 1
  • +
  • 메뉴 항목 2
  • + {/* 추가적인 메뉴 항목들 */} +
+
+ ); +}; + +export default CustomContextMenu; + +const ContextMenu = styled.div` + position: absolute; + background-color: #ffffff; + border: 1px solid #ccc; + padding: 5px 10px; + z-index: 1000; + color: black; +`;