diff --git a/storybook/129.d38f3997.iframe.bundle.js b/storybook/129.d38f3997.iframe.bundle.js new file mode 100644 index 000000000..e6dcc566b --- /dev/null +++ b/storybook/129.d38f3997.iframe.bundle.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkddangkong_frontend=self.webpackChunkddangkong_frontend||[]).push([[129],{"./src/components/ReadyMembersContainer/ReadyMembersContainer.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>ReadyMembersContainer_ReadyMembersContainer});__webpack_require__("./node_modules/core-js/modules/esnext.iterator.map.js");var react=__webpack_require__("./node_modules/react/index.js"),es=__webpack_require__("./node_modules/recoil/es/index.js"),emotion_react_browser_esm=__webpack_require__("./node_modules/@emotion/react/dist/emotion-react.browser.esm.js"),Theme=__webpack_require__("./src/styles/Theme.ts"),getBorderRadius=__webpack_require__("./src/styles/utils/getBorderRadius.ts");const readyMembersContainerLayout={name:"ch4q08",styles:"display:flex;flex-direction:column;gap:2rem;width:100%"},membersContainer=(0,emotion_react_browser_esm.AH)("position:relative;height:25rem;padding:2rem 3rem 0;border-radius:2rem;background-color:",Theme.S.color.peanut300,";font-weight:600;font-size:1rem;overflow-y:scroll;scrollbar-width:none;-ms-overflow-style:none;&::-webkit-scrollbar{display:none;}",""),totalNumber={name:"eu54mg",styles:"display:flex;justify-content:space-between;align-items:center;padding-left:2rem;font-weight:900;font-size:2rem"},memberList={name:"10zw2ye",styles:"display:flex;flex-direction:column;gap:2rem"},inviteButton=(0,emotion_react_browser_esm.AH)("width:12rem;height:4rem;border-radius:",(0,getBorderRadius.A)("medium"),";background-color:",Theme.S.color.peanut400,";font-weight:700;",""),memberItem={name:"15umcqw",styles:"display:flex;align-items:center;gap:2rem"},profileBox={name:"1bezcfz",styles:"display:flex;justify-content:center;align-items:center;width:3.6rem;height:3.6rem;border-radius:50%;background-color:white"},profileImage={name:"xjt14x",styles:"width:60%"},memberStatus={name:"mk4uq1",styles:"display:flex;flex:1;justify-content:space-between;align-items:center"};var A11yOnly=__webpack_require__("./src/components/common/a11yOnly/A11yOnly.tsx");const crownIcon_namespaceObject=__webpack_require__.p+"static/media/crownIcon.1ef721d9.webp";var sillyDdangkongMedium=__webpack_require__("./src/assets/images/sillyDdangkongMedium.webp"),InviteModal=__webpack_require__("./src/components/common/InviteModal/InviteModal.tsx"),useGetRoomInfo=__webpack_require__("./src/hooks/useGetRoomInfo.ts"),useModal=__webpack_require__("./src/hooks/useModal.ts"),atom=__webpack_require__("./src/recoil/atom.ts"),emotion_react_jsx_runtime_browser_esm=__webpack_require__("./node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js");const ReadyMembersContainer=()=>{const{members,master}=(0,useGetRoomInfo.$)(),{show}=(0,useModal.A)(),[memberInfo,setMemberInfo]=(0,es.L4)(atom.u),returnFocusRef=(0,react.useRef)(null),memberCountMessage=`총 인원 ${members.length}명`;return(0,react.useEffect)((()=>{memberInfo.isMaster||master.memberId!==memberInfo.memberId||setMemberInfo({...memberInfo,isMaster:!0})}),[master.memberId,memberInfo,setMemberInfo]),(0,emotion_react_jsx_runtime_browser_esm.FD)("section",{css:readyMembersContainerLayout,children:[(0,emotion_react_jsx_runtime_browser_esm.FD)("div",{css:totalNumber,children:[(0,emotion_react_jsx_runtime_browser_esm.Y)("div",{role:"status",children:memberCountMessage}),(0,emotion_react_jsx_runtime_browser_esm.Y)("button",{css:inviteButton,onClick:()=>{show(InviteModal.A,{returnFocusRef})},ref:returnFocusRef,children:"초대하기"})]}),(0,emotion_react_jsx_runtime_browser_esm.Y)("section",{css:membersContainer,children:(0,emotion_react_jsx_runtime_browser_esm.Y)("ul",{css:memberList,children:members.map((member=>(0,emotion_react_jsx_runtime_browser_esm.FD)("li",{css:memberItem,children:[(0,emotion_react_jsx_runtime_browser_esm.Y)(A11yOnly.A,{children:`${member.isMaster?"방장":""} ${member.nickname}`}),(0,emotion_react_jsx_runtime_browser_esm.Y)("div",{css:profileBox,children:(0,emotion_react_jsx_runtime_browser_esm.Y)("img",{src:sillyDdangkongMedium,alt:"",css:profileImage})}),(0,emotion_react_jsx_runtime_browser_esm.FD)("div",{css:memberStatus,children:[(0,emotion_react_jsx_runtime_browser_esm.Y)("span",{"aria-hidden":!0,children:member.nickname}),member.isMaster&&(0,emotion_react_jsx_runtime_browser_esm.Y)("img",{src:crownIcon_namespaceObject,alt:""})]})]},member.memberId)))})})]})},ReadyMembersContainer_ReadyMembersContainer=ReadyMembersContainer;ReadyMembersContainer.__docgenInfo={description:"",methods:[],displayName:"ReadyMembersContainer"}},"./src/components/common/a11yOnly/A11yOnly.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>a11yOnly_A11yOnly});const a11yOnlyLayout={name:"90pyz3",styles:"overflow:hidden;position:absolute;width:1px;height:1px;margin:-1px;padding:0;border:0;white-space:nowrap;clip:rect(0, 0, 0, 0)"};var emotion_react_jsx_runtime_browser_esm=__webpack_require__("./node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js");const A11yOnly=({as,children,...props})=>{const Component=as||"span";return(0,emotion_react_jsx_runtime_browser_esm.Y)(Component,{css:a11yOnlyLayout,...props,children})},a11yOnly_A11yOnly=A11yOnly;A11yOnly.__docgenInfo={description:"",methods:[],displayName:"A11yOnly",props:{as:{required:!1,tsType:{name:"T"},description:""},role:{required:!1,tsType:{name:"AriaRole"},description:""}}}},"./src/hooks/useModal.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>__WEBPACK_DEFAULT_EXPORT__});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),_providers_ModalProvider_ModalProvider__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/providers/ModalProvider/ModalProvider.tsx");const __WEBPACK_DEFAULT_EXPORT__=()=>{const dispatch=(0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(_providers_ModalProvider_ModalProvider__WEBPACK_IMPORTED_MODULE_1__.L);if(null===dispatch)throw new Error("ModalDispatchContext가 존재하지 않습니다.");return dispatch}},"./src/styles/utils/getBorderRadius.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>__WEBPACK_DEFAULT_EXPORT__});var _styles_Theme__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./src/styles/Theme.ts");const __WEBPACK_DEFAULT_EXPORT__=radius=>{switch(radius){case"small":return _styles_Theme__WEBPACK_IMPORTED_MODULE_0__.S.borderRadius.radius10;case"medium":return _styles_Theme__WEBPACK_IMPORTED_MODULE_0__.S.borderRadius.radius20;case"large":return _styles_Theme__WEBPACK_IMPORTED_MODULE_0__.S.borderRadius.radius30;default:return"0"}}},"./src/assets/images/sillyDdangkongMedium.webp":(module,__unused_webpack_exports,__webpack_require__)=>{module.exports=__webpack_require__.p+"static/media/sillyDdangkongMedium.9937535c.webp"}}]); \ No newline at end of file diff --git a/storybook/129.ec8af5c4.iframe.bundle.js b/storybook/129.ec8af5c4.iframe.bundle.js deleted file mode 100644 index 90bbb6b91..000000000 --- a/storybook/129.ec8af5c4.iframe.bundle.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkddangkong_frontend=self.webpackChunkddangkong_frontend||[]).push([[129],{"./src/components/ReadyMembersContainer/ReadyMembersContainer.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>ReadyMembersContainer_ReadyMembersContainer});__webpack_require__("./node_modules/core-js/modules/esnext.iterator.map.js");var react=__webpack_require__("./node_modules/react/index.js"),es=__webpack_require__("./node_modules/recoil/es/index.js"),emotion_react_browser_esm=__webpack_require__("./node_modules/@emotion/react/dist/emotion-react.browser.esm.js"),Theme=__webpack_require__("./src/styles/Theme.ts"),getBorderRadius=__webpack_require__("./src/styles/utils/getBorderRadius.ts");const readyMembersContainerLayout={name:"ch4q08",styles:"display:flex;flex-direction:column;gap:2rem;width:100%"},membersContainer=(0,emotion_react_browser_esm.AH)("position:relative;height:25rem;padding:2rem 3rem 0;border-radius:2rem;background-color:",Theme.S.color.peanut300,";font-weight:600;font-size:1rem;overflow-y:scroll;scrollbar-width:none;-ms-overflow-style:none;&::-webkit-scrollbar{display:none;}",""),totalNumber={name:"eu54mg",styles:"display:flex;justify-content:space-between;align-items:center;padding-left:2rem;font-weight:900;font-size:2rem"},memberList={name:"10zw2ye",styles:"display:flex;flex-direction:column;gap:2rem"},inviteButton=(0,emotion_react_browser_esm.AH)("width:12rem;height:4rem;border-radius:",(0,getBorderRadius.A)("medium"),";background-color:",Theme.S.color.peanut400,";font-weight:700;",""),memberItem={name:"15umcqw",styles:"display:flex;align-items:center;gap:2rem"},profileBox={name:"1bezcfz",styles:"display:flex;justify-content:center;align-items:center;width:3.6rem;height:3.6rem;border-radius:50%;background-color:white"},profileImage={name:"xjt14x",styles:"width:60%"},memberStatus={name:"mk4uq1",styles:"display:flex;flex:1;justify-content:space-between;align-items:center"};var A11yOnly=__webpack_require__("./src/components/common/a11yOnly/A11yOnly.tsx");const crownIcon_namespaceObject=__webpack_require__.p+"static/media/crownIcon.1ef721d9.webp";var sillyDdangkongMedium=__webpack_require__("./src/assets/images/sillyDdangkongMedium.webp"),InviteModal=__webpack_require__("./src/components/common/InviteModal/InviteModal.tsx"),useGetRoomInfo=__webpack_require__("./src/hooks/useGetRoomInfo.ts"),useModal=__webpack_require__("./src/hooks/useModal.ts"),atom=__webpack_require__("./src/recoil/atom.ts"),emotion_react_jsx_runtime_browser_esm=__webpack_require__("./node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js");const ReadyMembersContainer=()=>{const{members,master}=(0,useGetRoomInfo.$)(),{show}=(0,useModal.A)(),[memberInfo,setMemberInfo]=(0,es.L4)(atom.u),returnFocusRef=(0,react.useRef)(null);return(0,react.useEffect)((()=>{memberInfo.isMaster||master.memberId!==memberInfo.memberId||setMemberInfo({...memberInfo,isMaster:!0})}),[master.memberId,memberInfo,setMemberInfo]),(0,emotion_react_jsx_runtime_browser_esm.FD)("section",{css:readyMembersContainerLayout,children:[(0,emotion_react_jsx_runtime_browser_esm.FD)(A11yOnly.A,{"aria-live":"polite",children:["총 인원 ",members.length,"명"]}),(0,emotion_react_jsx_runtime_browser_esm.FD)("div",{css:totalNumber,children:[(0,emotion_react_jsx_runtime_browser_esm.FD)("div",{"aria-hidden":!0,children:["총 인원 ",members.length,"명"]}),(0,emotion_react_jsx_runtime_browser_esm.Y)("button",{css:inviteButton,onClick:()=>{show(InviteModal.A,{returnFocusRef})},ref:returnFocusRef,children:"초대하기"})]}),(0,emotion_react_jsx_runtime_browser_esm.Y)("section",{css:membersContainer,children:(0,emotion_react_jsx_runtime_browser_esm.Y)("ul",{css:memberList,children:members.map((member=>(0,emotion_react_jsx_runtime_browser_esm.FD)("li",{css:memberItem,children:[(0,emotion_react_jsx_runtime_browser_esm.Y)(A11yOnly.A,{children:`${member.isMaster?"방장":""} ${member.nickname}`}),(0,emotion_react_jsx_runtime_browser_esm.Y)("div",{css:profileBox,children:(0,emotion_react_jsx_runtime_browser_esm.Y)("img",{src:sillyDdangkongMedium,alt:"",css:profileImage})}),(0,emotion_react_jsx_runtime_browser_esm.FD)("div",{css:memberStatus,children:[(0,emotion_react_jsx_runtime_browser_esm.Y)("span",{"aria-hidden":!0,children:member.nickname}),member.isMaster&&(0,emotion_react_jsx_runtime_browser_esm.Y)("img",{src:crownIcon_namespaceObject,alt:""})]})]},member.memberId)))})})]})},ReadyMembersContainer_ReadyMembersContainer=ReadyMembersContainer;ReadyMembersContainer.__docgenInfo={description:"",methods:[],displayName:"ReadyMembersContainer"}},"./src/components/common/a11yOnly/A11yOnly.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>a11yOnly_A11yOnly});const a11yOnlyLayout={name:"90pyz3",styles:"overflow:hidden;position:absolute;width:1px;height:1px;margin:-1px;padding:0;border:0;white-space:nowrap;clip:rect(0, 0, 0, 0)"};var emotion_react_jsx_runtime_browser_esm=__webpack_require__("./node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js");const A11yOnly=({as,role="text",children,...props})=>{const Component=as||"span";return(0,emotion_react_jsx_runtime_browser_esm.Y)(Component,{css:a11yOnlyLayout,role,...props,children})},a11yOnly_A11yOnly=A11yOnly;A11yOnly.__docgenInfo={description:"",methods:[],displayName:"A11yOnly",props:{as:{required:!1,tsType:{name:"T"},description:""},role:{required:!1,tsType:{name:"AriaRole"},description:"",defaultValue:{value:"'text'",computed:!1}}}}},"./src/hooks/useModal.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>__WEBPACK_DEFAULT_EXPORT__});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),_providers_ModalProvider_ModalProvider__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/providers/ModalProvider/ModalProvider.tsx");const __WEBPACK_DEFAULT_EXPORT__=()=>{const dispatch=(0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(_providers_ModalProvider_ModalProvider__WEBPACK_IMPORTED_MODULE_1__.L);if(null===dispatch)throw new Error("ModalDispatchContext가 존재하지 않습니다.");return dispatch}},"./src/styles/utils/getBorderRadius.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>__WEBPACK_DEFAULT_EXPORT__});var _styles_Theme__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./src/styles/Theme.ts");const __WEBPACK_DEFAULT_EXPORT__=radius=>{switch(radius){case"small":return _styles_Theme__WEBPACK_IMPORTED_MODULE_0__.S.borderRadius.radius10;case"medium":return _styles_Theme__WEBPACK_IMPORTED_MODULE_0__.S.borderRadius.radius20;case"large":return _styles_Theme__WEBPACK_IMPORTED_MODULE_0__.S.borderRadius.radius30;default:return"0"}}},"./src/assets/images/sillyDdangkongMedium.webp":(module,__unused_webpack_exports,__webpack_require__)=>{module.exports=__webpack_require__.p+"static/media/sillyDdangkongMedium.9937535c.webp"}}]); \ No newline at end of file diff --git a/storybook/596.8bc7d98c.iframe.bundle.js b/storybook/596.8bc7d98c.iframe.bundle.js new file mode 100644 index 000000000..a372f22ae --- /dev/null +++ b/storybook/596.8bc7d98c.iframe.bundle.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkddangkong_frontend=self.webpackChunkddangkong_frontend||[]).push([[596],{"./src/apis/balanceContent.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Gd:()=>fetchBalanceContent,O:()=>fetchRoundVoteResult,bR:()=>checkMyGameStatus,jd:()=>fetchVoteIsFinished,sl:()=>voteBalanceContent});var _fetcher__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./src/apis/fetcher.ts"),_constants_url__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/constants/url.ts");const fetchBalanceContent=async roomId=>{const res=await _fetcher__WEBPACK_IMPORTED_MODULE_0__.A.get({url:_constants_url__WEBPACK_IMPORTED_MODULE_1__.H$.balanceContent(roomId)});return await res.json()},voteBalanceContent=async({optionId,contentId,roomId,memberId})=>{const res=await _fetcher__WEBPACK_IMPORTED_MODULE_0__.A.post({url:_constants_url__WEBPACK_IMPORTED_MODULE_1__.H$.vote(roomId,contentId),headers:{"Content-Type":"application/json"},body:{memberId,optionId}});return await res.json()},fetchRoundVoteResult=async({contentId,roomId})=>{const res=await _fetcher__WEBPACK_IMPORTED_MODULE_0__.A.get({url:_constants_url__WEBPACK_IMPORTED_MODULE_1__.H$.roundVoteResult(roomId,contentId)});return await res.json()},checkMyGameStatus=async({roomId,currentRound})=>{const res=await _fetcher__WEBPACK_IMPORTED_MODULE_0__.A.get({url:_constants_url__WEBPACK_IMPORTED_MODULE_1__.H$.myGameStatus(roomId,currentRound),headers:{"Content-Type":"application/json"}});return await res.json()},fetchVoteIsFinished=async({contentId,roomId})=>{const res=await _fetcher__WEBPACK_IMPORTED_MODULE_0__.A.get({url:_constants_url__WEBPACK_IMPORTED_MODULE_1__.H$.voteIsFinished(roomId,contentId)});return await res.json()}},"./src/components/SelectContainer/Timer/Timer.util.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Nc:()=>convertMsecToSecond,qE:()=>formatLeftRoundTime,wk:()=>isAlertTimer});var _constants_config__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./src/constants/config.ts");const formatLeftRoundTime=leftRoundTime=>{const minutes=Math.floor(leftRoundTime/60),seconds=leftRoundTime%60;return`${String(minutes).padStart(2,"0")}:${String(seconds).padStart(2,"0")}`},convertMsecToSecond=msec=>msec/_constants_config__WEBPACK_IMPORTED_MODULE_0__.S2,isAlertTimer=(leftRoundTime,timeLimit)=>leftRoundTime===Math.floor(timeLimit/2)||leftRoundTime===_constants_config__WEBPACK_IMPORTED_MODULE_0__.cZ},"./src/components/common/AlertModal/AlertModal.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>AlertModal_AlertModal});__webpack_require__("./node_modules/core-js/modules/esnext.iterator.map.js");var react=__webpack_require__("./node_modules/react/index.js"),emotion_react_browser_esm=__webpack_require__("./node_modules/@emotion/react/dist/emotion-react.browser.esm.js"),Theme=__webpack_require__("./src/styles/Theme.ts");const alertModalTitle=(0,emotion_react_browser_esm.AH)(Theme.S.typography.headline3,";",""),messageContainer={name:"1azakc",styles:"text-align:center"},alertText={name:"255c6r",styles:"word-break:keep-all"};var Modal=__webpack_require__("./src/components/common/Modal/Modal.tsx"),emotion_react_jsx_runtime_browser_esm=__webpack_require__("./node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js");const AlertModal=({isOpen,onClose,onConfirm,message,title,returnFocusRef})=>(0,emotion_react_jsx_runtime_browser_esm.FD)(Modal.A,{isOpen,onClose,returnFocusRef,children:[(0,emotion_react_jsx_runtime_browser_esm.FD)(Modal.A.Header,{position:"center",children:[(0,emotion_react_jsx_runtime_browser_esm.Y)(Modal.A.Title,{css:alertModalTitle,children:title||"알림"}),(0,emotion_react_jsx_runtime_browser_esm.Y)(Modal.A.IconButton,{onClick:onClose})]}),(0,emotion_react_jsx_runtime_browser_esm.Y)(Modal.A.Content,{css:messageContainer,children:message&&message.split("\n").map((text=>(0,emotion_react_jsx_runtime_browser_esm.FD)(react.Fragment,{children:[(0,emotion_react_jsx_runtime_browser_esm.Y)("span",{css:alertText,children:text}),(0,emotion_react_jsx_runtime_browser_esm.Y)("br",{})]},text)))}),(0,emotion_react_jsx_runtime_browser_esm.Y)(Modal.A.Footer,{buttonPosition:"center",children:(0,emotion_react_jsx_runtime_browser_esm.Y)(Modal.A.TextButton,{onClick:()=>{onConfirm&&onConfirm(),onClose()},buttonWidth:"60%",children:"확인"})})]}),AlertModal_AlertModal=AlertModal;AlertModal.__docgenInfo={description:"",methods:[],displayName:"AlertModal",props:{isOpen:{required:!0,tsType:{name:"boolean"},description:""},onClose:{required:!0,tsType:{name:"signature",type:"function",raw:"() => void",signature:{arguments:[],return:{name:"void"}}},description:""},onConfirm:{required:!1,tsType:{name:"signature",type:"function",raw:"() => void",signature:{arguments:[],return:{name:"void"}}},description:""},message:{required:!1,tsType:{name:"string"},description:""},title:{required:!1,tsType:{name:"string"},description:""},returnFocusRef:{required:!1,tsType:{name:"RefObject",elements:[{name:"HTMLElement"}],raw:"RefObject"},description:""}}}},"./src/components/common/a11yOnly/A11yOnly.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>a11yOnly_A11yOnly});const a11yOnlyLayout={name:"90pyz3",styles:"overflow:hidden;position:absolute;width:1px;height:1px;margin:-1px;padding:0;border:0;white-space:nowrap;clip:rect(0, 0, 0, 0)"};var emotion_react_jsx_runtime_browser_esm=__webpack_require__("./node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js");const A11yOnly=({as,children,...props})=>{const Component=as||"span";return(0,emotion_react_jsx_runtime_browser_esm.Y)(Component,{css:a11yOnlyLayout,...props,children})},a11yOnly_A11yOnly=A11yOnly;A11yOnly.__docgenInfo={description:"",methods:[],displayName:"A11yOnly",props:{as:{required:!1,tsType:{name:"T"},description:""},role:{required:!1,tsType:{name:"AriaRole"},description:""}}}},"./src/components/layout/Header/Header.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{tT:()=>BackHeader,il:()=>GameHeader,v4:()=>RoomSettingHeader,vc:()=>RoundResultHeader,Ub:()=>TitleHeader,Ay:()=>Header_Header});var react=__webpack_require__("./node_modules/react/index.js"),dist=__webpack_require__("./node_modules/react-router/dist/index.js"),es=__webpack_require__("./node_modules/recoil/es/index.js"),emotion_react_browser_esm=__webpack_require__("./node_modules/@emotion/react/dist/emotion-react.browser.esm.js"),Theme=__webpack_require__("./src/styles/Theme.ts");const headerLayout=isCenter=>(0,emotion_react_browser_esm.AH)("display:flex;justify-content:",isCenter?"center":"space-between",";align-items:center;height:12vh;padding:0 2.4rem;:focus{outline:none;}",""),roundText={name:"1icein2",styles:"display:flex;align-items:center;width:2.4rem;height:2.4rem;font-weight:bold;font-size:1.6rem"},buttonWrapper={name:"1ocs895",styles:"display:flex;justify-content:center;align-items:center;width:2rem;height:2rem"},gameTitle={name:"1anrxxk",styles:"font-weight:bold;font-size:2rem"},iconImage={name:"fmrzco",styles:"display:flex;align-items:center;width:2.4rem;height:2.4rem"},MatchingResultHeaderContainer={name:"19iqmqi",styles:"display:flex;flex-direction:column;align-items:center;gap:1.2rem"},matchingResultTitle=(0,emotion_react_browser_esm.AH)(Theme.S.typography.slogan,";",""),matchingResultCaption={name:"ywz92v",styles:"font-weight:bold;font-size:1.2rem"};var useMutation=__webpack_require__("./node_modules/@tanstack/react-query/build/modern/useMutation.js"),room=__webpack_require__("./src/apis/room.ts"),atom=__webpack_require__("./src/recoil/atom.ts");var routes=__webpack_require__("./src/constants/routes.ts");const hooks_useRoutePath=()=>{const location=(0,dist.zy)(),{roomId}=(0,dist.g)(),currentPath={isNicknamePage:location.pathname.startsWith(routes.b.nickname),isReadyPage:location.pathname===routes.b.ready(Number(roomId)),isRoundResultPage:location.pathname===routes.b.roundResult(Number(roomId)),isMatchingResultPage:location.pathname===routes.b.gameResult(Number(roomId))};return{isNicknamePage:currentPath.isNicknamePage,isReadyPage:currentPath.isReadyPage,isRoundResultPage:currentPath.isRoundResultPage,isMatchingResultPage:currentPath.isMatchingResultPage}},arrowLeft_namespaceObject=__webpack_require__.p+"static/media/arrowLeft.d6435a9d.svg",exitIcon_namespaceObject=__webpack_require__.p+"static/media/exitIcon.58b68e72.svg",settingIcon_namespaceObject=__webpack_require__.p+"static/media/settingIcon.489dd149.svg";var A11yOnly=__webpack_require__("./src/components/common/a11yOnly/A11yOnly.tsx"),AlertModal=__webpack_require__("./src/components/common/AlertModal/AlertModal.tsx"),RoomSettingModal=__webpack_require__("./src/components/common/RoomSettingModal/RoomSettingModal.tsx"),Timer_util=__webpack_require__("./src/components/SelectContainer/Timer/Timer.util.ts"),useBalanceContentQuery=__webpack_require__("./src/hooks/useBalanceContentQuery.ts"),useFocus=__webpack_require__("./src/hooks/useFocus.ts"),useModal=__webpack_require__("./src/hooks/useModal.ts"),emotion_react_jsx_runtime_browser_esm=__webpack_require__("./node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js");const Header=()=>{const{isNicknamePage,isReadyPage,isRoundResultPage,isMatchingResultPage}=hooks_useRoutePath();return(0,react.useEffect)((()=>{const handleKeyDown=event=>{("F5"===event.key||event.ctrlKey&&"r"===event.key)&&event.preventDefault()};window.addEventListener("keydown",handleKeyDown);const handleBeforeUnload=event=>{event.preventDefault(),alert("새로고침 시 게임에서 나가질 수 있습니다")};return window.addEventListener("beforeunload",handleBeforeUnload),()=>{window.removeEventListener("keydown",handleKeyDown),window.removeEventListener("beforeunload",handleBeforeUnload)}}),[]),isNicknamePage?(0,emotion_react_jsx_runtime_browser_esm.Y)(TitleHeader,{title:"닉네임 설정"}):isReadyPage?(0,emotion_react_jsx_runtime_browser_esm.Y)(RoomSettingHeader,{title:"밸런스 게임"}):isRoundResultPage?(0,emotion_react_jsx_runtime_browser_esm.Y)(RoundResultHeader,{}):isMatchingResultPage?(0,emotion_react_jsx_runtime_browser_esm.Y)(MatchingResultHeader,{title:"매칭 결과"}):void 0},MatchingResultHeader=({title})=>{const focusRef=(0,useFocus.A)();return(0,emotion_react_jsx_runtime_browser_esm.Y)("header",{css:headerLayout(!0),tabIndex:0,ref:focusRef,children:(0,emotion_react_jsx_runtime_browser_esm.FD)("div",{css:MatchingResultHeaderContainer,children:[(0,emotion_react_jsx_runtime_browser_esm.Y)("h1",{css:matchingResultTitle,children:title}),(0,emotion_react_jsx_runtime_browser_esm.Y)("h2",{css:matchingResultCaption,children:"매칭도를 통해 당신과 가장 잘 맞는 사람을 알아보세요😊"})]})})},TitleHeader=({title})=>(0,emotion_react_jsx_runtime_browser_esm.Y)("header",{css:headerLayout(!0),children:(0,emotion_react_jsx_runtime_browser_esm.Y)("h1",{css:gameTitle,children:title})}),RoomSettingHeader=({title})=>{const{show}=(0,useModal.A)(),{isMaster}=(0,es.vc)(atom.u),{handleExit}=(()=>{const{memberId}=(0,es.vc)(atom.u),navigate=(0,dist.Zp)(),{roomId}=(0,dist.g)(),exitRoomMutation=(0,useMutation.n)({mutationFn:({roomId,memberId})=>(0,room.Gn)(roomId,memberId),onSuccess:()=>{navigate("/")}});return{handleExit:()=>{exitRoomMutation.mutate({roomId:Number(roomId),memberId:Number(memberId)})}}})(),returnFocusRef=(0,react.useRef)(null),focusRef=(0,useFocus.A)();return(0,emotion_react_jsx_runtime_browser_esm.FD)("header",{css:headerLayout(),tabIndex:0,ref:focusRef,children:[(0,emotion_react_jsx_runtime_browser_esm.Y)("button",{onClick:()=>{show(AlertModal.A,{message:"정말로 나가시겠습니까?",onConfirm:handleExit})},css:buttonWrapper,children:(0,emotion_react_jsx_runtime_browser_esm.Y)("img",{src:exitIcon_namespaceObject,alt:"방 나가기",css:iconImage})}),(0,emotion_react_jsx_runtime_browser_esm.Y)("h1",{css:gameTitle,children:title}),isMaster?(0,emotion_react_jsx_runtime_browser_esm.Y)("button",{ref:returnFocusRef,onClick:()=>{show(RoomSettingModal.A,{returnFocusRef})},css:buttonWrapper,children:(0,emotion_react_jsx_runtime_browser_esm.Y)("img",{src:settingIcon_namespaceObject,alt:"방 설정",css:iconImage})}):(0,emotion_react_jsx_runtime_browser_esm.Y)("span",{css:roundText})]})},RoundResultHeader=()=>{const{roomId}=(0,dist.g)(),{balanceContent}=(0,useBalanceContentQuery.A)(Number(roomId)),screenReaderRoundResult=`${balanceContent.totalRound}라운드 중. ${balanceContent.currentRound}라운드. 투표 결과 페이지`,focusRef=(0,useFocus.A)();return(0,emotion_react_jsx_runtime_browser_esm.FD)("header",{css:headerLayout(),tabIndex:0,ref:focusRef,children:[(0,emotion_react_jsx_runtime_browser_esm.Y)(A11yOnly.A,{children:screenReaderRoundResult}),(0,emotion_react_jsx_runtime_browser_esm.FD)("span",{css:roundText,"aria-hidden":!0,children:[balanceContent.currentRound,"/",balanceContent.totalRound]}),(0,emotion_react_jsx_runtime_browser_esm.Y)("h1",{css:gameTitle,"aria-hidden":!0,children:"투표 결과"}),(0,emotion_react_jsx_runtime_browser_esm.Y)("span",{css:roundText,"aria-hidden":!0})]})},GameHeader=()=>{const{roomId}=(0,dist.g)(),{balanceContent}=(0,useBalanceContentQuery.A)(Number(roomId)),{totalRound,currentRound,timeLimit}=balanceContent,screenReaderHeader=`${totalRound}라운드.중.${currentRound}라운드. 밸런스 게임 페이지. 제한 시간 ${(0,Timer_util.Nc)(timeLimit)}초.`,focusRef=(0,useFocus.A)();return(0,emotion_react_jsx_runtime_browser_esm.FD)("header",{css:headerLayout(),tabIndex:0,ref:focusRef,children:[(0,emotion_react_jsx_runtime_browser_esm.Y)(A11yOnly.A,{children:screenReaderHeader}),(0,emotion_react_jsx_runtime_browser_esm.FD)("span",{css:roundText,"aria-hidden":!0,children:[currentRound,"/",totalRound]}),(0,emotion_react_jsx_runtime_browser_esm.Y)("h1",{css:gameTitle,"aria-hidden":!0,children:"밸런스 게임"}),(0,emotion_react_jsx_runtime_browser_esm.Y)("span",{css:roundText,"aria-hidden":!0})]})},BackHeader=({title})=>{const navigate=(0,dist.Zp)(),focusRef=(0,useFocus.A)();return(0,emotion_react_jsx_runtime_browser_esm.FD)("header",{css:headerLayout(),tabIndex:0,ref:focusRef,children:[(0,emotion_react_jsx_runtime_browser_esm.Y)("button",{onClick:()=>{navigate(-1)},css:buttonWrapper,children:(0,emotion_react_jsx_runtime_browser_esm.Y)("img",{src:arrowLeft_namespaceObject,alt:"뒤로 가기"})}),(0,emotion_react_jsx_runtime_browser_esm.Y)("h1",{css:gameTitle,children:title}),(0,emotion_react_jsx_runtime_browser_esm.Y)("span",{css:roundText})]})},Header_Header=Header;MatchingResultHeader.__docgenInfo={description:"",methods:[],displayName:"MatchingResultHeader",props:{title:{required:!0,tsType:{name:"string"},description:""}}},TitleHeader.__docgenInfo={description:"",methods:[],displayName:"TitleHeader",props:{title:{required:!0,tsType:{name:"string"},description:""}}},RoomSettingHeader.__docgenInfo={description:"",methods:[],displayName:"RoomSettingHeader",props:{title:{required:!0,tsType:{name:"string"},description:""}}},RoundResultHeader.__docgenInfo={description:"",methods:[],displayName:"RoundResultHeader"},GameHeader.__docgenInfo={description:"",methods:[],displayName:"GameHeader"},BackHeader.__docgenInfo={description:"",methods:[],displayName:"BackHeader",props:{title:{required:!0,tsType:{name:"string"},description:""}}},Header.__docgenInfo={description:"",methods:[],displayName:"Header"}},"./src/constants/routes.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{b:()=>ROUTES});const ROUTES={main:"/",nickname:"/nickname",ready:roomId=>`/${roomId}/ready`,game:roomId=>`/${roomId}/game`,roundResult:roomId=>`/${roomId}/round/result`,roundResultVote:"/round/result/vote",gameResult:roomId=>`/${roomId}/game/result`,roundResultStatus:roomId=>`/${roomId}/round/result/status`}},"./src/hooks/useBalanceContentQuery.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>__WEBPACK_DEFAULT_EXPORT__});var _tanstack_react_query__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/@tanstack/react-query/build/modern/useSuspenseQuery.js"),_apis_balanceContent__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./src/apis/balanceContent.ts"),_constants_queryKeys__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/constants/queryKeys.ts");const __WEBPACK_DEFAULT_EXPORT__=roomId=>{const balanceContentQuery=(0,_tanstack_react_query__WEBPACK_IMPORTED_MODULE_2__.U)({queryKey:[_constants_queryKeys__WEBPACK_IMPORTED_MODULE_1__.e.balanceContent,Number(roomId)],queryFn:async()=>await(0,_apis_balanceContent__WEBPACK_IMPORTED_MODULE_0__.Gd)(Number(roomId))});return{...balanceContentQuery,balanceContent:balanceContentQuery.data}}},"./src/hooks/useModal.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>__WEBPACK_DEFAULT_EXPORT__});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),_providers_ModalProvider_ModalProvider__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/providers/ModalProvider/ModalProvider.tsx");const __WEBPACK_DEFAULT_EXPORT__=()=>{const dispatch=(0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(_providers_ModalProvider_ModalProvider__WEBPACK_IMPORTED_MODULE_1__.L);if(null===dispatch)throw new Error("ModalDispatchContext가 존재하지 않습니다.");return dispatch}},"./src/recoil/atom.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{k:()=>roomUuidState,u:()=>memberInfoState});var recoil__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/recoil/es/index.js");const memberInfoState=(0,recoil__WEBPACK_IMPORTED_MODULE_0__.eU)({key:"memberInfo",default:{memberId:null,nickname:null,isMaster:!1}}),roomUuidState=(0,recoil__WEBPACK_IMPORTED_MODULE_0__.eU)({key:"roomUuid",default:""})}}]); \ No newline at end of file diff --git a/storybook/596.eaae2ed2.iframe.bundle.js b/storybook/596.eaae2ed2.iframe.bundle.js deleted file mode 100644 index d2f28f956..000000000 --- a/storybook/596.eaae2ed2.iframe.bundle.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkddangkong_frontend=self.webpackChunkddangkong_frontend||[]).push([[596],{"./src/apis/balanceContent.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Gd:()=>fetchBalanceContent,O:()=>fetchRoundVoteResult,bR:()=>checkMyGameStatus,jd:()=>fetchVoteIsFinished,sl:()=>voteBalanceContent});var _fetcher__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./src/apis/fetcher.ts"),_constants_url__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/constants/url.ts");const fetchBalanceContent=async roomId=>{const res=await _fetcher__WEBPACK_IMPORTED_MODULE_0__.A.get({url:_constants_url__WEBPACK_IMPORTED_MODULE_1__.H$.balanceContent(roomId)});return await res.json()},voteBalanceContent=async({optionId,contentId,roomId,memberId})=>{const res=await _fetcher__WEBPACK_IMPORTED_MODULE_0__.A.post({url:_constants_url__WEBPACK_IMPORTED_MODULE_1__.H$.vote(roomId,contentId),headers:{"Content-Type":"application/json"},body:{memberId,optionId}});return await res.json()},fetchRoundVoteResult=async({contentId,roomId})=>{const res=await _fetcher__WEBPACK_IMPORTED_MODULE_0__.A.get({url:_constants_url__WEBPACK_IMPORTED_MODULE_1__.H$.roundVoteResult(roomId,contentId)});return await res.json()},checkMyGameStatus=async({roomId,currentRound})=>{const res=await _fetcher__WEBPACK_IMPORTED_MODULE_0__.A.get({url:_constants_url__WEBPACK_IMPORTED_MODULE_1__.H$.myGameStatus(roomId,currentRound),headers:{"Content-Type":"application/json"}});return await res.json()},fetchVoteIsFinished=async({contentId,roomId})=>{const res=await _fetcher__WEBPACK_IMPORTED_MODULE_0__.A.get({url:_constants_url__WEBPACK_IMPORTED_MODULE_1__.H$.voteIsFinished(roomId,contentId)});return await res.json()}},"./src/components/SelectContainer/Timer/Timer.util.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Nc:()=>convertMsecToSecond,qE:()=>formatLeftRoundTime,wk:()=>isAlertTimer});var _constants_config__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./src/constants/config.ts");const formatLeftRoundTime=leftRoundTime=>{const minutes=Math.floor(leftRoundTime/60),seconds=leftRoundTime%60;return`${String(minutes).padStart(2,"0")}:${String(seconds).padStart(2,"0")}`},convertMsecToSecond=msec=>msec/_constants_config__WEBPACK_IMPORTED_MODULE_0__.S2,isAlertTimer=(leftRoundTime,timeLimit)=>leftRoundTime===Math.floor(timeLimit/2)||leftRoundTime===_constants_config__WEBPACK_IMPORTED_MODULE_0__.cZ},"./src/components/common/AlertModal/AlertModal.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>AlertModal_AlertModal});__webpack_require__("./node_modules/core-js/modules/esnext.iterator.map.js");var react=__webpack_require__("./node_modules/react/index.js"),emotion_react_browser_esm=__webpack_require__("./node_modules/@emotion/react/dist/emotion-react.browser.esm.js"),Theme=__webpack_require__("./src/styles/Theme.ts");const alertModalTitle=(0,emotion_react_browser_esm.AH)(Theme.S.typography.headline3,";",""),messageContainer={name:"1azakc",styles:"text-align:center"},alertText={name:"255c6r",styles:"word-break:keep-all"};var Modal=__webpack_require__("./src/components/common/Modal/Modal.tsx"),emotion_react_jsx_runtime_browser_esm=__webpack_require__("./node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js");const AlertModal=({isOpen,onClose,onConfirm,message,title,returnFocusRef})=>(0,emotion_react_jsx_runtime_browser_esm.FD)(Modal.A,{isOpen,onClose,returnFocusRef,children:[(0,emotion_react_jsx_runtime_browser_esm.FD)(Modal.A.Header,{position:"center",children:[(0,emotion_react_jsx_runtime_browser_esm.Y)(Modal.A.Title,{css:alertModalTitle,children:title||"알림"}),(0,emotion_react_jsx_runtime_browser_esm.Y)(Modal.A.IconButton,{onClick:onClose})]}),(0,emotion_react_jsx_runtime_browser_esm.Y)(Modal.A.Content,{css:messageContainer,children:message&&message.split("\n").map((text=>(0,emotion_react_jsx_runtime_browser_esm.FD)(react.Fragment,{children:[(0,emotion_react_jsx_runtime_browser_esm.Y)("span",{css:alertText,children:text}),(0,emotion_react_jsx_runtime_browser_esm.Y)("br",{})]},text)))}),(0,emotion_react_jsx_runtime_browser_esm.Y)(Modal.A.Footer,{buttonPosition:"center",children:(0,emotion_react_jsx_runtime_browser_esm.Y)(Modal.A.TextButton,{onClick:()=>{onConfirm&&onConfirm(),onClose()},buttonWidth:"60%",children:"확인"})})]}),AlertModal_AlertModal=AlertModal;AlertModal.__docgenInfo={description:"",methods:[],displayName:"AlertModal",props:{isOpen:{required:!0,tsType:{name:"boolean"},description:""},onClose:{required:!0,tsType:{name:"signature",type:"function",raw:"() => void",signature:{arguments:[],return:{name:"void"}}},description:""},onConfirm:{required:!1,tsType:{name:"signature",type:"function",raw:"() => void",signature:{arguments:[],return:{name:"void"}}},description:""},message:{required:!1,tsType:{name:"string"},description:""},title:{required:!1,tsType:{name:"string"},description:""},returnFocusRef:{required:!1,tsType:{name:"RefObject",elements:[{name:"HTMLElement"}],raw:"RefObject"},description:""}}}},"./src/components/common/a11yOnly/A11yOnly.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>a11yOnly_A11yOnly});const a11yOnlyLayout={name:"90pyz3",styles:"overflow:hidden;position:absolute;width:1px;height:1px;margin:-1px;padding:0;border:0;white-space:nowrap;clip:rect(0, 0, 0, 0)"};var emotion_react_jsx_runtime_browser_esm=__webpack_require__("./node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js");const A11yOnly=({as,role="text",children,...props})=>{const Component=as||"span";return(0,emotion_react_jsx_runtime_browser_esm.Y)(Component,{css:a11yOnlyLayout,role,...props,children})},a11yOnly_A11yOnly=A11yOnly;A11yOnly.__docgenInfo={description:"",methods:[],displayName:"A11yOnly",props:{as:{required:!1,tsType:{name:"T"},description:""},role:{required:!1,tsType:{name:"AriaRole"},description:"",defaultValue:{value:"'text'",computed:!1}}}}},"./src/components/layout/Header/Header.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{tT:()=>BackHeader,il:()=>GameHeader,v4:()=>RoomSettingHeader,vc:()=>RoundResultHeader,Ub:()=>TitleHeader,Ay:()=>Header_Header});var react=__webpack_require__("./node_modules/react/index.js"),dist=__webpack_require__("./node_modules/react-router/dist/index.js"),es=__webpack_require__("./node_modules/recoil/es/index.js"),emotion_react_browser_esm=__webpack_require__("./node_modules/@emotion/react/dist/emotion-react.browser.esm.js"),Theme=__webpack_require__("./src/styles/Theme.ts");const headerLayout=isCenter=>(0,emotion_react_browser_esm.AH)("display:flex;justify-content:",isCenter?"center":"space-between",";align-items:center;height:12vh;padding:0 2.4rem;",""),roundText={name:"1icein2",styles:"display:flex;align-items:center;width:2.4rem;height:2.4rem;font-weight:bold;font-size:1.6rem"},buttonWrapper={name:"1ocs895",styles:"display:flex;justify-content:center;align-items:center;width:2rem;height:2rem"},gameTitle={name:"1anrxxk",styles:"font-weight:bold;font-size:2rem"},iconImage={name:"fmrzco",styles:"display:flex;align-items:center;width:2.4rem;height:2.4rem"},MatchingResultHeaderContainer={name:"19iqmqi",styles:"display:flex;flex-direction:column;align-items:center;gap:1.2rem"},matchingResultTitle=(0,emotion_react_browser_esm.AH)(Theme.S.typography.slogan,";",""),matchingResultCaption={name:"ywz92v",styles:"font-weight:bold;font-size:1.2rem"};var useMutation=__webpack_require__("./node_modules/@tanstack/react-query/build/modern/useMutation.js"),room=__webpack_require__("./src/apis/room.ts"),atom=__webpack_require__("./src/recoil/atom.ts");var routes=__webpack_require__("./src/constants/routes.ts");const hooks_useRoutePath=()=>{const location=(0,dist.zy)(),{roomId}=(0,dist.g)(),currentPath={isNicknamePage:location.pathname.startsWith(routes.b.nickname),isReadyPage:location.pathname===routes.b.ready(Number(roomId)),isRoundResultPage:location.pathname===routes.b.roundResult(Number(roomId)),isMatchingResultPage:location.pathname===routes.b.gameResult(Number(roomId))};return{isNicknamePage:currentPath.isNicknamePage,isReadyPage:currentPath.isReadyPage,isRoundResultPage:currentPath.isRoundResultPage,isMatchingResultPage:currentPath.isMatchingResultPage}},arrowLeft_namespaceObject=__webpack_require__.p+"static/media/arrowLeft.d6435a9d.svg",exitIcon_namespaceObject=__webpack_require__.p+"static/media/exitIcon.58b68e72.svg",settingIcon_namespaceObject=__webpack_require__.p+"static/media/settingIcon.489dd149.svg";var A11yOnly=__webpack_require__("./src/components/common/a11yOnly/A11yOnly.tsx"),AlertModal=__webpack_require__("./src/components/common/AlertModal/AlertModal.tsx"),RoomSettingModal=__webpack_require__("./src/components/common/RoomSettingModal/RoomSettingModal.tsx"),Timer_util=__webpack_require__("./src/components/SelectContainer/Timer/Timer.util.ts"),useBalanceContentQuery=__webpack_require__("./src/hooks/useBalanceContentQuery.ts"),useFocus=__webpack_require__("./src/hooks/useFocus.ts"),useModal=__webpack_require__("./src/hooks/useModal.ts"),emotion_react_jsx_runtime_browser_esm=__webpack_require__("./node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js");const Header=()=>{const{isNicknamePage,isReadyPage,isRoundResultPage,isMatchingResultPage}=hooks_useRoutePath();return(0,react.useEffect)((()=>{const handleKeyDown=event=>{("F5"===event.key||event.ctrlKey&&"r"===event.key)&&event.preventDefault()};window.addEventListener("keydown",handleKeyDown);const handleBeforeUnload=event=>{event.preventDefault(),alert("새로고침 시 게임에서 나가질 수 있습니다")};return window.addEventListener("beforeunload",handleBeforeUnload),()=>{window.removeEventListener("keydown",handleKeyDown),window.removeEventListener("beforeunload",handleBeforeUnload)}}),[]),isNicknamePage?(0,emotion_react_jsx_runtime_browser_esm.Y)(TitleHeader,{title:"닉네임 설정"}):isReadyPage?(0,emotion_react_jsx_runtime_browser_esm.Y)(RoomSettingHeader,{title:"밸런스 게임"}):isRoundResultPage?(0,emotion_react_jsx_runtime_browser_esm.Y)(RoundResultHeader,{}):isMatchingResultPage?(0,emotion_react_jsx_runtime_browser_esm.Y)(MatchingResultHeader,{title:"매칭 결과"}):void 0},MatchingResultHeader=({title})=>{const focusRef=(0,useFocus.A)();return(0,emotion_react_jsx_runtime_browser_esm.Y)("header",{css:headerLayout(!0),tabIndex:0,ref:focusRef,children:(0,emotion_react_jsx_runtime_browser_esm.FD)("div",{css:MatchingResultHeaderContainer,children:[(0,emotion_react_jsx_runtime_browser_esm.Y)("h1",{css:matchingResultTitle,children:title}),(0,emotion_react_jsx_runtime_browser_esm.Y)("h2",{css:matchingResultCaption,children:"매칭도를 통해 당신과 가장 잘 맞는 사람을 알아보세요😊"})]})})},TitleHeader=({title})=>(0,emotion_react_jsx_runtime_browser_esm.Y)("header",{css:headerLayout(!0),children:(0,emotion_react_jsx_runtime_browser_esm.Y)("h1",{css:gameTitle,children:title})}),RoomSettingHeader=({title})=>{const{show}=(0,useModal.A)(),{isMaster}=(0,es.vc)(atom.u),{handleExit}=(()=>{const{memberId}=(0,es.vc)(atom.u),navigate=(0,dist.Zp)(),{roomId}=(0,dist.g)(),exitRoomMutation=(0,useMutation.n)({mutationFn:({roomId,memberId})=>(0,room.Gn)(roomId,memberId),onSuccess:()=>{navigate("/")}});return{handleExit:()=>{exitRoomMutation.mutate({roomId:Number(roomId),memberId:Number(memberId)})}}})(),returnFocusRef=(0,react.useRef)(null),focusRef=(0,useFocus.A)();return(0,emotion_react_jsx_runtime_browser_esm.FD)("header",{css:headerLayout(),tabIndex:0,ref:focusRef,children:[(0,emotion_react_jsx_runtime_browser_esm.Y)("button",{onClick:()=>{show(AlertModal.A,{message:"정말로 나가시겠습니까?",onConfirm:handleExit})},css:buttonWrapper,children:(0,emotion_react_jsx_runtime_browser_esm.Y)("img",{src:exitIcon_namespaceObject,alt:"방 나가기",css:iconImage})}),(0,emotion_react_jsx_runtime_browser_esm.Y)("h1",{css:gameTitle,children:title}),isMaster?(0,emotion_react_jsx_runtime_browser_esm.Y)("button",{ref:returnFocusRef,onClick:()=>{show(RoomSettingModal.A,{returnFocusRef})},css:buttonWrapper,children:(0,emotion_react_jsx_runtime_browser_esm.Y)("img",{src:settingIcon_namespaceObject,alt:"방 설정",css:iconImage})}):(0,emotion_react_jsx_runtime_browser_esm.Y)("span",{css:roundText})]})},RoundResultHeader=()=>{const{roomId}=(0,dist.g)(),{balanceContent}=(0,useBalanceContentQuery.A)(Number(roomId)),screenReaderRoundResult=`${balanceContent.totalRound}라운드 중. ${balanceContent.currentRound}라운드. 투표 결과 페이지`,focusRef=(0,useFocus.A)();return(0,emotion_react_jsx_runtime_browser_esm.FD)("header",{css:headerLayout(),tabIndex:0,ref:focusRef,children:[(0,emotion_react_jsx_runtime_browser_esm.Y)(A11yOnly.A,{children:screenReaderRoundResult}),(0,emotion_react_jsx_runtime_browser_esm.FD)("span",{css:roundText,"aria-hidden":!0,children:[balanceContent.currentRound,"/",balanceContent.totalRound]}),(0,emotion_react_jsx_runtime_browser_esm.Y)("h1",{css:gameTitle,"aria-hidden":!0,children:"투표 결과"}),(0,emotion_react_jsx_runtime_browser_esm.Y)("span",{css:roundText,"aria-hidden":!0})]})},GameHeader=()=>{const{roomId}=(0,dist.g)(),{balanceContent}=(0,useBalanceContentQuery.A)(Number(roomId)),{totalRound,currentRound,timeLimit}=balanceContent,screenReaderHeader=`${totalRound}라운드.중.${currentRound}라운드. 밸런스 게임 페이지. 제한 시간 ${(0,Timer_util.Nc)(timeLimit)}초.`,focusRef=(0,useFocus.A)();return(0,emotion_react_jsx_runtime_browser_esm.FD)("header",{css:headerLayout(),tabIndex:0,ref:focusRef,children:[(0,emotion_react_jsx_runtime_browser_esm.Y)(A11yOnly.A,{children:screenReaderHeader}),(0,emotion_react_jsx_runtime_browser_esm.FD)("span",{css:roundText,"aria-hidden":!0,children:[currentRound,"/",totalRound]}),(0,emotion_react_jsx_runtime_browser_esm.Y)("h1",{css:gameTitle,"aria-hidden":!0,children:"밸런스 게임"}),(0,emotion_react_jsx_runtime_browser_esm.Y)("span",{css:roundText,"aria-hidden":!0})]})},BackHeader=({title})=>{const navigate=(0,dist.Zp)(),focusRef=(0,useFocus.A)();return(0,emotion_react_jsx_runtime_browser_esm.FD)("header",{css:headerLayout(),tabIndex:0,ref:focusRef,children:[(0,emotion_react_jsx_runtime_browser_esm.Y)("button",{onClick:()=>{navigate(-1)},css:buttonWrapper,children:(0,emotion_react_jsx_runtime_browser_esm.Y)("img",{src:arrowLeft_namespaceObject,alt:"뒤로 가기"})}),(0,emotion_react_jsx_runtime_browser_esm.Y)("h1",{css:gameTitle,children:title}),(0,emotion_react_jsx_runtime_browser_esm.Y)("span",{css:roundText})]})},Header_Header=Header;MatchingResultHeader.__docgenInfo={description:"",methods:[],displayName:"MatchingResultHeader",props:{title:{required:!0,tsType:{name:"string"},description:""}}},TitleHeader.__docgenInfo={description:"",methods:[],displayName:"TitleHeader",props:{title:{required:!0,tsType:{name:"string"},description:""}}},RoomSettingHeader.__docgenInfo={description:"",methods:[],displayName:"RoomSettingHeader",props:{title:{required:!0,tsType:{name:"string"},description:""}}},RoundResultHeader.__docgenInfo={description:"",methods:[],displayName:"RoundResultHeader"},GameHeader.__docgenInfo={description:"",methods:[],displayName:"GameHeader"},BackHeader.__docgenInfo={description:"",methods:[],displayName:"BackHeader",props:{title:{required:!0,tsType:{name:"string"},description:""}}},Header.__docgenInfo={description:"",methods:[],displayName:"Header"}},"./src/constants/routes.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{b:()=>ROUTES});const ROUTES={main:"/",nickname:"/nickname",ready:roomId=>`/${roomId}/ready`,game:roomId=>`/${roomId}/game`,roundResult:roomId=>`/${roomId}/round/result`,roundResultVote:"/round/result/vote",gameResult:roomId=>`/${roomId}/game/result`,roundResultStatus:roomId=>`/${roomId}/round/result/status`}},"./src/hooks/useBalanceContentQuery.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>__WEBPACK_DEFAULT_EXPORT__});var _tanstack_react_query__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/@tanstack/react-query/build/modern/useSuspenseQuery.js"),_apis_balanceContent__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./src/apis/balanceContent.ts"),_constants_queryKeys__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/constants/queryKeys.ts");const __WEBPACK_DEFAULT_EXPORT__=roomId=>{const balanceContentQuery=(0,_tanstack_react_query__WEBPACK_IMPORTED_MODULE_2__.U)({queryKey:[_constants_queryKeys__WEBPACK_IMPORTED_MODULE_1__.e.balanceContent,Number(roomId)],queryFn:async()=>await(0,_apis_balanceContent__WEBPACK_IMPORTED_MODULE_0__.Gd)(Number(roomId))});return{...balanceContentQuery,balanceContent:balanceContentQuery.data}}},"./src/hooks/useModal.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>__WEBPACK_DEFAULT_EXPORT__});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),_providers_ModalProvider_ModalProvider__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/providers/ModalProvider/ModalProvider.tsx");const __WEBPACK_DEFAULT_EXPORT__=()=>{const dispatch=(0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(_providers_ModalProvider_ModalProvider__WEBPACK_IMPORTED_MODULE_1__.L);if(null===dispatch)throw new Error("ModalDispatchContext가 존재하지 않습니다.");return dispatch}},"./src/recoil/atom.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{k:()=>roomUuidState,u:()=>memberInfoState});var recoil__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/recoil/es/index.js");const memberInfoState=(0,recoil__WEBPACK_IMPORTED_MODULE_0__.eU)({key:"memberInfo",default:{memberId:null,nickname:null,isMaster:!1}}),roomUuidState=(0,recoil__WEBPACK_IMPORTED_MODULE_0__.eU)({key:"roomUuid",default:""})}}]); \ No newline at end of file diff --git a/storybook/961.dd941168.iframe.bundle.js b/storybook/961.12acffc2.iframe.bundle.js similarity index 67% rename from storybook/961.dd941168.iframe.bundle.js rename to storybook/961.12acffc2.iframe.bundle.js index 747d61de2..a8d7b550c 100644 --- a/storybook/961.dd941168.iframe.bundle.js +++ b/storybook/961.12acffc2.iframe.bundle.js @@ -37,5 +37,5 @@ 100%{ transform: translateX(-95%); } -`,timerLayout=(0,emotion_react_browser_esm.AH)("display:flex;position:relative;align-items:center;width:100%;height:3.2rem;padding:0 1rem;border-radius:",Theme.S.borderRadius.radius30,";background-color:",Theme.S.color.peanut200,";box-sizing:border-box;",""),timerInnerLayout=timeLimit=>(0,emotion_react_browser_esm.AH)("display:flex;justify-content:center;align-items:center;width:100%;height:60%;border-radius:",Theme.S.borderRadius.radius30,";background-color:",Theme.S.color.peanut500,";transform-origin:left;animation:",progress," ",timeLimit+1,"s linear;",""),timerWrapper=timeLimit=>(0,emotion_react_browser_esm.AH)("display:flex;position:absolute;flex-direction:column;justify-content:center;align-items:flex-end;width:100%;height:4rem;animation:",timerTransition," ",timeLimit+1,"s linear;",""),timerIcon={name:"ryq21y",styles:"position:absolute;width:4.8rem;height:4.8rem"},timerIconShake=(0,emotion_react_browser_esm.AH)("animation:",shake," 1s linear infinite;",""),timerText=isAlmostFinished=>(0,emotion_react_browser_esm.AH)("position:absolute;top:5.2rem;color:",isAlmostFinished?"red":"black",";font-weight:bold;font-size:1.6rem;","");var useQuery=__webpack_require__("./node_modules/@tanstack/react-query/build/modern/useQuery.js"),balanceContent=__webpack_require__("./src/apis/balanceContent.ts"),queryKeys=__webpack_require__("./src/constants/queryKeys.ts");const hooks_useVoteIsFinishedQuery=({contentId,enabled})=>{const{roomId}=(0,dist.g)(),voteIsFinishedQuery=(0,useQuery.I)({queryKey:[queryKeys.e.roundIsFinished,Number(roomId),contentId],queryFn:async()=>{if(void 0===contentId)throw new Error("contentId 가 존재하지 않습니다.");return await(0,balanceContent.jd)({roomId:Number(roomId),contentId})},enabled,refetchInterval:query=>!(query.state.error&&query.state.fetchFailureCount>=config.A3)&&config.S2,refetchIntervalInBackground:!0,gcTime:0});return{...voteIsFinishedQuery,isFinished:voteIsFinishedQuery.data?.isFinished}};var routes=__webpack_require__("./src/constants/routes.ts");const hooks_useVoteIsFinished=({contentId,isFetching})=>{const navigate=(0,dist.Zp)(),{roomId}=(0,dist.g)(),{isFinished}=hooks_useVoteIsFinishedQuery({contentId,enabled:!!contentId&&!isFetching});return(0,react.useEffect)((()=>{isFinished&&!isFetching&&navigate(routes.b.roundResult(Number(roomId)),{replace:!0})}),[isFinished,navigate,roomId,isFetching]),{isFinished}},ddangkongTimer_namespaceObject=__webpack_require__.p+"static/media/ddangkongTimer.096a16e3.webp";var A11yOnly=__webpack_require__("./src/components/common/a11yOnly/A11yOnly.tsx"),emotion_react_jsx_runtime_browser_esm=__webpack_require__("./node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js");const Timer=({selectedId,isVoted,completeSelection})=>{const{roomId}=(0,dist.g)(),{balanceContent,isFetching}=(0,useBalanceContentQuery.A)(Number(roomId)),{leftRoundTime,isAlmostFinished,timeLimit}=hooks_useVoteTimer({roomId:Number(roomId),selectedId,isVoted,completeSelection});return hooks_useVoteIsFinished({contentId:balanceContent.contentId,isFetching}),(0,emotion_react_jsx_runtime_browser_esm.FD)("section",{css:timerLayout,children:[(0,emotion_react_jsx_runtime_browser_esm.Y)("div",{css:timerInnerLayout(timeLimit)}),(0,emotion_react_jsx_runtime_browser_esm.FD)("div",{css:timerWrapper(timeLimit),children:[(0,emotion_react_jsx_runtime_browser_esm.Y)("img",{css:[timerIcon,isAlmostFinished&&timerIconShake,"",""],src:ddangkongTimer_namespaceObject,alt:""}),(0,emotion_react_jsx_runtime_browser_esm.FD)(A11yOnly.A,{"aria-live":(0,Timer_util.wk)(leftRoundTime,timeLimit)&&"polite",children:[leftRoundTime,"초 남았습니다."]}),(0,emotion_react_jsx_runtime_browser_esm.Y)("span",{css:timerText(isAlmostFinished),"aria-hidden":!0,children:(0,Timer_util.qE)(leftRoundTime)})]})]})},Timer_Timer=Timer;Timer.__docgenInfo={description:"",methods:[],displayName:"Timer",props:{selectedId:{required:!0,tsType:{name:"number"},description:""},isVoted:{required:!0,tsType:{name:"boolean"},description:""},completeSelection:{required:!0,tsType:{name:"signature",type:"function",raw:"() => void",signature:{arguments:[],return:{name:"void"}}},description:""}}}},"./src/components/common/SelectButton/SelectButton.hook.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>__WEBPACK_DEFAULT_EXPORT__});var _tanstack_react_query__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./node_modules/@tanstack/react-query/build/modern/useMutation.js"),react_router_dom__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./node_modules/react-router/dist/index.js"),recoil__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/recoil/es/index.js"),_apis_balanceContent__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/apis/balanceContent.ts"),_recoil_atom__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/recoil/atom.ts");const __WEBPACK_DEFAULT_EXPORT__=({selectedId,contentId,completeSelection})=>{const{roomId}=(0,react_router_dom__WEBPACK_IMPORTED_MODULE_3__.g)(),memberInfo=(0,recoil__WEBPACK_IMPORTED_MODULE_0__.vc)(_recoil_atom__WEBPACK_IMPORTED_MODULE_2__.u);return(0,_tanstack_react_query__WEBPACK_IMPORTED_MODULE_4__.n)({mutationFn:async()=>{if(void 0===contentId)throw new Error("contentId 가 존재하지 않습니다.");return await(0,_apis_balanceContent__WEBPACK_IMPORTED_MODULE_1__.sl)({roomId:Number(roomId),optionId:selectedId,contentId,memberId:Number(memberInfo.memberId)})},onSuccess:()=>{completeSelection()}})}}}]); -//# sourceMappingURL=961.dd941168.iframe.bundle.js.map \ No newline at end of file +`,timerLayout=(0,emotion_react_browser_esm.AH)("display:flex;position:relative;align-items:center;width:100%;height:3.2rem;padding:0 1rem;border-radius:",Theme.S.borderRadius.radius30,";background-color:",Theme.S.color.peanut200,";box-sizing:border-box;",""),timerInnerLayout=timeLimit=>(0,emotion_react_browser_esm.AH)("display:flex;justify-content:center;align-items:center;width:100%;height:60%;border-radius:",Theme.S.borderRadius.radius30,";background-color:",Theme.S.color.peanut500,";transform-origin:left;animation:",progress," ",timeLimit+1,"s linear;",""),timerWrapper=timeLimit=>(0,emotion_react_browser_esm.AH)("display:flex;position:absolute;flex-direction:column;justify-content:center;align-items:flex-end;width:100%;height:4rem;animation:",timerTransition," ",timeLimit+1,"s linear;",""),timerIcon={name:"ryq21y",styles:"position:absolute;width:4.8rem;height:4.8rem"},timerIconShake=(0,emotion_react_browser_esm.AH)("animation:",shake," 1s linear infinite;",""),timerText=isAlmostFinished=>(0,emotion_react_browser_esm.AH)("position:absolute;top:5.2rem;color:",isAlmostFinished?"red":"black",";font-weight:bold;font-size:1.6rem;","");var useQuery=__webpack_require__("./node_modules/@tanstack/react-query/build/modern/useQuery.js"),balanceContent=__webpack_require__("./src/apis/balanceContent.ts"),queryKeys=__webpack_require__("./src/constants/queryKeys.ts");const hooks_useVoteIsFinishedQuery=({contentId,enabled})=>{const{roomId}=(0,dist.g)(),voteIsFinishedQuery=(0,useQuery.I)({queryKey:[queryKeys.e.roundIsFinished,Number(roomId),contentId],queryFn:async()=>{if(void 0===contentId)throw new Error("contentId 가 존재하지 않습니다.");return await(0,balanceContent.jd)({roomId:Number(roomId),contentId})},enabled,refetchInterval:query=>!(query.state.error&&query.state.fetchFailureCount>=config.A3)&&config.S2,refetchIntervalInBackground:!0,gcTime:0});return{...voteIsFinishedQuery,isFinished:voteIsFinishedQuery.data?.isFinished}};var routes=__webpack_require__("./src/constants/routes.ts");const hooks_useVoteIsFinished=({contentId,isFetching})=>{const navigate=(0,dist.Zp)(),{roomId}=(0,dist.g)(),{isFinished}=hooks_useVoteIsFinishedQuery({contentId,enabled:!!contentId&&!isFetching});return(0,react.useEffect)((()=>{isFinished&&!isFetching&&navigate(routes.b.roundResult(Number(roomId)),{replace:!0})}),[isFinished,navigate,roomId,isFetching]),{isFinished}},ddangkongTimer_namespaceObject=__webpack_require__.p+"static/media/ddangkongTimer.096a16e3.webp";var A11yOnly=__webpack_require__("./src/components/common/a11yOnly/A11yOnly.tsx"),emotion_react_jsx_runtime_browser_esm=__webpack_require__("./node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js");const Timer=({selectedId,isVoted,completeSelection})=>{const{roomId}=(0,dist.g)(),{balanceContent,isFetching}=(0,useBalanceContentQuery.A)(Number(roomId)),{leftRoundTime,isAlmostFinished,timeLimit}=hooks_useVoteTimer({roomId:Number(roomId),selectedId,isVoted,completeSelection}),screenReaderLeftRoundTime=`${leftRoundTime}초 남았습니다.`;return hooks_useVoteIsFinished({contentId:balanceContent.contentId,isFetching}),(0,emotion_react_jsx_runtime_browser_esm.FD)("section",{css:timerLayout,children:[(0,emotion_react_jsx_runtime_browser_esm.Y)("div",{css:timerInnerLayout(timeLimit)}),(0,emotion_react_jsx_runtime_browser_esm.FD)("div",{css:timerWrapper(timeLimit),children:[(0,emotion_react_jsx_runtime_browser_esm.Y)("img",{css:[timerIcon,isAlmostFinished&&timerIconShake,"",""],src:ddangkongTimer_namespaceObject,alt:""}),(0,emotion_react_jsx_runtime_browser_esm.Y)(A11yOnly.A,{role:"alert","aria-live":(0,Timer_util.wk)(leftRoundTime,timeLimit)&&"assertive",children:screenReaderLeftRoundTime}),(0,emotion_react_jsx_runtime_browser_esm.Y)("span",{css:timerText(isAlmostFinished),"aria-hidden":!0,children:(0,Timer_util.qE)(leftRoundTime)})]})]})},Timer_Timer=Timer;Timer.__docgenInfo={description:"",methods:[],displayName:"Timer",props:{selectedId:{required:!0,tsType:{name:"number"},description:""},isVoted:{required:!0,tsType:{name:"boolean"},description:""},completeSelection:{required:!0,tsType:{name:"signature",type:"function",raw:"() => void",signature:{arguments:[],return:{name:"void"}}},description:""}}}},"./src/components/common/SelectButton/SelectButton.hook.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>__WEBPACK_DEFAULT_EXPORT__});var _tanstack_react_query__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./node_modules/@tanstack/react-query/build/modern/useMutation.js"),react_router_dom__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./node_modules/react-router/dist/index.js"),recoil__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/recoil/es/index.js"),_apis_balanceContent__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/apis/balanceContent.ts"),_recoil_atom__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/recoil/atom.ts");const __WEBPACK_DEFAULT_EXPORT__=({selectedId,contentId,completeSelection})=>{const{roomId}=(0,react_router_dom__WEBPACK_IMPORTED_MODULE_3__.g)(),memberInfo=(0,recoil__WEBPACK_IMPORTED_MODULE_0__.vc)(_recoil_atom__WEBPACK_IMPORTED_MODULE_2__.u);return(0,_tanstack_react_query__WEBPACK_IMPORTED_MODULE_4__.n)({mutationFn:async()=>{if(void 0===contentId)throw new Error("contentId 가 존재하지 않습니다.");return await(0,_apis_balanceContent__WEBPACK_IMPORTED_MODULE_1__.sl)({roomId:Number(roomId),optionId:selectedId,contentId,memberId:Number(memberInfo.memberId)})},onSuccess:()=>{completeSelection()}})}}}]); +//# sourceMappingURL=961.12acffc2.iframe.bundle.js.map \ No newline at end of file diff --git a/storybook/961.dd941168.iframe.bundle.js.map b/storybook/961.12acffc2.iframe.bundle.js.map similarity index 97% rename from storybook/961.dd941168.iframe.bundle.js.map rename to storybook/961.12acffc2.iframe.bundle.js.map index 1a7a4b5ef..951c81872 100644 --- a/storybook/961.dd941168.iframe.bundle.js.map +++ b/storybook/961.12acffc2.iframe.bundle.js.map @@ -1 +1 @@ -{"version":3,"file":"961.dd941168.iframe.bundle.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AA+BA;;;;;;;AASA;;;;;;;AASA","sources":["webpack://ddangkong-frontend/./src/components/SelectContainer/Timer/Timer.styled.ts"],"sourcesContent":["import { css, keyframes } from '@emotion/react';\n\nimport { Theme } from '@/styles/Theme';\n\nconst shake = keyframes`\n 0%{\n transform: rotate(0deg);\n }\n 10%{\n transform: scale(1.5) rotate(45deg);\n }\n 20%{\n transform: scale(1.5) rotate(-45deg);\n }\n 30%{\n transform: rotate(30deg);\n }\n 40%{\n transform: rotate(-30deg);\n }\n 50%{\n transform: rotate(10deg);\n }\n 60%{\n transform: rotate(-10deg);\n }\n 100%{\n transform: rotate(0deg);\n }\n`;\n\nconst progress = keyframes`\n 0% {\n transform: scaleX(1);\n }\n 100% {\n transform: scaleX(0);\n }\n`;\n\nconst timerTransition = keyframes`\n 0% {\n transform: translateX(0);\n }\n 100%{\n transform: translateX(-95%);\n }\n`;\n\nexport const timerLayout = css`\n display: flex;\n position: relative;\n align-items: center;\n width: 100%;\n height: 3.2rem;\n padding: 0 1rem;\n border-radius: ${Theme.borderRadius.radius30};\n\n background-color: ${Theme.color.peanut200};\n box-sizing: border-box;\n`;\n\nexport const timerInnerLayout = (timeLimit: number) => css`\n display: flex;\n justify-content: center;\n align-items: center;\n\n width: 100%;\n height: 60%;\n border-radius: ${Theme.borderRadius.radius30};\n\n background-color: ${Theme.color.peanut500};\n\n transform-origin: left;\n\n animation: ${progress} ${timeLimit + 1}s linear;\n`;\n\nexport const timerWrapper = (timeLimit: number) => css`\n display: flex;\n position: absolute;\n flex-direction: column;\n justify-content: center;\n align-items: flex-end;\n\n width: 100%;\n height: 4rem;\n\n animation: ${timerTransition} ${timeLimit + 1}s linear;\n`;\n\nexport const timerIcon = css`\n position: absolute;\n width: 4.8rem;\n height: 4.8rem;\n`;\n\nexport const timerIconShake = css`\n animation: ${shake} 1s linear infinite;\n`;\n\nexport const timerText = (isAlmostFinished: boolean) => css`\n position: absolute;\n top: 5.2rem;\n\n color: ${isAlmostFinished ? 'red' : 'black'};\n font-weight: bold;\n font-size: 1.6rem;\n`;\n"],"names":[],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"961.12acffc2.iframe.bundle.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AA+BA;;;;;;;AASA;;;;;;;AASA","sources":["webpack://ddangkong-frontend/./src/components/SelectContainer/Timer/Timer.styled.ts"],"sourcesContent":["import { css, keyframes } from '@emotion/react';\n\nimport { Theme } from '@/styles/Theme';\n\nconst shake = keyframes`\n 0%{\n transform: rotate(0deg);\n }\n 10%{\n transform: scale(1.5) rotate(45deg);\n }\n 20%{\n transform: scale(1.5) rotate(-45deg);\n }\n 30%{\n transform: rotate(30deg);\n }\n 40%{\n transform: rotate(-30deg);\n }\n 50%{\n transform: rotate(10deg);\n }\n 60%{\n transform: rotate(-10deg);\n }\n 100%{\n transform: rotate(0deg);\n }\n`;\n\nconst progress = keyframes`\n 0% {\n transform: scaleX(1);\n }\n 100% {\n transform: scaleX(0);\n }\n`;\n\nconst timerTransition = keyframes`\n 0% {\n transform: translateX(0);\n }\n 100%{\n transform: translateX(-95%);\n }\n`;\n\nexport const timerLayout = css`\n display: flex;\n position: relative;\n align-items: center;\n width: 100%;\n height: 3.2rem;\n padding: 0 1rem;\n border-radius: ${Theme.borderRadius.radius30};\n\n background-color: ${Theme.color.peanut200};\n box-sizing: border-box;\n`;\n\nexport const timerInnerLayout = (timeLimit: number) => css`\n display: flex;\n justify-content: center;\n align-items: center;\n\n width: 100%;\n height: 60%;\n border-radius: ${Theme.borderRadius.radius30};\n\n background-color: ${Theme.color.peanut500};\n\n transform-origin: left;\n\n animation: ${progress} ${timeLimit + 1}s linear;\n`;\n\nexport const timerWrapper = (timeLimit: number) => css`\n display: flex;\n position: absolute;\n flex-direction: column;\n justify-content: center;\n align-items: flex-end;\n\n width: 100%;\n height: 4rem;\n\n animation: ${timerTransition} ${timeLimit + 1}s linear;\n`;\n\nexport const timerIcon = css`\n position: absolute;\n width: 4.8rem;\n height: 4.8rem;\n`;\n\nexport const timerIconShake = css`\n animation: ${shake} 1s linear infinite;\n`;\n\nexport const timerText = (isAlmostFinished: boolean) => css`\n position: absolute;\n top: 5.2rem;\n\n color: ${isAlmostFinished ? 'red' : 'black'};\n font-weight: bold;\n font-size: 1.6rem;\n`;\n"],"names":[],"sourceRoot":""} \ No newline at end of file diff --git a/storybook/components-RoomSetting-RoomSetting-stories.221dd454.iframe.bundle.js b/storybook/components-RoomSetting-RoomSetting-stories.846201cb.iframe.bundle.js similarity index 67% rename from storybook/components-RoomSetting-RoomSetting-stories.221dd454.iframe.bundle.js rename to storybook/components-RoomSetting-RoomSetting-stories.846201cb.iframe.bundle.js index 6f216e7f8..7fe553a81 100644 --- a/storybook/components-RoomSetting-RoomSetting-stories.221dd454.iframe.bundle.js +++ b/storybook/components-RoomSetting-RoomSetting-stories.846201cb.iframe.bundle.js @@ -1 +1 @@ -"use strict";(self.webpackChunkddangkong_frontend=self.webpackChunkddangkong_frontend||[]).push([[615],{"./src/components/RoomSetting/RoomSetting.stories.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{__namedExportsOrder:()=>__namedExportsOrder,default:()=>__WEBPACK_DEFAULT_EXPORT__,기본값:()=>기본값});const meta={title:"RoomSetting",component:__webpack_require__("./src/components/RoomSetting/RoomSetting.tsx").A},기본값={args:{category:"재미"}},__WEBPACK_DEFAULT_EXPORT__=meta,__namedExportsOrder=["기본값"];기본값.parameters={...기본값.parameters,docs:{...기본값.parameters?.docs,source:{originalSource:"{\n args: {\n category: '재미'\n }\n}",...기본값.parameters?.docs?.source}}}},"./src/components/RoomSetting/RoomSetting.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>RoomSetting_RoomSetting});var react=__webpack_require__("./node_modules/react/index.js"),es=__webpack_require__("./node_modules/recoil/es/index.js"),emotion_react_browser_esm=__webpack_require__("./node_modules/@emotion/react/dist/emotion-react.browser.esm.js"),Theme=__webpack_require__("./src/styles/Theme.ts"),getBorderRadius=__webpack_require__("./src/styles/utils/getBorderRadius.ts");const roomSettingLayout=(0,emotion_react_browser_esm.AH)("display:flex;justify-content:space-evenly;align-items:center;width:100%;height:10rem;padding:1.6rem 0 2.4rem;border-radius:",(0,getBorderRadius.A)("medium"),";background-color:",Theme.S.color.peanut400,";cursor:pointer;",""),roomSettingBox={name:"4zk4ri",styles:"display:flex;flex-direction:column;gap:1rem"},bigTitle={name:"whr9hd",styles:"font-weight:800;font-size:2.8rem"},smallTitle={name:"9mlb8s",styles:"font-weight:800;font-size:2rem"},roomSettingLabel={name:"16ceglb",styles:"font-weight:600"};var A11yOnly=__webpack_require__("./src/components/common/a11yOnly/A11yOnly.tsx"),RoomSettingModal=__webpack_require__("./src/components/common/RoomSettingModal/RoomSettingModal.tsx"),useGetRoomInfo=__webpack_require__("./src/hooks/useGetRoomInfo.ts"),useModal=__webpack_require__("./src/hooks/useModal.ts"),atom=__webpack_require__("./src/recoil/atom.ts"),emotion_react_jsx_runtime_browser_esm=__webpack_require__("./node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js");const RoomSetting=()=>{const returnFocusRef=(0,react.useRef)(null),{roomSetting}=(0,useGetRoomInfo.$)(),{isMaster}=(0,es.vc)(atom.u),{show}=(0,useModal.A)(),screenReaderRoomSetting=`\n 방 정보.\n 카테고리 ${roomSetting.category.label}. \n 라운드 ${roomSetting.totalRound}. \n 제한시간 ${roomSetting.timeLimit/1e3}초.`;return(0,emotion_react_jsx_runtime_browser_esm.FD)(emotion_react_jsx_runtime_browser_esm.FK,{children:[(0,emotion_react_jsx_runtime_browser_esm.Y)(A11yOnly.A,{"aria-live":"polite",children:screenReaderRoomSetting}),(0,emotion_react_jsx_runtime_browser_esm.FD)("button",{"aria-label":"방 설정",css:roomSettingLayout,onClick:isMaster?()=>{show(RoomSettingModal.A,{returnFocusRef})}:()=>{},ref:returnFocusRef,children:[(0,emotion_react_jsx_runtime_browser_esm.FD)("div",{css:roomSettingBox,children:[(0,emotion_react_jsx_runtime_browser_esm.Y)("span",{css:roomSettingLabel,children:"라운드"}),(0,emotion_react_jsx_runtime_browser_esm.Y)("h2",{css:smallTitle,children:roomSetting.totalRound})]}),(0,emotion_react_jsx_runtime_browser_esm.FD)("div",{css:roomSettingBox,children:[(0,emotion_react_jsx_runtime_browser_esm.Y)("span",{css:roomSettingLabel,children:"카테고리"}),(0,emotion_react_jsx_runtime_browser_esm.Y)("h2",{css:bigTitle,children:roomSetting.category.label})]}),(0,emotion_react_jsx_runtime_browser_esm.FD)("div",{css:roomSettingBox,children:[(0,emotion_react_jsx_runtime_browser_esm.Y)("span",{css:roomSettingLabel,children:"제한 시간"}),(0,emotion_react_jsx_runtime_browser_esm.FD)("h2",{css:smallTitle,children:[roomSetting.timeLimit/1e3,"초"]})]})]})]})},RoomSetting_RoomSetting=RoomSetting;RoomSetting.__docgenInfo={description:"",methods:[],displayName:"RoomSetting"}},"./src/components/common/a11yOnly/A11yOnly.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>a11yOnly_A11yOnly});const a11yOnlyLayout={name:"90pyz3",styles:"overflow:hidden;position:absolute;width:1px;height:1px;margin:-1px;padding:0;border:0;white-space:nowrap;clip:rect(0, 0, 0, 0)"};var emotion_react_jsx_runtime_browser_esm=__webpack_require__("./node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js");const A11yOnly=({as,role="text",children,...props})=>{const Component=as||"span";return(0,emotion_react_jsx_runtime_browser_esm.Y)(Component,{css:a11yOnlyLayout,role,...props,children})},a11yOnly_A11yOnly=A11yOnly;A11yOnly.__docgenInfo={description:"",methods:[],displayName:"A11yOnly",props:{as:{required:!1,tsType:{name:"T"},description:""},role:{required:!1,tsType:{name:"AriaRole"},description:"",defaultValue:{value:"'text'",computed:!1}}}}},"./src/hooks/useModal.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>__WEBPACK_DEFAULT_EXPORT__});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),_providers_ModalProvider_ModalProvider__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/providers/ModalProvider/ModalProvider.tsx");const __WEBPACK_DEFAULT_EXPORT__=()=>{const dispatch=(0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(_providers_ModalProvider_ModalProvider__WEBPACK_IMPORTED_MODULE_1__.L);if(null===dispatch)throw new Error("ModalDispatchContext가 존재하지 않습니다.");return dispatch}},"./src/recoil/atom.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{k:()=>roomUuidState,u:()=>memberInfoState});var recoil__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/recoil/es/index.js");const memberInfoState=(0,recoil__WEBPACK_IMPORTED_MODULE_0__.eU)({key:"memberInfo",default:{memberId:null,nickname:null,isMaster:!1}}),roomUuidState=(0,recoil__WEBPACK_IMPORTED_MODULE_0__.eU)({key:"roomUuid",default:""})},"./src/styles/utils/getBorderRadius.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>__WEBPACK_DEFAULT_EXPORT__});var _styles_Theme__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./src/styles/Theme.ts");const __WEBPACK_DEFAULT_EXPORT__=radius=>{switch(radius){case"small":return _styles_Theme__WEBPACK_IMPORTED_MODULE_0__.S.borderRadius.radius10;case"medium":return _styles_Theme__WEBPACK_IMPORTED_MODULE_0__.S.borderRadius.radius20;case"large":return _styles_Theme__WEBPACK_IMPORTED_MODULE_0__.S.borderRadius.radius30;default:return"0"}}}}]); \ No newline at end of file +"use strict";(self.webpackChunkddangkong_frontend=self.webpackChunkddangkong_frontend||[]).push([[615],{"./src/components/RoomSetting/RoomSetting.stories.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{__namedExportsOrder:()=>__namedExportsOrder,default:()=>__WEBPACK_DEFAULT_EXPORT__,기본값:()=>기본값});const meta={title:"RoomSetting",component:__webpack_require__("./src/components/RoomSetting/RoomSetting.tsx").A},기본값={args:{category:"재미"}},__WEBPACK_DEFAULT_EXPORT__=meta,__namedExportsOrder=["기본값"];기본값.parameters={...기본값.parameters,docs:{...기본값.parameters?.docs,source:{originalSource:"{\n args: {\n category: '재미'\n }\n}",...기본값.parameters?.docs?.source}}}},"./src/components/RoomSetting/RoomSetting.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>RoomSetting_RoomSetting});var react=__webpack_require__("./node_modules/react/index.js"),es=__webpack_require__("./node_modules/recoil/es/index.js"),emotion_react_browser_esm=__webpack_require__("./node_modules/@emotion/react/dist/emotion-react.browser.esm.js"),Theme=__webpack_require__("./src/styles/Theme.ts"),getBorderRadius=__webpack_require__("./src/styles/utils/getBorderRadius.ts");const roomSettingLayout=(0,emotion_react_browser_esm.AH)("display:flex;justify-content:space-evenly;align-items:center;width:100%;height:10rem;padding:1.6rem 0 2.4rem;border-radius:",(0,getBorderRadius.A)("medium"),";background-color:",Theme.S.color.peanut400,";cursor:pointer;",""),roomSettingBox={name:"4zk4ri",styles:"display:flex;flex-direction:column;gap:1rem"},bigTitle={name:"whr9hd",styles:"font-weight:800;font-size:2.8rem"},smallTitle={name:"9mlb8s",styles:"font-weight:800;font-size:2rem"},roomSettingLabel={name:"16ceglb",styles:"font-weight:600"};var A11yOnly=__webpack_require__("./src/components/common/a11yOnly/A11yOnly.tsx"),RoomSettingModal=__webpack_require__("./src/components/common/RoomSettingModal/RoomSettingModal.tsx"),useGetRoomInfo=__webpack_require__("./src/hooks/useGetRoomInfo.ts"),useModal=__webpack_require__("./src/hooks/useModal.ts"),atom=__webpack_require__("./src/recoil/atom.ts"),emotion_react_jsx_runtime_browser_esm=__webpack_require__("./node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js");const RoomSetting=()=>{const returnFocusRef=(0,react.useRef)(null),{roomSetting}=(0,useGetRoomInfo.$)(),{isMaster}=(0,es.vc)(atom.u),{show}=(0,useModal.A)(),screenReaderRoomSetting=`\n 방 정보.\n 카테고리 ${roomSetting.category.label}. \n 라운드 ${roomSetting.totalRound}. \n 제한시간 ${roomSetting.timeLimit/1e3}초.`;return(0,emotion_react_jsx_runtime_browser_esm.FD)(emotion_react_jsx_runtime_browser_esm.FK,{children:[(0,emotion_react_jsx_runtime_browser_esm.Y)(A11yOnly.A,{"aria-live":"polite",children:screenReaderRoomSetting}),(0,emotion_react_jsx_runtime_browser_esm.FD)("button",{"aria-label":"방 설정",css:roomSettingLayout,onClick:isMaster?()=>{show(RoomSettingModal.A,{returnFocusRef})}:()=>{},ref:returnFocusRef,children:[(0,emotion_react_jsx_runtime_browser_esm.FD)("div",{css:roomSettingBox,children:[(0,emotion_react_jsx_runtime_browser_esm.Y)("span",{css:roomSettingLabel,children:"라운드"}),(0,emotion_react_jsx_runtime_browser_esm.Y)("h2",{css:smallTitle,children:roomSetting.totalRound})]}),(0,emotion_react_jsx_runtime_browser_esm.FD)("div",{css:roomSettingBox,children:[(0,emotion_react_jsx_runtime_browser_esm.Y)("span",{css:roomSettingLabel,children:"카테고리"}),(0,emotion_react_jsx_runtime_browser_esm.Y)("h2",{css:bigTitle,children:roomSetting.category.label})]}),(0,emotion_react_jsx_runtime_browser_esm.FD)("div",{css:roomSettingBox,children:[(0,emotion_react_jsx_runtime_browser_esm.Y)("span",{css:roomSettingLabel,children:"제한 시간"}),(0,emotion_react_jsx_runtime_browser_esm.FD)("h2",{css:smallTitle,children:[roomSetting.timeLimit/1e3,"초"]})]})]})]})},RoomSetting_RoomSetting=RoomSetting;RoomSetting.__docgenInfo={description:"",methods:[],displayName:"RoomSetting"}},"./src/components/common/a11yOnly/A11yOnly.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>a11yOnly_A11yOnly});const a11yOnlyLayout={name:"90pyz3",styles:"overflow:hidden;position:absolute;width:1px;height:1px;margin:-1px;padding:0;border:0;white-space:nowrap;clip:rect(0, 0, 0, 0)"};var emotion_react_jsx_runtime_browser_esm=__webpack_require__("./node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js");const A11yOnly=({as,children,...props})=>{const Component=as||"span";return(0,emotion_react_jsx_runtime_browser_esm.Y)(Component,{css:a11yOnlyLayout,...props,children})},a11yOnly_A11yOnly=A11yOnly;A11yOnly.__docgenInfo={description:"",methods:[],displayName:"A11yOnly",props:{as:{required:!1,tsType:{name:"T"},description:""},role:{required:!1,tsType:{name:"AriaRole"},description:""}}}},"./src/hooks/useModal.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>__WEBPACK_DEFAULT_EXPORT__});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),_providers_ModalProvider_ModalProvider__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/providers/ModalProvider/ModalProvider.tsx");const __WEBPACK_DEFAULT_EXPORT__=()=>{const dispatch=(0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(_providers_ModalProvider_ModalProvider__WEBPACK_IMPORTED_MODULE_1__.L);if(null===dispatch)throw new Error("ModalDispatchContext가 존재하지 않습니다.");return dispatch}},"./src/recoil/atom.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{k:()=>roomUuidState,u:()=>memberInfoState});var recoil__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/recoil/es/index.js");const memberInfoState=(0,recoil__WEBPACK_IMPORTED_MODULE_0__.eU)({key:"memberInfo",default:{memberId:null,nickname:null,isMaster:!1}}),roomUuidState=(0,recoil__WEBPACK_IMPORTED_MODULE_0__.eU)({key:"roomUuid",default:""})},"./src/styles/utils/getBorderRadius.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>__WEBPACK_DEFAULT_EXPORT__});var _styles_Theme__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./src/styles/Theme.ts");const __WEBPACK_DEFAULT_EXPORT__=radius=>{switch(radius){case"small":return _styles_Theme__WEBPACK_IMPORTED_MODULE_0__.S.borderRadius.radius10;case"medium":return _styles_Theme__WEBPACK_IMPORTED_MODULE_0__.S.borderRadius.radius20;case"large":return _styles_Theme__WEBPACK_IMPORTED_MODULE_0__.S.borderRadius.radius30;default:return"0"}}}}]); \ No newline at end of file diff --git a/storybook/components-SelectContainer-Timer-Timer-stories.f027144f.iframe.bundle.js b/storybook/components-SelectContainer-Timer-Timer-stories.edb58f69.iframe.bundle.js similarity index 81% rename from storybook/components-SelectContainer-Timer-Timer-stories.f027144f.iframe.bundle.js rename to storybook/components-SelectContainer-Timer-Timer-stories.edb58f69.iframe.bundle.js index 8a2c239fe..d35c14fed 100644 --- a/storybook/components-SelectContainer-Timer-Timer-stories.f027144f.iframe.bundle.js +++ b/storybook/components-SelectContainer-Timer-Timer-stories.edb58f69.iframe.bundle.js @@ -1 +1 @@ -"use strict";(self.webpackChunkddangkong_frontend=self.webpackChunkddangkong_frontend||[]).push([[117],{"./src/components/SelectContainer/Timer/Timer.stories.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{__namedExportsOrder:()=>__namedExportsOrder,default:()=>__WEBPACK_DEFAULT_EXPORT__,기본_타이머:()=>기본_타이머});const __WEBPACK_DEFAULT_EXPORT__={title:"Timer",component:__webpack_require__("./src/components/SelectContainer/Timer/Timer.tsx").A},기본_타이머={},__namedExportsOrder=["기본_타이머"];기본_타이머.parameters={...기본_타이머.parameters,docs:{...기본_타이머.parameters?.docs,source:{originalSource:"{}",...기본_타이머.parameters?.docs?.source}}}},"./node_modules/@tanstack/react-query/build/modern/useMutation.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{n:()=>useMutation});var react=__webpack_require__("./node_modules/react/index.js"),mutation=__webpack_require__("./node_modules/@tanstack/query-core/build/modern/mutation.js"),notifyManager=__webpack_require__("./node_modules/@tanstack/query-core/build/modern/notifyManager.js"),subscribable=__webpack_require__("./node_modules/@tanstack/query-core/build/modern/subscribable.js"),utils=__webpack_require__("./node_modules/@tanstack/query-core/build/modern/utils.js"),MutationObserver=class extends subscribable.Q{#client;#currentResult=void 0;#currentMutation;#mutateOptions;constructor(client,options){super(),this.#client=client,this.setOptions(options),this.bindMethods(),this.#updateResult()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(options){const prevOptions=this.options;this.options=this.#client.defaultMutationOptions(options),(0,utils.f8)(this.options,prevOptions)||this.#client.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#currentMutation,observer:this}),prevOptions?.mutationKey&&this.options.mutationKey&&(0,utils.EN)(prevOptions.mutationKey)!==(0,utils.EN)(this.options.mutationKey)?this.reset():"pending"===this.#currentMutation?.state.status&&this.#currentMutation.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#currentMutation?.removeObserver(this)}onMutationUpdate(action){this.#updateResult(),this.#notify(action)}getCurrentResult(){return this.#currentResult}reset(){this.#currentMutation?.removeObserver(this),this.#currentMutation=void 0,this.#updateResult(),this.#notify()}mutate(variables,options){return this.#mutateOptions=options,this.#currentMutation?.removeObserver(this),this.#currentMutation=this.#client.getMutationCache().build(this.#client,this.options),this.#currentMutation.addObserver(this),this.#currentMutation.execute(variables)}#updateResult(){const state=this.#currentMutation?.state??(0,mutation.$)();this.#currentResult={...state,isPending:"pending"===state.status,isSuccess:"success"===state.status,isError:"error"===state.status,isIdle:"idle"===state.status,mutate:this.mutate,reset:this.reset}}#notify(action){notifyManager.j.batch((()=>{if(this.#mutateOptions&&this.hasListeners()){const variables=this.#currentResult.variables,context=this.#currentResult.context;"success"===action?.type?(this.#mutateOptions.onSuccess?.(action.data,variables,context),this.#mutateOptions.onSettled?.(action.data,null,variables,context)):"error"===action?.type&&(this.#mutateOptions.onError?.(action.error,variables,context),this.#mutateOptions.onSettled?.(void 0,action.error,variables,context))}this.listeners.forEach((listener=>{listener(this.#currentResult)}))}))}},QueryClientProvider=__webpack_require__("./node_modules/@tanstack/react-query/build/modern/QueryClientProvider.js"),modern_utils=__webpack_require__("./node_modules/@tanstack/react-query/build/modern/utils.js");function useMutation(options,queryClient){const client=(0,QueryClientProvider.jE)(queryClient),[observer]=react.useState((()=>new MutationObserver(client,options)));react.useEffect((()=>{observer.setOptions(options)}),[observer,options]);const result=react.useSyncExternalStore(react.useCallback((onStoreChange=>observer.subscribe(notifyManager.j.batchCalls(onStoreChange))),[observer]),(()=>observer.getCurrentResult()),(()=>observer.getCurrentResult())),mutate=react.useCallback(((variables,mutateOptions)=>{observer.mutate(variables,mutateOptions).catch(modern_utils.l)}),[observer]);if(result.error&&(0,modern_utils.G)(observer.options.throwOnError,[result.error]))throw result.error;return{...result,mutate,mutateAsync:result.mutate}}},"./node_modules/@tanstack/react-query/build/modern/useQuery.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{I:()=>useQuery});var _tanstack_query_core__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/@tanstack/query-core/build/modern/queryObserver.js"),_useBaseQuery_js__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/@tanstack/react-query/build/modern/useBaseQuery.js");function useQuery(options,queryClient){return(0,_useBaseQuery_js__WEBPACK_IMPORTED_MODULE_0__.t)(options,_tanstack_query_core__WEBPACK_IMPORTED_MODULE_1__.$,queryClient)}},"./src/apis/balanceContent.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Gd:()=>fetchBalanceContent,O:()=>fetchRoundVoteResult,bR:()=>checkMyGameStatus,jd:()=>fetchVoteIsFinished,sl:()=>voteBalanceContent});var _fetcher__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./src/apis/fetcher.ts"),_constants_url__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/constants/url.ts");const fetchBalanceContent=async roomId=>{const res=await _fetcher__WEBPACK_IMPORTED_MODULE_0__.A.get({url:_constants_url__WEBPACK_IMPORTED_MODULE_1__.H$.balanceContent(roomId)});return await res.json()},voteBalanceContent=async({optionId,contentId,roomId,memberId})=>{const res=await _fetcher__WEBPACK_IMPORTED_MODULE_0__.A.post({url:_constants_url__WEBPACK_IMPORTED_MODULE_1__.H$.vote(roomId,contentId),headers:{"Content-Type":"application/json"},body:{memberId,optionId}});return await res.json()},fetchRoundVoteResult=async({contentId,roomId})=>{const res=await _fetcher__WEBPACK_IMPORTED_MODULE_0__.A.get({url:_constants_url__WEBPACK_IMPORTED_MODULE_1__.H$.roundVoteResult(roomId,contentId)});return await res.json()},checkMyGameStatus=async({roomId,currentRound})=>{const res=await _fetcher__WEBPACK_IMPORTED_MODULE_0__.A.get({url:_constants_url__WEBPACK_IMPORTED_MODULE_1__.H$.myGameStatus(roomId,currentRound),headers:{"Content-Type":"application/json"}});return await res.json()},fetchVoteIsFinished=async({contentId,roomId})=>{const res=await _fetcher__WEBPACK_IMPORTED_MODULE_0__.A.get({url:_constants_url__WEBPACK_IMPORTED_MODULE_1__.H$.voteIsFinished(roomId,contentId)});return await res.json()}},"./src/apis/fetcher.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>apis_fetcher});const ERROR_MESSAGE={NOT_READY_ROOM:"해당 방의 게임이 이미 시작되었어요. 게임이 끝날 때까지 기다려볼까요?",NOT_PROGRESSED_ROOM:"이미 게임이 종료되었어요. 최종 결과를 확인해볼까요?",NOT_FINISHED_ROOM:"해당 방의 게임이 아직 종료되지 않았어요.",NOT_FOUND_ROOM:"해당 방을 찾을 수 없어요. 방을 새로 만들어주세요!",NOT_ROOM_MEMBER:"사용자가 해당 방에 존재하지 않아요. 다시 접속해볼까요?",EXCEED_MAX_MEMBER_COUNT:"방의 최대 인원을 초과했습니다.",ALREADY_EXIST_MASTER:"이미 방장이 존재합니다.",ALREADY_MASTER:"해당 멤버는 이미 방장입니다.",INVALID_MASTER_CREATION:"방에 멤버가 존재하면 방장을 생성할 수 없습니다.",NOT_EXIST_MASTER:"방장이 존재하지 않습니다.",NOT_EXIST_COMMON:"일반 멤버가 존재하지 않습니다.",INVALID_TIME_LIMIT:"타이머는 10초, 15초, 30초, 60초로만 설정 가능합니다.",INVALID_RANGE_TOTAL_ROUND:"총 라운드는 5, 7, 10 라운드로만 설정 가능합니다.",EMPTY_VOTE_DEADLINE:"라운드 종료 시간이 설정되지 않았습니다.",MISMATCH_ROUND:"이미 다음 라운드가 시작되었어요. 해당 라운드가 끝날 때까지 잠시만 기다려주세요!",ROUND_LESS_THAN_START_ROUND:"startRound보다 크거나 같아야 합니다.",ROUND_GREATER_THAN_CURRENT_ROUND:"currentRound보다 작거나 같아야 합니다.",INVALID_ROUND_GAP:"currentRound과 round의 차이는 ?이하여야 합니다.",NOT_FOUND_BALANCE_CONTENT:"존재하지 않는 컨텐츠네요. 게임을 다시 진행해주세요!",NOT_FOUND_ROOM_CONTENT:"해당 방에 존재하지 않은 컨텐츠입니다. 게임을 다시 진행해주세요!",NO_RESOURCE_FOUND:"요청한 리소스를 찾을 수 없습니다. 게임을 다시 진행해주세요!",NOT_FOUND_BALANCE_OPTION:"옵션을 올바르게 선택해주세요.",ALREADY_VOTED:"이미 투표가 반영되었어요. 해당 라운드가 끝날 때까지 기다려볼까요?",VOTE_FINISHED:"투표가 이미 종료되었어요.",VOTE_NOT_FINISHED:"이미 다음 라운드가 시작되었어요. 해당 라운드가 끝날 때까지 잠시만 기다려주세요!",CAN_NOT_CHECK_MATCHING_PERCENT:"종료되지 않은 방의 투표 매칭도는 확인할 수 없습니다.",FIELD_ERROR:"필드값 입력이 잘못되었습니다.",URL_PARAMETER_ERROR:"URL parameter 입력이 잘못되었습니다.",METHOD_ARGUMENT_TYPE_MISMATCH:"입력한 값의 타입이 잘못되었습니다.",METHOD_NOT_SUPPORTED:"허용되지 않은 메서드입니다.",INTERNAL_SERVER_ERROR:"서버에 오류가 발생했어요. 다시 시도해 주세요!",NOT_FOUND_COOKIE:"사용자 정보가 있어야 방에 참여할 수 있어요. 홈화면으로 이동하여 방을 새로 만들어주세요!",INVALID_COOKIE:"사용자 정보가 있어야 방에 참여할 수 있어요. 홈화면으로 이동하여 방을 새로 만들어주세요!"};class CustomError extends Error{constructor({errorCode,status}){super(),this.errorCode=errorCode,this.message=ERROR_MESSAGE[errorCode],this.status=status}}class NetworkError extends Error{status=555;message="네트워크가 불안정해요. 다시 시도해주세요!"}const apis_fetcher={async request({url,method,body,headers}){try{const response=await fetch(url,{method,body:body&&JSON.stringify(body),headers:headers&&headers});if(!response.ok){const apiError=await response.json();throw new CustomError({...apiError,status:response.status})}return response}catch(error){if(error instanceof CustomError)throw error;throw new NetworkError}},get({url,headers}){return this.request({url,method:"GET",headers})},post({url,body,headers}){return this.request({url,method:"POST",body,headers})},delete({url,headers}){return this.request({url,method:"DELETE",headers})},patch({url,body,headers}){return this.request({url,method:"PATCH",body,headers})},put({url,headers}){return this.request({url,method:"PUT",headers})}}},"./src/components/SelectContainer/Timer/Timer.util.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Nc:()=>convertMsecToSecond,qE:()=>formatLeftRoundTime,wk:()=>isAlertTimer});var _constants_config__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./src/constants/config.ts");const formatLeftRoundTime=leftRoundTime=>{const minutes=Math.floor(leftRoundTime/60),seconds=leftRoundTime%60;return`${String(minutes).padStart(2,"0")}:${String(seconds).padStart(2,"0")}`},convertMsecToSecond=msec=>msec/_constants_config__WEBPACK_IMPORTED_MODULE_0__.S2,isAlertTimer=(leftRoundTime,timeLimit)=>leftRoundTime===Math.floor(timeLimit/2)||leftRoundTime===_constants_config__WEBPACK_IMPORTED_MODULE_0__.cZ},"./src/components/common/a11yOnly/A11yOnly.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>a11yOnly_A11yOnly});const a11yOnlyLayout={name:"90pyz3",styles:"overflow:hidden;position:absolute;width:1px;height:1px;margin:-1px;padding:0;border:0;white-space:nowrap;clip:rect(0, 0, 0, 0)"};var emotion_react_jsx_runtime_browser_esm=__webpack_require__("./node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js");const A11yOnly=({as,role="text",children,...props})=>{const Component=as||"span";return(0,emotion_react_jsx_runtime_browser_esm.Y)(Component,{css:a11yOnlyLayout,role,...props,children})},a11yOnly_A11yOnly=A11yOnly;A11yOnly.__docgenInfo={description:"",methods:[],displayName:"A11yOnly",props:{as:{required:!1,tsType:{name:"T"},description:""},role:{required:!1,tsType:{name:"AriaRole"},description:"",defaultValue:{value:"'text'",computed:!1}}}}},"./src/constants/queryKeys.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{e:()=>QUERY_KEYS});const QUERY_KEYS={balanceContent:"balanceContent",matchingResult:"matchingResult",roundVoteResult:"roundVoteResult",myGameStatus:"myGameStatus",roundIsFinished:"roundIsFinished",roomMembers:"roomMembers",isRoomInitial:"isRoomInitial",categoryList:"categoryList"}},"./src/constants/routes.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{b:()=>ROUTES});const ROUTES={main:"/",nickname:"/nickname",ready:roomId=>`/${roomId}/ready`,game:roomId=>`/${roomId}/game`,roundResult:roomId=>`/${roomId}/round/result`,roundResultVote:"/round/result/vote",gameResult:roomId=>`/${roomId}/game/result`,roundResultStatus:roomId=>`/${roomId}/round/result/status`}},"./src/hooks/useBalanceContentQuery.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>__WEBPACK_DEFAULT_EXPORT__});var _tanstack_react_query__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/@tanstack/react-query/build/modern/useSuspenseQuery.js"),_apis_balanceContent__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./src/apis/balanceContent.ts"),_constants_queryKeys__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/constants/queryKeys.ts");const __WEBPACK_DEFAULT_EXPORT__=roomId=>{const balanceContentQuery=(0,_tanstack_react_query__WEBPACK_IMPORTED_MODULE_2__.U)({queryKey:[_constants_queryKeys__WEBPACK_IMPORTED_MODULE_1__.e.balanceContent,Number(roomId)],queryFn:async()=>await(0,_apis_balanceContent__WEBPACK_IMPORTED_MODULE_0__.Gd)(Number(roomId))});return{...balanceContentQuery,balanceContent:balanceContentQuery.data}}},"./src/recoil/atom.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{k:()=>roomUuidState,u:()=>memberInfoState});var recoil__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/recoil/es/index.js");const memberInfoState=(0,recoil__WEBPACK_IMPORTED_MODULE_0__.eU)({key:"memberInfo",default:{memberId:null,nickname:null,isMaster:!1}}),roomUuidState=(0,recoil__WEBPACK_IMPORTED_MODULE_0__.eU)({key:"roomUuid",default:""})}}]); \ No newline at end of file +"use strict";(self.webpackChunkddangkong_frontend=self.webpackChunkddangkong_frontend||[]).push([[117],{"./src/components/SelectContainer/Timer/Timer.stories.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{__namedExportsOrder:()=>__namedExportsOrder,default:()=>__WEBPACK_DEFAULT_EXPORT__,기본_타이머:()=>기본_타이머});const __WEBPACK_DEFAULT_EXPORT__={title:"Timer",component:__webpack_require__("./src/components/SelectContainer/Timer/Timer.tsx").A},기본_타이머={},__namedExportsOrder=["기본_타이머"];기본_타이머.parameters={...기본_타이머.parameters,docs:{...기본_타이머.parameters?.docs,source:{originalSource:"{}",...기본_타이머.parameters?.docs?.source}}}},"./node_modules/@tanstack/react-query/build/modern/useMutation.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{n:()=>useMutation});var react=__webpack_require__("./node_modules/react/index.js"),mutation=__webpack_require__("./node_modules/@tanstack/query-core/build/modern/mutation.js"),notifyManager=__webpack_require__("./node_modules/@tanstack/query-core/build/modern/notifyManager.js"),subscribable=__webpack_require__("./node_modules/@tanstack/query-core/build/modern/subscribable.js"),utils=__webpack_require__("./node_modules/@tanstack/query-core/build/modern/utils.js"),MutationObserver=class extends subscribable.Q{#client;#currentResult=void 0;#currentMutation;#mutateOptions;constructor(client,options){super(),this.#client=client,this.setOptions(options),this.bindMethods(),this.#updateResult()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(options){const prevOptions=this.options;this.options=this.#client.defaultMutationOptions(options),(0,utils.f8)(this.options,prevOptions)||this.#client.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#currentMutation,observer:this}),prevOptions?.mutationKey&&this.options.mutationKey&&(0,utils.EN)(prevOptions.mutationKey)!==(0,utils.EN)(this.options.mutationKey)?this.reset():"pending"===this.#currentMutation?.state.status&&this.#currentMutation.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#currentMutation?.removeObserver(this)}onMutationUpdate(action){this.#updateResult(),this.#notify(action)}getCurrentResult(){return this.#currentResult}reset(){this.#currentMutation?.removeObserver(this),this.#currentMutation=void 0,this.#updateResult(),this.#notify()}mutate(variables,options){return this.#mutateOptions=options,this.#currentMutation?.removeObserver(this),this.#currentMutation=this.#client.getMutationCache().build(this.#client,this.options),this.#currentMutation.addObserver(this),this.#currentMutation.execute(variables)}#updateResult(){const state=this.#currentMutation?.state??(0,mutation.$)();this.#currentResult={...state,isPending:"pending"===state.status,isSuccess:"success"===state.status,isError:"error"===state.status,isIdle:"idle"===state.status,mutate:this.mutate,reset:this.reset}}#notify(action){notifyManager.j.batch((()=>{if(this.#mutateOptions&&this.hasListeners()){const variables=this.#currentResult.variables,context=this.#currentResult.context;"success"===action?.type?(this.#mutateOptions.onSuccess?.(action.data,variables,context),this.#mutateOptions.onSettled?.(action.data,null,variables,context)):"error"===action?.type&&(this.#mutateOptions.onError?.(action.error,variables,context),this.#mutateOptions.onSettled?.(void 0,action.error,variables,context))}this.listeners.forEach((listener=>{listener(this.#currentResult)}))}))}},QueryClientProvider=__webpack_require__("./node_modules/@tanstack/react-query/build/modern/QueryClientProvider.js"),modern_utils=__webpack_require__("./node_modules/@tanstack/react-query/build/modern/utils.js");function useMutation(options,queryClient){const client=(0,QueryClientProvider.jE)(queryClient),[observer]=react.useState((()=>new MutationObserver(client,options)));react.useEffect((()=>{observer.setOptions(options)}),[observer,options]);const result=react.useSyncExternalStore(react.useCallback((onStoreChange=>observer.subscribe(notifyManager.j.batchCalls(onStoreChange))),[observer]),(()=>observer.getCurrentResult()),(()=>observer.getCurrentResult())),mutate=react.useCallback(((variables,mutateOptions)=>{observer.mutate(variables,mutateOptions).catch(modern_utils.l)}),[observer]);if(result.error&&(0,modern_utils.G)(observer.options.throwOnError,[result.error]))throw result.error;return{...result,mutate,mutateAsync:result.mutate}}},"./node_modules/@tanstack/react-query/build/modern/useQuery.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{I:()=>useQuery});var _tanstack_query_core__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/@tanstack/query-core/build/modern/queryObserver.js"),_useBaseQuery_js__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/@tanstack/react-query/build/modern/useBaseQuery.js");function useQuery(options,queryClient){return(0,_useBaseQuery_js__WEBPACK_IMPORTED_MODULE_0__.t)(options,_tanstack_query_core__WEBPACK_IMPORTED_MODULE_1__.$,queryClient)}},"./src/apis/balanceContent.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Gd:()=>fetchBalanceContent,O:()=>fetchRoundVoteResult,bR:()=>checkMyGameStatus,jd:()=>fetchVoteIsFinished,sl:()=>voteBalanceContent});var _fetcher__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./src/apis/fetcher.ts"),_constants_url__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/constants/url.ts");const fetchBalanceContent=async roomId=>{const res=await _fetcher__WEBPACK_IMPORTED_MODULE_0__.A.get({url:_constants_url__WEBPACK_IMPORTED_MODULE_1__.H$.balanceContent(roomId)});return await res.json()},voteBalanceContent=async({optionId,contentId,roomId,memberId})=>{const res=await _fetcher__WEBPACK_IMPORTED_MODULE_0__.A.post({url:_constants_url__WEBPACK_IMPORTED_MODULE_1__.H$.vote(roomId,contentId),headers:{"Content-Type":"application/json"},body:{memberId,optionId}});return await res.json()},fetchRoundVoteResult=async({contentId,roomId})=>{const res=await _fetcher__WEBPACK_IMPORTED_MODULE_0__.A.get({url:_constants_url__WEBPACK_IMPORTED_MODULE_1__.H$.roundVoteResult(roomId,contentId)});return await res.json()},checkMyGameStatus=async({roomId,currentRound})=>{const res=await _fetcher__WEBPACK_IMPORTED_MODULE_0__.A.get({url:_constants_url__WEBPACK_IMPORTED_MODULE_1__.H$.myGameStatus(roomId,currentRound),headers:{"Content-Type":"application/json"}});return await res.json()},fetchVoteIsFinished=async({contentId,roomId})=>{const res=await _fetcher__WEBPACK_IMPORTED_MODULE_0__.A.get({url:_constants_url__WEBPACK_IMPORTED_MODULE_1__.H$.voteIsFinished(roomId,contentId)});return await res.json()}},"./src/apis/fetcher.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>apis_fetcher});const ERROR_MESSAGE={NOT_READY_ROOM:"해당 방의 게임이 이미 시작되었어요. 게임이 끝날 때까지 기다려볼까요?",NOT_PROGRESSED_ROOM:"이미 게임이 종료되었어요. 최종 결과를 확인해볼까요?",NOT_FINISHED_ROOM:"해당 방의 게임이 아직 종료되지 않았어요.",NOT_FOUND_ROOM:"해당 방을 찾을 수 없어요. 방을 새로 만들어주세요!",NOT_ROOM_MEMBER:"사용자가 해당 방에 존재하지 않아요. 다시 접속해볼까요?",EXCEED_MAX_MEMBER_COUNT:"방의 최대 인원을 초과했습니다.",ALREADY_EXIST_MASTER:"이미 방장이 존재합니다.",ALREADY_MASTER:"해당 멤버는 이미 방장입니다.",INVALID_MASTER_CREATION:"방에 멤버가 존재하면 방장을 생성할 수 없습니다.",NOT_EXIST_MASTER:"방장이 존재하지 않습니다.",NOT_EXIST_COMMON:"일반 멤버가 존재하지 않습니다.",INVALID_TIME_LIMIT:"타이머는 10초, 15초, 30초, 60초로만 설정 가능합니다.",INVALID_RANGE_TOTAL_ROUND:"총 라운드는 5, 7, 10 라운드로만 설정 가능합니다.",EMPTY_VOTE_DEADLINE:"라운드 종료 시간이 설정되지 않았습니다.",MISMATCH_ROUND:"이미 다음 라운드가 시작되었어요. 해당 라운드가 끝날 때까지 잠시만 기다려주세요!",ROUND_LESS_THAN_START_ROUND:"startRound보다 크거나 같아야 합니다.",ROUND_GREATER_THAN_CURRENT_ROUND:"currentRound보다 작거나 같아야 합니다.",INVALID_ROUND_GAP:"currentRound과 round의 차이는 ?이하여야 합니다.",NOT_FOUND_BALANCE_CONTENT:"존재하지 않는 컨텐츠네요. 게임을 다시 진행해주세요!",NOT_FOUND_ROOM_CONTENT:"해당 방에 존재하지 않은 컨텐츠입니다. 게임을 다시 진행해주세요!",NO_RESOURCE_FOUND:"요청한 리소스를 찾을 수 없습니다. 게임을 다시 진행해주세요!",NOT_FOUND_BALANCE_OPTION:"옵션을 올바르게 선택해주세요.",ALREADY_VOTED:"이미 투표가 반영되었어요. 해당 라운드가 끝날 때까지 기다려볼까요?",VOTE_FINISHED:"투표가 이미 종료되었어요.",VOTE_NOT_FINISHED:"이미 다음 라운드가 시작되었어요. 해당 라운드가 끝날 때까지 잠시만 기다려주세요!",CAN_NOT_CHECK_MATCHING_PERCENT:"종료되지 않은 방의 투표 매칭도는 확인할 수 없습니다.",FIELD_ERROR:"필드값 입력이 잘못되었습니다.",URL_PARAMETER_ERROR:"URL parameter 입력이 잘못되었습니다.",METHOD_ARGUMENT_TYPE_MISMATCH:"입력한 값의 타입이 잘못되었습니다.",METHOD_NOT_SUPPORTED:"허용되지 않은 메서드입니다.",INTERNAL_SERVER_ERROR:"서버에 오류가 발생했어요. 다시 시도해 주세요!",NOT_FOUND_COOKIE:"사용자 정보가 있어야 방에 참여할 수 있어요. 홈화면으로 이동하여 방을 새로 만들어주세요!",INVALID_COOKIE:"사용자 정보가 있어야 방에 참여할 수 있어요. 홈화면으로 이동하여 방을 새로 만들어주세요!"};class CustomError extends Error{constructor({errorCode,status}){super(),this.errorCode=errorCode,this.message=ERROR_MESSAGE[errorCode],this.status=status}}class NetworkError extends Error{status=555;message="네트워크가 불안정해요. 다시 시도해주세요!"}const apis_fetcher={async request({url,method,body,headers}){try{const response=await fetch(url,{method,body:body&&JSON.stringify(body),headers:headers&&headers});if(!response.ok){const apiError=await response.json();throw new CustomError({...apiError,status:response.status})}return response}catch(error){if(error instanceof CustomError)throw error;throw new NetworkError}},get({url,headers}){return this.request({url,method:"GET",headers})},post({url,body,headers}){return this.request({url,method:"POST",body,headers})},delete({url,headers}){return this.request({url,method:"DELETE",headers})},patch({url,body,headers}){return this.request({url,method:"PATCH",body,headers})},put({url,headers}){return this.request({url,method:"PUT",headers})}}},"./src/components/SelectContainer/Timer/Timer.util.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Nc:()=>convertMsecToSecond,qE:()=>formatLeftRoundTime,wk:()=>isAlertTimer});var _constants_config__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./src/constants/config.ts");const formatLeftRoundTime=leftRoundTime=>{const minutes=Math.floor(leftRoundTime/60),seconds=leftRoundTime%60;return`${String(minutes).padStart(2,"0")}:${String(seconds).padStart(2,"0")}`},convertMsecToSecond=msec=>msec/_constants_config__WEBPACK_IMPORTED_MODULE_0__.S2,isAlertTimer=(leftRoundTime,timeLimit)=>leftRoundTime===Math.floor(timeLimit/2)||leftRoundTime===_constants_config__WEBPACK_IMPORTED_MODULE_0__.cZ},"./src/components/common/a11yOnly/A11yOnly.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>a11yOnly_A11yOnly});const a11yOnlyLayout={name:"90pyz3",styles:"overflow:hidden;position:absolute;width:1px;height:1px;margin:-1px;padding:0;border:0;white-space:nowrap;clip:rect(0, 0, 0, 0)"};var emotion_react_jsx_runtime_browser_esm=__webpack_require__("./node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js");const A11yOnly=({as,children,...props})=>{const Component=as||"span";return(0,emotion_react_jsx_runtime_browser_esm.Y)(Component,{css:a11yOnlyLayout,...props,children})},a11yOnly_A11yOnly=A11yOnly;A11yOnly.__docgenInfo={description:"",methods:[],displayName:"A11yOnly",props:{as:{required:!1,tsType:{name:"T"},description:""},role:{required:!1,tsType:{name:"AriaRole"},description:""}}}},"./src/constants/queryKeys.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{e:()=>QUERY_KEYS});const QUERY_KEYS={balanceContent:"balanceContent",matchingResult:"matchingResult",roundVoteResult:"roundVoteResult",myGameStatus:"myGameStatus",roundIsFinished:"roundIsFinished",roomMembers:"roomMembers",isRoomInitial:"isRoomInitial",categoryList:"categoryList"}},"./src/constants/routes.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{b:()=>ROUTES});const ROUTES={main:"/",nickname:"/nickname",ready:roomId=>`/${roomId}/ready`,game:roomId=>`/${roomId}/game`,roundResult:roomId=>`/${roomId}/round/result`,roundResultVote:"/round/result/vote",gameResult:roomId=>`/${roomId}/game/result`,roundResultStatus:roomId=>`/${roomId}/round/result/status`}},"./src/hooks/useBalanceContentQuery.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>__WEBPACK_DEFAULT_EXPORT__});var _tanstack_react_query__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/@tanstack/react-query/build/modern/useSuspenseQuery.js"),_apis_balanceContent__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./src/apis/balanceContent.ts"),_constants_queryKeys__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/constants/queryKeys.ts");const __WEBPACK_DEFAULT_EXPORT__=roomId=>{const balanceContentQuery=(0,_tanstack_react_query__WEBPACK_IMPORTED_MODULE_2__.U)({queryKey:[_constants_queryKeys__WEBPACK_IMPORTED_MODULE_1__.e.balanceContent,Number(roomId)],queryFn:async()=>await(0,_apis_balanceContent__WEBPACK_IMPORTED_MODULE_0__.Gd)(Number(roomId))});return{...balanceContentQuery,balanceContent:balanceContentQuery.data}}},"./src/recoil/atom.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{k:()=>roomUuidState,u:()=>memberInfoState});var recoil__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/recoil/es/index.js");const memberInfoState=(0,recoil__WEBPACK_IMPORTED_MODULE_0__.eU)({key:"memberInfo",default:{memberId:null,nickname:null,isMaster:!1}}),roomUuidState=(0,recoil__WEBPACK_IMPORTED_MODULE_0__.eU)({key:"roomUuid",default:""})}}]); \ No newline at end of file diff --git a/storybook/components-SelectOption-SelectOption-stories.4dfca95e.iframe.bundle.js b/storybook/components-SelectOption-SelectOption-stories.edc08058.iframe.bundle.js similarity index 73% rename from storybook/components-SelectOption-SelectOption-stories.4dfca95e.iframe.bundle.js rename to storybook/components-SelectOption-SelectOption-stories.edc08058.iframe.bundle.js index 18686fa95..e918cfb11 100644 --- a/storybook/components-SelectOption-SelectOption-stories.4dfca95e.iframe.bundle.js +++ b/storybook/components-SelectOption-SelectOption-stories.edc08058.iframe.bundle.js @@ -1 +1 @@ -(self.webpackChunkddangkong_frontend=self.webpackChunkddangkong_frontend||[]).push([[951],{"./src/components/SelectOption/SelectOption.stories.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{__namedExportsOrder:()=>__namedExportsOrder,default:()=>__WEBPACK_DEFAULT_EXPORT__,선택_완료된_옵션:()=>선택_완료된_옵션,클릭되지_않은_옵션:()=>클릭되지_않은_옵션,클릭된_옵션:()=>클릭된_옵션});var _storybook_test__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/@storybook/test/dist/index.mjs"),_SelectOption__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/components/SelectOption/SelectOption.tsx");const __WEBPACK_DEFAULT_EXPORT__={title:"SelectOption",args:{handleClickOption:(0,_storybook_test__WEBPACK_IMPORTED_MODULE_0__.fn)()},component:_SelectOption__WEBPACK_IMPORTED_MODULE_1__.A},클릭되지_않은_옵션={args:{option:{name:"100억 빚 송강",optionId:1},selectedOption:{id:0,isCompleted:!1}}},클릭된_옵션={args:{option:{name:"100억 부자 송강호",optionId:2},selectedOption:{id:2,isCompleted:!1}}},선택_완료된_옵션={args:{option:{name:"100억 부자 송강호",optionId:2},selectedOption:{id:2,isCompleted:!0}}},__namedExportsOrder=["클릭되지_않은_옵션","클릭된_옵션","선택_완료된_옵션"];클릭되지_않은_옵션.parameters={...클릭되지_않은_옵션.parameters,docs:{...클릭되지_않은_옵션.parameters?.docs,source:{originalSource:"{\n args: {\n option: {\n name: '100억 빚 송강',\n optionId: 1\n },\n selectedOption: {\n id: 0,\n isCompleted: false\n }\n }\n}",...클릭되지_않은_옵션.parameters?.docs?.source}}},클릭된_옵션.parameters={...클릭된_옵션.parameters,docs:{...클릭된_옵션.parameters?.docs,source:{originalSource:"{\n args: {\n option: {\n name: '100억 부자 송강호',\n optionId: 2\n },\n selectedOption: {\n id: 2,\n isCompleted: false\n }\n }\n}",...클릭된_옵션.parameters?.docs?.source}}},선택_완료된_옵션.parameters={...선택_완료된_옵션.parameters,docs:{...선택_완료된_옵션.parameters?.docs,source:{originalSource:"{\n args: {\n option: {\n name: '100억 부자 송강호',\n optionId: 2\n },\n selectedOption: {\n id: 2,\n isCompleted: true\n }\n }\n}",...선택_완료된_옵션.parameters?.docs?.source}}}},"./node_modules/@storybook/test/dist sync recursive":module=>{function webpackEmptyContext(req){var e=new Error("Cannot find module '"+req+"'");throw e.code="MODULE_NOT_FOUND",e}webpackEmptyContext.keys=()=>[],webpackEmptyContext.resolve=webpackEmptyContext,webpackEmptyContext.id="./node_modules/@storybook/test/dist sync recursive",module.exports=webpackEmptyContext},"./src/components/SelectOption/SelectOption.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{A:()=>SelectOption_SelectOption});var emotion_react_browser_esm=__webpack_require__("./node_modules/@emotion/react/dist/emotion-react.browser.esm.js"),Theme=__webpack_require__("./src/styles/Theme.ts");var emotion_react_jsx_runtime_browser_esm=__webpack_require__("./node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js");const SelectOption=({option,selectedOption,handleClickOption})=>{const{id:selectedId,isCompleted}=selectedOption;return(0,emotion_react_jsx_runtime_browser_esm.Y)("button",{css:(selected=selectedId===option.optionId,isSelected=isCompleted,(0,emotion_react_browser_esm.AH)("display:flex;justify-content:center;align-items:center;width:11.6rem;height:16.8rem;padding:1.6rem;border-radius:3rem;background-color:",selected?Theme.S.color.peanut500:Theme.S.color.peanut300,";cursor:",isSelected?"not-allowed":"pointer",";opacity:",isSelected?Theme.S.opacity.disabled:Theme.S.opacity.default,";color:#000;font-weight:bold;font-size:1.6rem;line-height:2.4rem;text-align:center;word-break:keep-all;transition:all 0.5s;scale:",selected?1.1:1,";","")),onClick:()=>handleClickOption(option.optionId),disabled:isCompleted,"aria-pressed":selectedId===option.optionId,children:option.name});var selected,isSelected},SelectOption_SelectOption=SelectOption;SelectOption.__docgenInfo={description:"",methods:[],displayName:"SelectOption",props:{option:{required:!0,tsType:{name:"BalanceContent['firstOption']",raw:"BalanceContent['firstOption']"},description:""},selectedOption:{required:!0,tsType:{name:"SelectedOption"},description:""},handleClickOption:{required:!0,tsType:{name:"signature",type:"function",raw:"(selectedId: number) => void",signature:{arguments:[{type:{name:"number"},name:"selectedId"}],return:{name:"void"}}},description:""}}}}}]); \ No newline at end of file +(self.webpackChunkddangkong_frontend=self.webpackChunkddangkong_frontend||[]).push([[951],{"./src/components/SelectOption/SelectOption.stories.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{__namedExportsOrder:()=>__namedExportsOrder,default:()=>__WEBPACK_DEFAULT_EXPORT__,선택_완료된_옵션:()=>선택_완료된_옵션,클릭되지_않은_옵션:()=>클릭되지_않은_옵션,클릭된_옵션:()=>클릭된_옵션});var _storybook_test__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/@storybook/test/dist/index.mjs"),_SelectOption__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/components/SelectOption/SelectOption.tsx");const __WEBPACK_DEFAULT_EXPORT__={title:"SelectOption",args:{handleClickOption:(0,_storybook_test__WEBPACK_IMPORTED_MODULE_0__.fn)()},component:_SelectOption__WEBPACK_IMPORTED_MODULE_1__.A},클릭되지_않은_옵션={args:{option:{name:"100억 빚 송강",optionId:1},selectedOption:{id:0,isCompleted:!1}}},클릭된_옵션={args:{option:{name:"100억 부자 송강호",optionId:2},selectedOption:{id:2,isCompleted:!1}}},선택_완료된_옵션={args:{option:{name:"100억 부자 송강호",optionId:2},selectedOption:{id:2,isCompleted:!0}}},__namedExportsOrder=["클릭되지_않은_옵션","클릭된_옵션","선택_완료된_옵션"];클릭되지_않은_옵션.parameters={...클릭되지_않은_옵션.parameters,docs:{...클릭되지_않은_옵션.parameters?.docs,source:{originalSource:"{\n args: {\n option: {\n name: '100억 빚 송강',\n optionId: 1\n },\n selectedOption: {\n id: 0,\n isCompleted: false\n }\n }\n}",...클릭되지_않은_옵션.parameters?.docs?.source}}},클릭된_옵션.parameters={...클릭된_옵션.parameters,docs:{...클릭된_옵션.parameters?.docs,source:{originalSource:"{\n args: {\n option: {\n name: '100억 부자 송강호',\n optionId: 2\n },\n selectedOption: {\n id: 2,\n isCompleted: false\n }\n }\n}",...클릭된_옵션.parameters?.docs?.source}}},선택_완료된_옵션.parameters={...선택_완료된_옵션.parameters,docs:{...선택_완료된_옵션.parameters?.docs,source:{originalSource:"{\n args: {\n option: {\n name: '100억 부자 송강호',\n optionId: 2\n },\n selectedOption: {\n id: 2,\n isCompleted: true\n }\n }\n}",...선택_완료된_옵션.parameters?.docs?.source}}}},"./node_modules/@storybook/test/dist sync recursive":module=>{function webpackEmptyContext(req){var e=new Error("Cannot find module '"+req+"'");throw e.code="MODULE_NOT_FOUND",e}webpackEmptyContext.keys=()=>[],webpackEmptyContext.resolve=webpackEmptyContext,webpackEmptyContext.id="./node_modules/@storybook/test/dist sync recursive",module.exports=webpackEmptyContext},"./src/components/SelectOption/SelectOption.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{A:()=>SelectOption_SelectOption});var emotion_react_browser_esm=__webpack_require__("./node_modules/@emotion/react/dist/emotion-react.browser.esm.js"),Theme=__webpack_require__("./src/styles/Theme.ts");var emotion_react_jsx_runtime_browser_esm=__webpack_require__("./node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js");const SelectOption=({option,selectedOption,handleClickOption})=>{const{id:selectedId,isCompleted}=selectedOption;return(0,emotion_react_jsx_runtime_browser_esm.Y)("button",{role:"radio",css:(selected=selectedId===option.optionId,isSelected=isCompleted,(0,emotion_react_browser_esm.AH)("display:flex;justify-content:center;align-items:center;width:11.6rem;height:16.8rem;padding:1.6rem;border-radius:3rem;background-color:",selected?Theme.S.color.peanut500:Theme.S.color.peanut300,";cursor:",isSelected?"not-allowed":"pointer",";opacity:",isSelected?Theme.S.opacity.disabled:Theme.S.opacity.default,";color:#000;font-weight:bold;font-size:1.6rem;line-height:2.4rem;text-align:center;word-break:keep-all;transition:all 0.5s;scale:",selected?1.1:1,";","")),onClick:()=>handleClickOption(option.optionId),disabled:isCompleted,"aria-checked":selectedId===option.optionId,children:option.name});var selected,isSelected},SelectOption_SelectOption=SelectOption;SelectOption.__docgenInfo={description:"",methods:[],displayName:"SelectOption",props:{option:{required:!0,tsType:{name:"BalanceContent['firstOption']",raw:"BalanceContent['firstOption']"},description:""},selectedOption:{required:!0,tsType:{name:"SelectedOption"},description:""},handleClickOption:{required:!0,tsType:{name:"signature",type:"function",raw:"(selectedId: number) => void",signature:{arguments:[{type:{name:"number"},name:"selectedId"}],return:{name:"void"}}},description:""}}}}}]); \ No newline at end of file diff --git a/storybook/components-TabContentContainer-TabContentContainer-stories.7b5136ff.iframe.bundle.js b/storybook/components-TabContentContainer-TabContentContainer-stories.7b5136ff.iframe.bundle.js deleted file mode 100644 index d7e34e505..000000000 --- a/storybook/components-TabContentContainer-TabContentContainer-stories.7b5136ff.iframe.bundle.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkddangkong_frontend=self.webpackChunkddangkong_frontend||[]).push([[867],{"./src/components/TabContentContainer/TabContentContainer.stories.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{__namedExportsOrder:()=>__namedExportsOrder,default:()=>TabContentContainer_stories,투표_통계:()=>투표_통계,투표_현황:()=>투표_현황});var emotion_react_browser_esm=__webpack_require__("./node_modules/@emotion/react/dist/emotion-react.browser.esm.js"),Theme=__webpack_require__("./src/styles/Theme.ts");const emptyVoteTextContainer={name:"zigog8",styles:"display:flex;flex-direction:column;align-items:center"},emptyVoteText=(0,emotion_react_browser_esm.AH)("display:flex;justify-content:center;align-items:center;height:8vh;",Theme.S.typography.headline3,";",""),angryImage={name:"ne5uve",styles:"width:16rem;height:14rem"},angryDdangkong_namespaceObject=__webpack_require__.p+"static/media/angryDdangkong.29469aa8.webp";var emotion_react_jsx_runtime_browser_esm=__webpack_require__("./node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js");const EmptyVoteContent=()=>(0,emotion_react_jsx_runtime_browser_esm.FD)("div",{css:emptyVoteTextContainer,children:[(0,emotion_react_jsx_runtime_browser_esm.Y)("img",{src:angryDdangkong_namespaceObject,alt:"",css:angryImage}),(0,emotion_react_jsx_runtime_browser_esm.FD)("span",{css:emptyVoteText,children:["아무도 투표하지 않으셨네요 :",")"]})]}),EmptyVoteContent_EmptyVoteContent=EmptyVoteContent;EmptyVoteContent.__docgenInfo={description:"",methods:[],displayName:"EmptyVoteContent"};const tabContentContainerLayout=isVoteStatisticsTabActive=>(0,emotion_react_browser_esm.AH)("display:flex;flex-direction:column;gap:15%;height:55vh;overflow-y:",isVoteStatisticsTabActive?"visible":"auto",";padding:2.4rem;border:0.3rem solid ",Theme.S.color.peanut400,";border-radius:0.8rem;","");const roundVoteResultContainer={name:"4zk4ri",styles:"display:flex;flex-direction:column;gap:1rem"},optionContainer={name:"1d3j4dq",styles:"display:flex;justify-content:space-between;gap:0.8rem;font-weight:bold;font-size:1.4rem;word-break:keep-all"},secondOptionName={name:"2qga7i",styles:"text-align:right"},memberCountWrapper={name:"1b037zw",styles:"display:flex;justify-content:space-between;align-items:center;height:1.2rem;font-weight:bold;font-size:1.2rem"},totalResultInfoContainer={name:"zigog8",styles:"display:flex;flex-direction:column;align-items:center"},totalResultInfoText={name:"7g4cnq",styles:"font-size:1.4rem;line-height:2rem;text-align:center;word-break:keep-all"},emphasizeText={name:"1efi8gv",styles:"font-weight:bold"};var react=__webpack_require__("./node_modules/react/index.js");const barContainer={name:"9kcjqh",styles:"display:flex;overflow:hidden;align-items:center;width:inherit;border-radius:1.6rem"},barWrapper={name:"zur63y",styles:"display:flex;justify-content:center;align-items:center;height:8vh;color:black;font-weight:bold;font-size:1.6rem;transition:all 1s"},firstBar=(percent,isBigFirstOption)=>(0,emotion_react_browser_esm.AH)(barWrapper," overflow:hidden;width:",percent,"%;border-radius:1.6rem 0 0 1.6rem;background-color:",isBigFirstOption?Theme.S.color.peanut400:Theme.S.color.gray,";transform:translateX(5px);clip-path:",100===percent?"none":"polygon(0 0, 100% 0, calc(100% - 10px) 100%, 0 100%)",";",""),secondBar=(percent,isBigFirstOption)=>(0,emotion_react_browser_esm.AH)(barWrapper," overflow:hidden;width:",percent,"%;border-radius:0 1.6rem 1.6rem 0;background-color:",isBigFirstOption?Theme.S.color.gray:Theme.S.color.peanut400,";transform:translateX(-5px);clip-path:",100===percent?"none":"polygon(10px 0, 100% 0, 100% 100%, 0 100%)",";",""),hooks_useCountAnimation=({target,start=50,duration=2e3})=>{const[count,setCount]=(0,react.useState)(start);return(0,react.useEffect)((()=>{if(void 0===target||target===start)return;const totalFrame=Math.round(duration/8.333333333333334);let currentNumber=start;const counter=setInterval((()=>{const progress=1===(timingRate=++currentNumber/totalFrame)?1:1-Math.pow(2,-10*timingRate);var timingRate;setCount(Math.round(target*progress)),1===progress&&clearInterval(counter)}),8.333333333333334);return()=>clearInterval(counter)}),[target,start,duration]),count},RoundVoteContainer_hook=groupRoundResult=>({animatedFirstPercent:hooks_useCountAnimation({target:groupRoundResult.firstOption.percent}),animatedSecondPercent:hooks_useCountAnimation({target:groupRoundResult.secondOption.percent})}),StatisticBar=({groupRoundResult})=>{const{animatedFirstPercent,animatedSecondPercent}=RoundVoteContainer_hook(groupRoundResult),[optionPercent,setOptionPercent]=(0,react.useState)({first:50,second:50}),isBigFirstOption=optionPercent.first>=50;return(0,react.useEffect)((()=>{setOptionPercent((prev=>({...prev,first:groupRoundResult.firstOption.percent,second:groupRoundResult.secondOption.percent})))}),[groupRoundResult]),(0,emotion_react_jsx_runtime_browser_esm.FD)("div",{css:barContainer,children:[(0,emotion_react_jsx_runtime_browser_esm.FD)("span",{css:firstBar(optionPercent.first,isBigFirstOption),children:[animatedFirstPercent,"%"]}),(0,emotion_react_jsx_runtime_browser_esm.FD)("span",{css:secondBar(optionPercent.second,isBigFirstOption),children:[animatedSecondPercent,"%"]})]})},StatisticBar_StatisticBar=StatisticBar;StatisticBar.__docgenInfo={description:"",methods:[],displayName:"StatisticBar",props:{groupRoundResult:{required:!0,tsType:{name:"Group"},description:""}}};var A11yOnly=__webpack_require__("./src/components/common/a11yOnly/A11yOnly.tsx");const VoteStatisticContent=({groupRoundResult,totalResult})=>{const dominantVoteData=(totalResult=>{const{firstOption,secondOption}=totalResult,isEqual=firstOption.percent===secondOption.percent,dominantOption=firstOption.percent>secondOption.percent?firstOption:secondOption;return{isEqual,dominantPercent:dominantOption.percent,dominantName:dominantOption.name}})(totalResult),{firstOption,secondOption}=groupRoundResult,screenReaderFirstOption=`${firstOption.name} ${firstOption.percent}%. ${firstOption.memberCount}명 선택.`,screenReaderSecondOption=`${secondOption.name} ${secondOption.percent}%. ${secondOption.memberCount}명 선택`,screenReaderDominantVote=`📢 전체 유저 중 ${dominantVoteData?.dominantPercent}%는. ${dominantVoteData?.dominantName}를 선택했어요`;return(0,emotion_react_jsx_runtime_browser_esm.FD)(emotion_react_jsx_runtime_browser_esm.FK,{children:[(0,emotion_react_jsx_runtime_browser_esm.FD)(A11yOnly.A,{children:[screenReaderFirstOption,screenReaderSecondOption]}),(0,emotion_react_jsx_runtime_browser_esm.FD)("div",{css:roundVoteResultContainer,"aria-hidden":!0,children:[(0,emotion_react_jsx_runtime_browser_esm.FD)("div",{css:optionContainer,children:[(0,emotion_react_jsx_runtime_browser_esm.Y)("span",{children:firstOption.name}),(0,emotion_react_jsx_runtime_browser_esm.Y)("span",{css:secondOptionName,children:secondOption.name})]}),(0,emotion_react_jsx_runtime_browser_esm.Y)(StatisticBar_StatisticBar,{groupRoundResult}),(0,emotion_react_jsx_runtime_browser_esm.FD)("div",{css:memberCountWrapper,children:[(0,emotion_react_jsx_runtime_browser_esm.FD)("span",{children:[firstOption.memberCount,"명"]}),(0,emotion_react_jsx_runtime_browser_esm.FD)("span",{children:[secondOption.memberCount,"명"]})]})]}),(0,emotion_react_jsx_runtime_browser_esm.Y)("div",{css:totalResultInfoContainer,children:dominantVoteData.isEqual?(0,emotion_react_jsx_runtime_browser_esm.Y)("span",{css:totalResultInfoText,children:"📢 전체 유저 사이에서는 의견이 반반이에요 😲"}):(0,emotion_react_jsx_runtime_browser_esm.FD)(emotion_react_jsx_runtime_browser_esm.FK,{children:[(0,emotion_react_jsx_runtime_browser_esm.Y)(A11yOnly.A,{children:screenReaderDominantVote}),(0,emotion_react_jsx_runtime_browser_esm.FD)("span",{css:totalResultInfoText,"aria-hidden":!0,children:["📢 전체 유저 중 ",(0,emotion_react_jsx_runtime_browser_esm.FD)("span",{css:emphasizeText,children:[dominantVoteData.dominantPercent,"%"]}),"는"]}),(0,emotion_react_jsx_runtime_browser_esm.FD)("span",{css:totalResultInfoText,"aria-hidden":!0,children:[(0,emotion_react_jsx_runtime_browser_esm.Y)("span",{css:emphasizeText,children:dominantVoteData.dominantName}),"를 선택했어요 !"]})]})})]})},VoteStatisticContent_VoteStatisticContent=VoteStatisticContent;VoteStatisticContent.__docgenInfo={description:"",methods:[],displayName:"VoteStatisticContent",props:{groupRoundResult:{required:!0,tsType:{name:"Group"},description:""},totalResult:{required:!0,tsType:{name:"Total"},description:""}}};const optionParticipantsContainerLayout={name:"koo7tc",styles:"display:flex;flex-direction:column;width:100%;row-gap:1.2rem"},horizontalDivider=(0,emotion_react_browser_esm.AH)("width:100%;height:1px;margin:1.4rem 0;background-color:",Theme.S.color.gray300,";","");__webpack_require__("./node_modules/core-js/modules/esnext.iterator.map.js");const optionParticipantsLayout={name:"ch4q08",styles:"display:flex;flex-direction:column;gap:2rem;width:100%"},optionInfo={name:"1akzvke",styles:"font-weight:bold;font-size:1.6rem"},participantsListWrapper={name:"qrhm24",styles:"display:grid;grid-template-columns:repeat(2, 1fr);row-gap:1.4rem"};var es=__webpack_require__("./node_modules/recoil/es/index.js");const nicknameItemLayout={name:"10fbv33",styles:"display:flex;align-items:center;gap:0.6rem"},nicknameText=isMyNickname=>(0,emotion_react_browser_esm.AH)("font-weight:",isMyNickname?"bold":400,";font-size:1.2rem;",""),profileImage={name:"h3hy14",styles:"width:1.8rem;height:1.8rem"};var sillyDdangkongMedium=__webpack_require__("./src/assets/images/sillyDdangkongMedium.webp"),atom=__webpack_require__("./src/recoil/atom.ts");const NicknameItem=({nickName})=>{const isMyNickname=(0,es.vc)(atom.u).nickname===nickName;return(0,emotion_react_jsx_runtime_browser_esm.FD)("li",{css:nicknameItemLayout,children:[(0,emotion_react_jsx_runtime_browser_esm.Y)("img",{src:sillyDdangkongMedium,alt:"사용자 프로필",css:profileImage}),(0,emotion_react_jsx_runtime_browser_esm.Y)("span",{css:nicknameText(isMyNickname),children:nickName})]})},NicknameItem_NicknameItem=NicknameItem;NicknameItem.__docgenInfo={description:"",methods:[],displayName:"NicknameItem",props:{nickName:{required:!0,tsType:{name:"string"},description:""}}};const OptionParticipants=({optionName,memberCount,members})=>(0,emotion_react_jsx_runtime_browser_esm.FD)("div",{css:optionParticipantsLayout,children:[(0,emotion_react_jsx_runtime_browser_esm.FD)(A11yOnly.A,{children:[optionName,".",memberCount,"명"]}),(0,emotion_react_jsx_runtime_browser_esm.FD)("p",{css:optionInfo,"aria-hidden":!0,children:[optionName,": ",memberCount]}),(0,emotion_react_jsx_runtime_browser_esm.Y)("ul",{css:participantsListWrapper,children:members.map(((member,index)=>(0,emotion_react_jsx_runtime_browser_esm.Y)(NicknameItem_NicknameItem,{nickName:member},index)))})]}),OptionParticipants_OptionParticipants=OptionParticipants;OptionParticipants.__docgenInfo={description:"",methods:[],displayName:"OptionParticipants",props:{optionName:{required:!0,tsType:{name:"string"},description:""},memberCount:{required:!0,tsType:{name:"number"},description:""},members:{required:!0,tsType:{name:"Array",elements:[{name:"string"}],raw:"string[]"},description:""}}};const OptionParticipantsContainer=({groupRoundResult})=>(0,emotion_react_jsx_runtime_browser_esm.Y)(emotion_react_jsx_runtime_browser_esm.FK,{children:(0,emotion_react_jsx_runtime_browser_esm.FD)("section",{css:optionParticipantsContainerLayout,children:[(0,emotion_react_jsx_runtime_browser_esm.Y)(OptionParticipants_OptionParticipants,{optionName:groupRoundResult.firstOption.name,members:groupRoundResult.firstOption.members,memberCount:groupRoundResult.firstOption.memberCount}),(0,emotion_react_jsx_runtime_browser_esm.Y)("div",{css:horizontalDivider}),(0,emotion_react_jsx_runtime_browser_esm.Y)(OptionParticipants_OptionParticipants,{optionName:groupRoundResult.secondOption.name,members:groupRoundResult.secondOption.members,memberCount:groupRoundResult.secondOption.memberCount}),(0,emotion_react_jsx_runtime_browser_esm.Y)("div",{css:horizontalDivider}),(0,emotion_react_jsx_runtime_browser_esm.Y)(OptionParticipants_OptionParticipants,{optionName:"투표에 참여하지 않으셨어요",members:groupRoundResult.giveUp.members,memberCount:groupRoundResult.giveUp.memberCount})]})}),OptionParticipantsContainer_OptionParticipantsContainer=OptionParticipantsContainer;OptionParticipantsContainer.__docgenInfo={description:"",methods:[],displayName:"OptionParticipantsContainer",props:{groupRoundResult:{required:!0,tsType:{name:"Group"},description:""}}};var TopicContainer=__webpack_require__("./src/components/TopicContainer/TopicContainer.tsx"),dist=__webpack_require__("./node_modules/react-router/dist/index.js"),useBalanceContentQuery=__webpack_require__("./src/hooks/useBalanceContentQuery.ts"),useQuery=__webpack_require__("./node_modules/@tanstack/react-query/build/modern/useQuery.js"),balanceContent=__webpack_require__("./src/apis/balanceContent.ts"),config=__webpack_require__("./src/constants/config.ts"),queryKeys=__webpack_require__("./src/constants/queryKeys.ts");const hooks_useMyGameStatusQuery=({roomId,currentRound})=>{const myGameStatusQuery=(0,useQuery.I)({queryKey:[queryKeys.e.myGameStatus,roomId,currentRound],queryFn:()=>{if(!currentRound)throw new Error("balanceContent 가 존재하지 않습니다.");return(0,balanceContent.bR)({roomId,currentRound})},enabled:!!currentRound,refetchInterval:query=>!(query.state.error&&query.state.fetchFailureCount>=config.A3)&&config.S2,refetchIntervalInBackground:!0,gcTime:0});return{...myGameStatusQuery,isRoundFinished:myGameStatusQuery.data?.isRoundFinished,isGameFinished:myGameStatusQuery.data?.isGameFinished}};var routes=__webpack_require__("./src/constants/routes.ts");const hooks_useMyGameStatus=({roomId})=>{const navigate=(0,dist.Zp)(),{balanceContent}=(0,useBalanceContentQuery.A)(Number(roomId)),{isRoundFinished,isGameFinished}=hooks_useMyGameStatusQuery({roomId:Number(roomId),currentRound:balanceContent?.currentRound});(0,react.useEffect)((()=>{isGameFinished&&navigate(routes.b.gameResult(Number(roomId))),isRoundFinished&&navigate(routes.b.game(Number(roomId)))}),[isRoundFinished,isGameFinished])};__webpack_require__("./node_modules/core-js/modules/esnext.array.group.js");var useSuspenseQuery=__webpack_require__("./node_modules/@tanstack/react-query/build/modern/useSuspenseQuery.js");const hooks_useRoundVoteResultQuery=({roomId,contentId})=>{const roundVoteResultQuery=(0,useSuspenseQuery.U)({queryKey:[queryKeys.e.roundVoteResult,roomId,contentId],queryFn:async()=>{if(void 0===contentId)throw new Error("contentId 가 존재하지 않습니다.");if(void 0===roomId)throw new Error("방이 존재하지 않습니다.");return await(0,balanceContent.O)({roomId,contentId})}});return{...roundVoteResultQuery,groupRoundResult:roundVoteResultQuery.data.group,totalResult:roundVoteResultQuery.data.total}},TabContentContainer=({isVoteStatisticsTabActive,roomId,contentId})=>{const{groupRoundResult,totalResult}=hooks_useRoundVoteResultQuery({roomId,contentId});hooks_useMyGameStatus({roomId});const isVote=(groupRoundResult=>0!==groupRoundResult.firstOption.memberCount||0!==groupRoundResult.secondOption.memberCount)(groupRoundResult);return(0,emotion_react_jsx_runtime_browser_esm.FD)("div",{css:tabContentContainerLayout(isVoteStatisticsTabActive),children:[(0,emotion_react_jsx_runtime_browser_esm.Y)(TopicContainer.A,{}),isVote&&isVoteStatisticsTabActive&&(0,emotion_react_jsx_runtime_browser_esm.Y)(VoteStatisticContent_VoteStatisticContent,{groupRoundResult,totalResult}),isVote&&!isVoteStatisticsTabActive&&(0,emotion_react_jsx_runtime_browser_esm.Y)(OptionParticipantsContainer_OptionParticipantsContainer,{groupRoundResult}),!isVote&&(0,emotion_react_jsx_runtime_browser_esm.Y)(EmptyVoteContent_EmptyVoteContent,{})]})},TabContentContainer_TabContentContainer=TabContentContainer;TabContentContainer.__docgenInfo={description:"",methods:[],displayName:"TabContentContainer",props:{isVoteStatisticsTabActive:{required:!0,tsType:{name:"boolean"},description:""},roomId:{required:!0,tsType:{name:"number"},description:""},contentId:{required:!0,tsType:{name:"number"},description:""}}};const TabContentContainer_stories={title:"TabContentContainer",component:TabContentContainer_TabContentContainer},투표_통계={args:{isVoteStatisticsTabActive:!0,roomId:1,contentId:1}},투표_현황={args:{isVoteStatisticsTabActive:!1,roomId:1,contentId:1}},__namedExportsOrder=["투표_통계","투표_현황"];투표_통계.parameters={...투표_통계.parameters,docs:{...투표_통계.parameters?.docs,source:{originalSource:"{\n args: {\n isVoteStatisticsTabActive: true,\n roomId: 1,\n contentId: 1\n }\n}",...투표_통계.parameters?.docs?.source}}},투표_현황.parameters={...투표_현황.parameters,docs:{...투표_현황.parameters?.docs,source:{originalSource:"{\n args: {\n isVoteStatisticsTabActive: false,\n roomId: 1,\n contentId: 1\n }\n}",...투표_현황.parameters?.docs?.source}}}},"./node_modules/@tanstack/react-query/build/modern/useQuery.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{I:()=>useQuery});var _tanstack_query_core__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/@tanstack/query-core/build/modern/queryObserver.js"),_useBaseQuery_js__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/@tanstack/react-query/build/modern/useBaseQuery.js");function useQuery(options,queryClient){return(0,_useBaseQuery_js__WEBPACK_IMPORTED_MODULE_0__.t)(options,_tanstack_query_core__WEBPACK_IMPORTED_MODULE_1__.$,queryClient)}},"./src/apis/balanceContent.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Gd:()=>fetchBalanceContent,O:()=>fetchRoundVoteResult,bR:()=>checkMyGameStatus,jd:()=>fetchVoteIsFinished,sl:()=>voteBalanceContent});var _fetcher__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./src/apis/fetcher.ts"),_constants_url__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/constants/url.ts");const fetchBalanceContent=async roomId=>{const res=await _fetcher__WEBPACK_IMPORTED_MODULE_0__.A.get({url:_constants_url__WEBPACK_IMPORTED_MODULE_1__.H$.balanceContent(roomId)});return await res.json()},voteBalanceContent=async({optionId,contentId,roomId,memberId})=>{const res=await _fetcher__WEBPACK_IMPORTED_MODULE_0__.A.post({url:_constants_url__WEBPACK_IMPORTED_MODULE_1__.H$.vote(roomId,contentId),headers:{"Content-Type":"application/json"},body:{memberId,optionId}});return await res.json()},fetchRoundVoteResult=async({contentId,roomId})=>{const res=await _fetcher__WEBPACK_IMPORTED_MODULE_0__.A.get({url:_constants_url__WEBPACK_IMPORTED_MODULE_1__.H$.roundVoteResult(roomId,contentId)});return await res.json()},checkMyGameStatus=async({roomId,currentRound})=>{const res=await _fetcher__WEBPACK_IMPORTED_MODULE_0__.A.get({url:_constants_url__WEBPACK_IMPORTED_MODULE_1__.H$.myGameStatus(roomId,currentRound),headers:{"Content-Type":"application/json"}});return await res.json()},fetchVoteIsFinished=async({contentId,roomId})=>{const res=await _fetcher__WEBPACK_IMPORTED_MODULE_0__.A.get({url:_constants_url__WEBPACK_IMPORTED_MODULE_1__.H$.voteIsFinished(roomId,contentId)});return await res.json()}},"./src/apis/fetcher.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>apis_fetcher});const ERROR_MESSAGE={NOT_READY_ROOM:"해당 방의 게임이 이미 시작되었어요. 게임이 끝날 때까지 기다려볼까요?",NOT_PROGRESSED_ROOM:"이미 게임이 종료되었어요. 최종 결과를 확인해볼까요?",NOT_FINISHED_ROOM:"해당 방의 게임이 아직 종료되지 않았어요.",NOT_FOUND_ROOM:"해당 방을 찾을 수 없어요. 방을 새로 만들어주세요!",NOT_ROOM_MEMBER:"사용자가 해당 방에 존재하지 않아요. 다시 접속해볼까요?",EXCEED_MAX_MEMBER_COUNT:"방의 최대 인원을 초과했습니다.",ALREADY_EXIST_MASTER:"이미 방장이 존재합니다.",ALREADY_MASTER:"해당 멤버는 이미 방장입니다.",INVALID_MASTER_CREATION:"방에 멤버가 존재하면 방장을 생성할 수 없습니다.",NOT_EXIST_MASTER:"방장이 존재하지 않습니다.",NOT_EXIST_COMMON:"일반 멤버가 존재하지 않습니다.",INVALID_TIME_LIMIT:"타이머는 10초, 15초, 30초, 60초로만 설정 가능합니다.",INVALID_RANGE_TOTAL_ROUND:"총 라운드는 5, 7, 10 라운드로만 설정 가능합니다.",EMPTY_VOTE_DEADLINE:"라운드 종료 시간이 설정되지 않았습니다.",MISMATCH_ROUND:"이미 다음 라운드가 시작되었어요. 해당 라운드가 끝날 때까지 잠시만 기다려주세요!",ROUND_LESS_THAN_START_ROUND:"startRound보다 크거나 같아야 합니다.",ROUND_GREATER_THAN_CURRENT_ROUND:"currentRound보다 작거나 같아야 합니다.",INVALID_ROUND_GAP:"currentRound과 round의 차이는 ?이하여야 합니다.",NOT_FOUND_BALANCE_CONTENT:"존재하지 않는 컨텐츠네요. 게임을 다시 진행해주세요!",NOT_FOUND_ROOM_CONTENT:"해당 방에 존재하지 않은 컨텐츠입니다. 게임을 다시 진행해주세요!",NO_RESOURCE_FOUND:"요청한 리소스를 찾을 수 없습니다. 게임을 다시 진행해주세요!",NOT_FOUND_BALANCE_OPTION:"옵션을 올바르게 선택해주세요.",ALREADY_VOTED:"이미 투표가 반영되었어요. 해당 라운드가 끝날 때까지 기다려볼까요?",VOTE_FINISHED:"투표가 이미 종료되었어요.",VOTE_NOT_FINISHED:"이미 다음 라운드가 시작되었어요. 해당 라운드가 끝날 때까지 잠시만 기다려주세요!",CAN_NOT_CHECK_MATCHING_PERCENT:"종료되지 않은 방의 투표 매칭도는 확인할 수 없습니다.",FIELD_ERROR:"필드값 입력이 잘못되었습니다.",URL_PARAMETER_ERROR:"URL parameter 입력이 잘못되었습니다.",METHOD_ARGUMENT_TYPE_MISMATCH:"입력한 값의 타입이 잘못되었습니다.",METHOD_NOT_SUPPORTED:"허용되지 않은 메서드입니다.",INTERNAL_SERVER_ERROR:"서버에 오류가 발생했어요. 다시 시도해 주세요!",NOT_FOUND_COOKIE:"사용자 정보가 있어야 방에 참여할 수 있어요. 홈화면으로 이동하여 방을 새로 만들어주세요!",INVALID_COOKIE:"사용자 정보가 있어야 방에 참여할 수 있어요. 홈화면으로 이동하여 방을 새로 만들어주세요!"};class CustomError extends Error{constructor({errorCode,status}){super(),this.errorCode=errorCode,this.message=ERROR_MESSAGE[errorCode],this.status=status}}class NetworkError extends Error{status=555;message="네트워크가 불안정해요. 다시 시도해주세요!"}const apis_fetcher={async request({url,method,body,headers}){try{const response=await fetch(url,{method,body:body&&JSON.stringify(body),headers:headers&&headers});if(!response.ok){const apiError=await response.json();throw new CustomError({...apiError,status:response.status})}return response}catch(error){if(error instanceof CustomError)throw error;throw new NetworkError}},get({url,headers}){return this.request({url,method:"GET",headers})},post({url,body,headers}){return this.request({url,method:"POST",body,headers})},delete({url,headers}){return this.request({url,method:"DELETE",headers})},patch({url,body,headers}){return this.request({url,method:"PATCH",body,headers})},put({url,headers}){return this.request({url,method:"PUT",headers})}}},"./src/components/TopicContainer/TopicContainer.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>TopicContainer_TopicContainer});var dist=__webpack_require__("./node_modules/react-router/dist/index.js"),emotion_react_browser_esm=__webpack_require__("./node_modules/@emotion/react/dist/emotion-react.browser.esm.js");const topicContainerLayout={name:"1u3km2u",styles:"display:flex;flex-basis:20%;flex-direction:column;justify-content:center;align-items:center;gap:2rem"},categoryText={name:"ywz92v",styles:"font-weight:bold;font-size:1.2rem"};var _ref={name:"13siumc",styles:"width:85%;text-align:center;word-break:keep-all"};const topicText=isGamePage=>(0,emotion_react_browser_esm.AH)("font-weight:bold;font-size:1.6rem;line-height:2rem;",!isGamePage&&_ref,";","");var A11yOnly=__webpack_require__("./src/components/common/a11yOnly/A11yOnly.tsx"),routes=__webpack_require__("./src/constants/routes.ts"),useBalanceContentQuery=__webpack_require__("./src/hooks/useBalanceContentQuery.ts"),emotion_react_jsx_runtime_browser_esm=__webpack_require__("./node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js");const TopicContainer=()=>{const location=(0,dist.zy)(),{roomId}=(0,dist.g)(),{balanceContent}=(0,useBalanceContentQuery.A)(Number(roomId)),isGamePage=location.pathname===routes.b.game(Number(roomId)),screenReaderQuestion=`질문. ${balanceContent.question}.`;return(0,emotion_react_jsx_runtime_browser_esm.FD)("section",{css:topicContainerLayout,children:[(0,emotion_react_jsx_runtime_browser_esm.Y)(A11yOnly.A,{children:screenReaderQuestion}),(0,emotion_react_jsx_runtime_browser_esm.Y)("span",{css:categoryText,"aria-hidden":!0,children:isGamePage&&balanceContent.category}),(0,emotion_react_jsx_runtime_browser_esm.Y)("span",{css:topicText(isGamePage),"aria-hidden":!0,children:balanceContent.question})]})},TopicContainer_TopicContainer=TopicContainer;TopicContainer.__docgenInfo={description:"",methods:[],displayName:"TopicContainer"}},"./src/components/common/a11yOnly/A11yOnly.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>a11yOnly_A11yOnly});const a11yOnlyLayout={name:"90pyz3",styles:"overflow:hidden;position:absolute;width:1px;height:1px;margin:-1px;padding:0;border:0;white-space:nowrap;clip:rect(0, 0, 0, 0)"};var emotion_react_jsx_runtime_browser_esm=__webpack_require__("./node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js");const A11yOnly=({as,role="text",children,...props})=>{const Component=as||"span";return(0,emotion_react_jsx_runtime_browser_esm.Y)(Component,{css:a11yOnlyLayout,role,...props,children})},a11yOnly_A11yOnly=A11yOnly;A11yOnly.__docgenInfo={description:"",methods:[],displayName:"A11yOnly",props:{as:{required:!1,tsType:{name:"T"},description:""},role:{required:!1,tsType:{name:"AriaRole"},description:"",defaultValue:{value:"'text'",computed:!1}}}}},"./src/constants/queryKeys.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{e:()=>QUERY_KEYS});const QUERY_KEYS={balanceContent:"balanceContent",matchingResult:"matchingResult",roundVoteResult:"roundVoteResult",myGameStatus:"myGameStatus",roundIsFinished:"roundIsFinished",roomMembers:"roomMembers",isRoomInitial:"isRoomInitial",categoryList:"categoryList"}},"./src/constants/routes.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{b:()=>ROUTES});const ROUTES={main:"/",nickname:"/nickname",ready:roomId=>`/${roomId}/ready`,game:roomId=>`/${roomId}/game`,roundResult:roomId=>`/${roomId}/round/result`,roundResultVote:"/round/result/vote",gameResult:roomId=>`/${roomId}/game/result`,roundResultStatus:roomId=>`/${roomId}/round/result/status`}},"./src/hooks/useBalanceContentQuery.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>__WEBPACK_DEFAULT_EXPORT__});var _tanstack_react_query__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/@tanstack/react-query/build/modern/useSuspenseQuery.js"),_apis_balanceContent__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./src/apis/balanceContent.ts"),_constants_queryKeys__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/constants/queryKeys.ts");const __WEBPACK_DEFAULT_EXPORT__=roomId=>{const balanceContentQuery=(0,_tanstack_react_query__WEBPACK_IMPORTED_MODULE_2__.U)({queryKey:[_constants_queryKeys__WEBPACK_IMPORTED_MODULE_1__.e.balanceContent,Number(roomId)],queryFn:async()=>await(0,_apis_balanceContent__WEBPACK_IMPORTED_MODULE_0__.Gd)(Number(roomId))});return{...balanceContentQuery,balanceContent:balanceContentQuery.data}}},"./src/recoil/atom.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{k:()=>roomUuidState,u:()=>memberInfoState});var recoil__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/recoil/es/index.js");const memberInfoState=(0,recoil__WEBPACK_IMPORTED_MODULE_0__.eU)({key:"memberInfo",default:{memberId:null,nickname:null,isMaster:!1}}),roomUuidState=(0,recoil__WEBPACK_IMPORTED_MODULE_0__.eU)({key:"roomUuid",default:""})},"./node_modules/core-js/internals/add-to-unscopables.js":(module,__unused_webpack_exports,__webpack_require__)=>{var wellKnownSymbol=__webpack_require__("./node_modules/core-js/internals/well-known-symbol.js"),create=__webpack_require__("./node_modules/core-js/internals/object-create.js"),defineProperty=__webpack_require__("./node_modules/core-js/internals/object-define-property.js").f,UNSCOPABLES=wellKnownSymbol("unscopables"),ArrayPrototype=Array.prototype;void 0===ArrayPrototype[UNSCOPABLES]&&defineProperty(ArrayPrototype,UNSCOPABLES,{configurable:!0,value:create(null)}),module.exports=function(key){ArrayPrototype[UNSCOPABLES][key]=!0}},"./node_modules/core-js/internals/array-from-constructor-and-list.js":(module,__unused_webpack_exports,__webpack_require__)=>{var lengthOfArrayLike=__webpack_require__("./node_modules/core-js/internals/length-of-array-like.js");module.exports=function(Constructor,list,$length){for(var index=0,length=arguments.length>2?$length:lengthOfArrayLike(list),result=new Constructor(length);length>index;)result[index]=list[index++];return result}},"./node_modules/core-js/internals/array-group.js":(module,__unused_webpack_exports,__webpack_require__)=>{var bind=__webpack_require__("./node_modules/core-js/internals/function-bind-context.js"),uncurryThis=__webpack_require__("./node_modules/core-js/internals/function-uncurry-this.js"),IndexedObject=__webpack_require__("./node_modules/core-js/internals/indexed-object.js"),toObject=__webpack_require__("./node_modules/core-js/internals/to-object.js"),toPropertyKey=__webpack_require__("./node_modules/core-js/internals/to-property-key.js"),lengthOfArrayLike=__webpack_require__("./node_modules/core-js/internals/length-of-array-like.js"),objectCreate=__webpack_require__("./node_modules/core-js/internals/object-create.js"),arrayFromConstructorAndList=__webpack_require__("./node_modules/core-js/internals/array-from-constructor-and-list.js"),$Array=Array,push=uncurryThis([].push);module.exports=function($this,callbackfn,that,specificConstructor){for(var Constructor,key,value,O=toObject($this),self=IndexedObject(O),boundFunction=bind(callbackfn,that),target=objectCreate(null),length=lengthOfArrayLike(self),index=0;length>index;index++)value=self[index],(key=toPropertyKey(boundFunction(value,index,O)))in target?push(target[key],value):target[key]=[value];if(specificConstructor&&(Constructor=specificConstructor(O))!==$Array)for(key in target)target[key]=arrayFromConstructorAndList(Constructor,target[key]);return target}},"./node_modules/core-js/internals/call-with-safe-iteration-closing.js":(module,__unused_webpack_exports,__webpack_require__)=>{var anObject=__webpack_require__("./node_modules/core-js/internals/an-object.js"),iteratorClose=__webpack_require__("./node_modules/core-js/internals/iterator-close.js");module.exports=function(iterator,fn,value,ENTRIES){try{return ENTRIES?fn(anObject(value)[0],value[1]):fn(value)}catch(error){iteratorClose(iterator,"throw",error)}}},"./node_modules/core-js/internals/create-iter-result-object.js":module=>{module.exports=function(value,done){return{value,done}}},"./node_modules/core-js/internals/define-built-ins.js":(module,__unused_webpack_exports,__webpack_require__)=>{var defineBuiltIn=__webpack_require__("./node_modules/core-js/internals/define-built-in.js");module.exports=function(target,src,options){for(var key in src)defineBuiltIn(target,key,src[key],options);return target}},"./node_modules/core-js/internals/iterator-create-proxy.js":(module,__unused_webpack_exports,__webpack_require__)=>{var call=__webpack_require__("./node_modules/core-js/internals/function-call.js"),create=__webpack_require__("./node_modules/core-js/internals/object-create.js"),createNonEnumerableProperty=__webpack_require__("./node_modules/core-js/internals/create-non-enumerable-property.js"),defineBuiltIns=__webpack_require__("./node_modules/core-js/internals/define-built-ins.js"),wellKnownSymbol=__webpack_require__("./node_modules/core-js/internals/well-known-symbol.js"),InternalStateModule=__webpack_require__("./node_modules/core-js/internals/internal-state.js"),getMethod=__webpack_require__("./node_modules/core-js/internals/get-method.js"),IteratorPrototype=__webpack_require__("./node_modules/core-js/internals/iterators-core.js").IteratorPrototype,createIterResultObject=__webpack_require__("./node_modules/core-js/internals/create-iter-result-object.js"),iteratorClose=__webpack_require__("./node_modules/core-js/internals/iterator-close.js"),TO_STRING_TAG=wellKnownSymbol("toStringTag"),setInternalState=InternalStateModule.set,createIteratorProxyPrototype=function(IS_ITERATOR){var getInternalState=InternalStateModule.getterFor(IS_ITERATOR?"WrapForValidIterator":"IteratorHelper");return defineBuiltIns(create(IteratorPrototype),{next:function next(){var state=getInternalState(this);if(IS_ITERATOR)return state.nextHandler();try{var result=state.done?void 0:state.nextHandler();return createIterResultObject(result,state.done)}catch(error){throw state.done=!0,error}},return:function(){var state=getInternalState(this),iterator=state.iterator;if(state.done=!0,IS_ITERATOR){var returnMethod=getMethod(iterator,"return");return returnMethod?call(returnMethod,iterator):createIterResultObject(void 0,!0)}if(state.inner)try{iteratorClose(state.inner.iterator,"normal")}catch(error){return iteratorClose(iterator,"throw",error)}return iteratorClose(iterator,"normal"),createIterResultObject(void 0,!0)}})},WrapForValidIteratorPrototype=createIteratorProxyPrototype(!0),IteratorHelperPrototype=createIteratorProxyPrototype(!1);createNonEnumerableProperty(IteratorHelperPrototype,TO_STRING_TAG,"Iterator Helper"),module.exports=function(nextHandler,IS_ITERATOR){var IteratorProxy=function Iterator(record,state){state?(state.iterator=record.iterator,state.next=record.next):state=record,state.type=IS_ITERATOR?"WrapForValidIterator":"IteratorHelper",state.nextHandler=nextHandler,state.counter=0,state.done=!1,setInternalState(this,state)};return IteratorProxy.prototype=IS_ITERATOR?WrapForValidIteratorPrototype:IteratorHelperPrototype,IteratorProxy}},"./node_modules/core-js/internals/iterator-map.js":(module,__unused_webpack_exports,__webpack_require__)=>{var call=__webpack_require__("./node_modules/core-js/internals/function-call.js"),aCallable=__webpack_require__("./node_modules/core-js/internals/a-callable.js"),anObject=__webpack_require__("./node_modules/core-js/internals/an-object.js"),getIteratorDirect=__webpack_require__("./node_modules/core-js/internals/get-iterator-direct.js"),createIteratorProxy=__webpack_require__("./node_modules/core-js/internals/iterator-create-proxy.js"),callWithSafeIterationClosing=__webpack_require__("./node_modules/core-js/internals/call-with-safe-iteration-closing.js"),IteratorProxy=createIteratorProxy((function(){var iterator=this.iterator,result=anObject(call(this.next,iterator));if(!(this.done=!!result.done))return callWithSafeIterationClosing(iterator,this.mapper,[result.value,this.counter++],!0)}));module.exports=function map(mapper){return anObject(this),aCallable(mapper),new IteratorProxy(getIteratorDirect(this),{mapper})}},"./node_modules/core-js/modules/esnext.array.group.js":(__unused_webpack_module,__unused_webpack_exports,__webpack_require__)=>{var $=__webpack_require__("./node_modules/core-js/internals/export.js"),$group=__webpack_require__("./node_modules/core-js/internals/array-group.js"),addToUnscopables=__webpack_require__("./node_modules/core-js/internals/add-to-unscopables.js");$({target:"Array",proto:!0},{group:function group(callbackfn){return $group(this,callbackfn,arguments.length>1?arguments[1]:void 0)}}),addToUnscopables("group")},"./node_modules/core-js/modules/esnext.iterator.map.js":(__unused_webpack_module,__unused_webpack_exports,__webpack_require__)=>{var $=__webpack_require__("./node_modules/core-js/internals/export.js"),map=__webpack_require__("./node_modules/core-js/internals/iterator-map.js");$({target:"Iterator",proto:!0,real:!0,forced:__webpack_require__("./node_modules/core-js/internals/is-pure.js")},{map})},"./src/assets/images/sillyDdangkongMedium.webp":(module,__unused_webpack_exports,__webpack_require__)=>{module.exports=__webpack_require__.p+"static/media/sillyDdangkongMedium.9937535c.webp"}}]); \ No newline at end of file diff --git a/storybook/components-TabContentContainer-TabContentContainer-stories.89ca2f4c.iframe.bundle.js b/storybook/components-TabContentContainer-TabContentContainer-stories.89ca2f4c.iframe.bundle.js new file mode 100644 index 000000000..f9c895b3a --- /dev/null +++ b/storybook/components-TabContentContainer-TabContentContainer-stories.89ca2f4c.iframe.bundle.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkddangkong_frontend=self.webpackChunkddangkong_frontend||[]).push([[867],{"./src/components/TabContentContainer/TabContentContainer.stories.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{__namedExportsOrder:()=>__namedExportsOrder,default:()=>TabContentContainer_stories,투표_통계:()=>투표_통계,투표_현황:()=>투표_현황});var dist=__webpack_require__("./node_modules/react-router/dist/index.js"),emotion_react_browser_esm=__webpack_require__("./node_modules/@emotion/react/dist/emotion-react.browser.esm.js"),Theme=__webpack_require__("./src/styles/Theme.ts");const contentWrapperStyle=(0,emotion_react_browser_esm.AH)("display:flex;flex-direction:column;gap:15%;height:50vh;overflow-y:auto;padding:2.4rem;border:0.3rem solid ",Theme.S.color.peanut400,";border-radius:0.8rem;",""),roundVoteResultContainer={name:"4zk4ri",styles:"display:flex;flex-direction:column;gap:1rem"},optionContainer={name:"s4usvj",styles:"display:flex;justify-content:space-between;gap:0.8rem;font-weight:bold;font-size:1.4rem"},barWrapperStyle={name:"9kcjqh",styles:"display:flex;overflow:hidden;align-items:center;width:inherit;border-radius:1.6rem"},barWrapper={name:"zur63y",styles:"display:flex;justify-content:center;align-items:center;height:8vh;color:black;font-weight:bold;font-size:1.6rem;transition:all 1s"},firstBar=(percent,isBigFirstOption)=>(0,emotion_react_browser_esm.AH)(barWrapper," overflow:hidden;width:",percent,"%;border-radius:1.6rem 0 0 1.6rem;background-color:",isBigFirstOption?Theme.S.color.peanut400:Theme.S.color.gray,";transform:translateX(5px);clip-path:",100===percent?"none":"polygon(0 0, 100% 0, calc(100% - 10px) 100%, 0 100%)",";",""),secondBar=(percent,isBigFirstOption)=>(0,emotion_react_browser_esm.AH)(barWrapper," overflow:hidden;width:",percent,"%;border-radius:0 1.6rem 1.6rem 0;background-color:",isBigFirstOption?Theme.S.color.gray:Theme.S.color.peanut400,";transform:translateX(-5px);clip-path:",100===percent?"none":"polygon(10px 0, 100% 0, 100% 100%, 0 100%)",";",""),noVoteTextContainer={name:"zigog8",styles:"display:flex;flex-direction:column;align-items:center"},noVoteText=(0,emotion_react_browser_esm.AH)("display:flex;justify-content:center;align-items:center;height:8vh;",Theme.S.typography.headline3,";",""),angryImage={name:"ne5uve",styles:"width:16rem;height:14rem"},totalResultInfoContainer={name:"zigog8",styles:"display:flex;flex-direction:column;align-items:center"},totalResultInfoText={name:"1w0tudv",styles:"font-size:1.4rem;line-height:2rem"},emphasizeText={name:"1efi8gv",styles:"font-weight:bold"},TabContentContainer_util=totalResult=>{const{firstOption,secondOption}=totalResult,isEqual=firstOption.percent===secondOption.percent,dominantOption=firstOption.percent>secondOption.percent?firstOption:secondOption;return{isEqual,dominantPercent:dominantOption.percent,dominantName:dominantOption.name}};var A11yOnly=__webpack_require__("./src/components/common/a11yOnly/A11yOnly.tsx");const optionParticipantsContainerLayout={name:"koo7tc",styles:"display:flex;flex-direction:column;width:100%;row-gap:1.2rem"},horizontalDivider=(0,emotion_react_browser_esm.AH)("width:100%;height:1px;margin:1.4rem 0;background-color:",Theme.S.color.gray300,";","");__webpack_require__("./node_modules/core-js/modules/esnext.iterator.map.js");const optionParticipantsLayout={name:"ch4q08",styles:"display:flex;flex-direction:column;gap:2rem;width:100%"},optionInfo={name:"1akzvke",styles:"font-weight:bold;font-size:1.6rem"},participantsListWrapper={name:"qrhm24",styles:"display:grid;grid-template-columns:repeat(2, 1fr);row-gap:1.4rem"};var es=__webpack_require__("./node_modules/recoil/es/index.js");const nicknameItemLayout={name:"10fbv33",styles:"display:flex;align-items:center;gap:0.6rem"},nicknameText=isMyNickname=>(0,emotion_react_browser_esm.AH)("font-weight:",isMyNickname?"bold":400,";font-size:1.2rem;",""),profileImage={name:"h3hy14",styles:"width:1.8rem;height:1.8rem"};var sillyDdangkongMedium=__webpack_require__("./src/assets/images/sillyDdangkongMedium.webp"),atom=__webpack_require__("./src/recoil/atom.ts"),emotion_react_jsx_runtime_browser_esm=__webpack_require__("./node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js");const NicknameItem=({nickName})=>{const isMyNickname=(0,es.vc)(atom.u).nickname===nickName;return(0,emotion_react_jsx_runtime_browser_esm.FD)("li",{css:nicknameItemLayout,children:[(0,emotion_react_jsx_runtime_browser_esm.Y)("img",{src:sillyDdangkongMedium,alt:"사용자 프로필",css:profileImage}),(0,emotion_react_jsx_runtime_browser_esm.Y)("span",{css:nicknameText(isMyNickname),children:nickName})]})},NicknameItem_NicknameItem=NicknameItem;NicknameItem.__docgenInfo={description:"",methods:[],displayName:"NicknameItem",props:{nickName:{required:!0,tsType:{name:"string"},description:""}}};const OptionParticipants=({optionName,memberCount,members})=>{const screenReaderOptionParticipants=`${optionName}. ${memberCount}명`;return(0,emotion_react_jsx_runtime_browser_esm.FD)("div",{css:optionParticipantsLayout,children:[(0,emotion_react_jsx_runtime_browser_esm.Y)(A11yOnly.A,{children:screenReaderOptionParticipants}),(0,emotion_react_jsx_runtime_browser_esm.FD)("p",{css:optionInfo,"aria-hidden":!0,children:[optionName,": ",memberCount]}),(0,emotion_react_jsx_runtime_browser_esm.Y)("ul",{css:participantsListWrapper,children:members.map(((member,index)=>(0,emotion_react_jsx_runtime_browser_esm.Y)(NicknameItem_NicknameItem,{nickName:member},index)))})]})},OptionParticipants_OptionParticipants=OptionParticipants;OptionParticipants.__docgenInfo={description:"",methods:[],displayName:"OptionParticipants",props:{optionName:{required:!0,tsType:{name:"string"},description:""},memberCount:{required:!0,tsType:{name:"number"},description:""},members:{required:!0,tsType:{name:"Array",elements:[{name:"string"}],raw:"string[]"},description:""}}};var useBalanceContentQuery=__webpack_require__("./src/hooks/useBalanceContentQuery.ts"),react=__webpack_require__("./node_modules/react/index.js"),useQuery=__webpack_require__("./node_modules/@tanstack/react-query/build/modern/useQuery.js"),balanceContent=__webpack_require__("./src/apis/balanceContent.ts"),config=__webpack_require__("./src/constants/config.ts"),queryKeys=__webpack_require__("./src/constants/queryKeys.ts");const hooks_useMyGameStatusQuery=({roomId,currentRound})=>{const myGameStatusQuery=(0,useQuery.I)({queryKey:[queryKeys.e.myGameStatus,roomId,currentRound],queryFn:()=>{if(!currentRound)throw new Error("balanceContent 가 존재하지 않습니다.");return(0,balanceContent.bR)({roomId,currentRound})},enabled:!!currentRound,refetchInterval:query=>!(query.state.error&&query.state.fetchFailureCount>=config.A3)&&config.S2,refetchIntervalInBackground:!0,gcTime:0});return{...myGameStatusQuery,isRoundFinished:myGameStatusQuery.data?.isRoundFinished,isGameFinished:myGameStatusQuery.data?.isGameFinished}};var routes=__webpack_require__("./src/constants/routes.ts");const hooks_useMyGameStatus=({roomId})=>{const navigate=(0,dist.Zp)(),{balanceContent}=(0,useBalanceContentQuery.A)(Number(roomId)),{isRoundFinished,isGameFinished}=hooks_useMyGameStatusQuery({roomId:Number(roomId),currentRound:balanceContent?.currentRound});(0,react.useEffect)((()=>{isGameFinished&&navigate(routes.b.gameResult(Number(roomId))),isRoundFinished&&navigate(routes.b.game(Number(roomId)))}),[isRoundFinished,isGameFinished])},roundVoteResultInitialValue_namespaceObject=JSON.parse('{"group":{"firstOption":{"optionId":1,"name":"Loading...","members":[],"memberCount":0,"percent":50},"secondOption":{"optionId":2,"name":"Loading...","members":[],"memberCount":0,"percent":50},"giveUp":{"members":[],"memberCount":0}},"total":{"firstOption":{"optionId":1,"name":"Loading...","percent":50},"secondOption":{"optionId":2,"name":"Loading...","percent":50}}}'),hooks_useRoundVoteResultQuery=({roomId,contentId})=>{const roundVoteResultQuery=(0,useQuery.I)({queryKey:[queryKeys.e.roundVoteResult,roomId,contentId],queryFn:async()=>{if(void 0===contentId)throw new Error("contentId 가 존재하지 않습니다.");if(void 0===roomId)throw new Error("방이 존재하지 않습니다.");return await(0,balanceContent.O)({roomId,contentId})},placeholderData:roundVoteResultInitialValue_namespaceObject,enabled:!!contentId});return{...roundVoteResultQuery,groupRoundResult:roundVoteResultQuery.data?.group,totalResult:roundVoteResultQuery.data?.total}},OptionParticipantsContainer=()=>{const{roomId}=(0,dist.g)(),{balanceContent}=(0,useBalanceContentQuery.A)(Number(roomId)),{groupRoundResult}=hooks_useRoundVoteResultQuery({roomId:Number(roomId),contentId:balanceContent?.contentId});return hooks_useMyGameStatus({roomId:Number(roomId)}),groupRoundResult?(0,emotion_react_jsx_runtime_browser_esm.Y)(emotion_react_jsx_runtime_browser_esm.FK,{children:(0,emotion_react_jsx_runtime_browser_esm.FD)("section",{css:optionParticipantsContainerLayout,children:[(0,emotion_react_jsx_runtime_browser_esm.Y)(OptionParticipants_OptionParticipants,{optionName:groupRoundResult.firstOption.name,members:groupRoundResult.firstOption.members,memberCount:groupRoundResult.firstOption.memberCount}),(0,emotion_react_jsx_runtime_browser_esm.Y)("div",{css:horizontalDivider}),(0,emotion_react_jsx_runtime_browser_esm.Y)(OptionParticipants_OptionParticipants,{optionName:groupRoundResult.secondOption.name,members:groupRoundResult.secondOption.members,memberCount:groupRoundResult.secondOption.memberCount}),(0,emotion_react_jsx_runtime_browser_esm.Y)("div",{css:horizontalDivider}),(0,emotion_react_jsx_runtime_browser_esm.Y)(OptionParticipants_OptionParticipants,{optionName:"투표에 참여하지 않으셨어요",members:groupRoundResult.giveUp.members,memberCount:groupRoundResult.giveUp.memberCount})]})}):(0,emotion_react_jsx_runtime_browser_esm.Y)("div",{children:"데이터가 없습니다"})},OptionParticipantsContainer_OptionParticipantsContainer=OptionParticipantsContainer;OptionParticipantsContainer.__docgenInfo={description:"",methods:[],displayName:"OptionParticipantsContainer"};const hooks_useCountAnimation=({target,start=50,duration=2e3})=>{const[count,setCount]=(0,react.useState)(start);return(0,react.useEffect)((()=>{if(void 0===target||target===start)return;const totalFrame=Math.round(duration/8.333333333333334);let currentNumber=start;const counter=setInterval((()=>{const progress=1===(timingRate=++currentNumber/totalFrame)?1:1-Math.pow(2,-10*timingRate);var timingRate;setCount(Math.round(target*progress)),1===progress&&clearInterval(counter)}),8.333333333333334);return()=>clearInterval(counter)}),[target,start,duration]),count},RoundVoteContainer_hook=groupRoundResult=>({animatedFirstPercent:hooks_useCountAnimation({target:groupRoundResult?.firstOption.percent}),animatedSecondPercent:hooks_useCountAnimation({target:groupRoundResult?.secondOption.percent})});var TopicContainer=__webpack_require__("./src/components/TopicContainer/TopicContainer.tsx");const angryDdangkong_namespaceObject=__webpack_require__.p+"static/media/angryDdangkong.29469aa8.webp",TabContentContainer=({isVoteStatisticsTabActive})=>{const{roomId}=(0,dist.g)(),{balanceContent}=(0,useBalanceContentQuery.A)(Number(roomId)),{groupRoundResult,totalResult}=hooks_useRoundVoteResultQuery({roomId:Number(roomId),contentId:balanceContent?.contentId});hooks_useMyGameStatus({roomId:Number(roomId)});const{animatedFirstPercent,animatedSecondPercent}=RoundVoteContainer_hook(groupRoundResult);if(!groupRoundResult)return;const isBigFirstOption=groupRoundResult.firstOption.percent>=50,isVote=0!==groupRoundResult.firstOption.memberCount||0!==groupRoundResult.secondOption.memberCount,dominantVoteData=totalResult?TabContentContainer_util(totalResult):null,screenReaderFirstOption=`${groupRoundResult.firstOption.name} ${groupRoundResult.firstOption.percent}%. ${groupRoundResult.firstOption.memberCount}명 선택.`,screenReaderSecondOption=`${groupRoundResult.secondOption.name} ${groupRoundResult.secondOption.percent}%. ${groupRoundResult.secondOption.memberCount}명 선택`,screenReaderDominantVote=`📢 전체 유저 중 ${dominantVoteData?.dominantPercent}%는. ${dominantVoteData?.dominantName}를 선택했어요`;return(0,emotion_react_jsx_runtime_browser_esm.FD)("div",{css:contentWrapperStyle,children:[(0,emotion_react_jsx_runtime_browser_esm.Y)(TopicContainer.A,{}),isVote&&isVoteStatisticsTabActive&&(0,emotion_react_jsx_runtime_browser_esm.FD)(emotion_react_jsx_runtime_browser_esm.FK,{children:[(0,emotion_react_jsx_runtime_browser_esm.FD)(A11yOnly.A,{children:[screenReaderFirstOption,screenReaderSecondOption]}),(0,emotion_react_jsx_runtime_browser_esm.FD)("div",{css:roundVoteResultContainer,"aria-hidden":!0,children:[(0,emotion_react_jsx_runtime_browser_esm.FD)("div",{css:optionContainer,children:[(0,emotion_react_jsx_runtime_browser_esm.Y)("span",{children:groupRoundResult.firstOption.name}),(0,emotion_react_jsx_runtime_browser_esm.Y)("span",{children:groupRoundResult.secondOption.name})]}),(0,emotion_react_jsx_runtime_browser_esm.FD)("div",{css:barWrapperStyle,children:[(0,emotion_react_jsx_runtime_browser_esm.FD)("span",{css:firstBar(groupRoundResult.firstOption.percent,isBigFirstOption),children:[animatedFirstPercent,"%"]}),(0,emotion_react_jsx_runtime_browser_esm.FD)("span",{css:secondBar(groupRoundResult.secondOption.percent,isBigFirstOption),children:[animatedSecondPercent,"%"]})]}),(0,emotion_react_jsx_runtime_browser_esm.FD)("div",{css:(isActiveGroupTab=isVoteStatisticsTabActive,(0,emotion_react_browser_esm.AH)("display:flex;visibility:",isActiveGroupTab?"visible":"hidden",";justify-content:space-between;align-items:center;height:1.2rem;font-weight:bold;font-size:1.2rem;","")),children:[(0,emotion_react_jsx_runtime_browser_esm.FD)("span",{children:[groupRoundResult.firstOption.memberCount,"명"]}),(0,emotion_react_jsx_runtime_browser_esm.FD)("span",{children:[groupRoundResult.secondOption.memberCount,"명"]})]})]}),totalResult&&dominantVoteData&&(0,emotion_react_jsx_runtime_browser_esm.Y)("div",{css:totalResultInfoContainer,children:dominantVoteData.isEqual?(0,emotion_react_jsx_runtime_browser_esm.Y)("span",{css:totalResultInfoText,children:"📢 전체 유저 사이에서는 의견이 반반이에요 😲"}):(0,emotion_react_jsx_runtime_browser_esm.FD)(emotion_react_jsx_runtime_browser_esm.FK,{children:[(0,emotion_react_jsx_runtime_browser_esm.Y)(A11yOnly.A,{children:screenReaderDominantVote}),(0,emotion_react_jsx_runtime_browser_esm.FD)("span",{css:totalResultInfoText,"aria-hidden":!0,children:["📢 전체 유저 중"," ",(0,emotion_react_jsx_runtime_browser_esm.FD)("span",{css:emphasizeText,children:[dominantVoteData.dominantPercent,"%"]}),"는"]}),(0,emotion_react_jsx_runtime_browser_esm.FD)("span",{css:totalResultInfoText,"aria-hidden":!0,children:[(0,emotion_react_jsx_runtime_browser_esm.Y)("span",{css:emphasizeText,children:dominantVoteData.dominantName}),"를 선택했어요 !"]})]})})]}),isVote&&!isVoteStatisticsTabActive&&(0,emotion_react_jsx_runtime_browser_esm.Y)(OptionParticipantsContainer_OptionParticipantsContainer,{}),!isVote&&(0,emotion_react_jsx_runtime_browser_esm.FD)("div",{css:noVoteTextContainer,children:[(0,emotion_react_jsx_runtime_browser_esm.Y)("img",{src:angryDdangkong_namespaceObject,alt:"화난 땅콩",css:angryImage}),(0,emotion_react_jsx_runtime_browser_esm.FD)("span",{css:noVoteText,children:["아무도 투표하지 않으셨네요 :",")"]})]})]});var isActiveGroupTab},TabContentContainer_TabContentContainer=TabContentContainer;TabContentContainer.__docgenInfo={description:"",methods:[],displayName:"TabContentContainer",props:{isVoteStatisticsTabActive:{required:!0,tsType:{name:"boolean"},description:""}}};const TabContentContainer_stories={title:"TabContentContainer",component:TabContentContainer_TabContentContainer},투표_통계={args:{isVoteStatisticsTabActive:!0}},투표_현황={args:{isVoteStatisticsTabActive:!1}},__namedExportsOrder=["투표_통계","투표_현황"];투표_통계.parameters={...투표_통계.parameters,docs:{...투표_통계.parameters?.docs,source:{originalSource:"{\n args: {\n isVoteStatisticsTabActive: true\n }\n}",...투표_통계.parameters?.docs?.source}}},투표_현황.parameters={...투표_현황.parameters,docs:{...투표_현황.parameters?.docs,source:{originalSource:"{\n args: {\n isVoteStatisticsTabActive: false\n }\n}",...투표_현황.parameters?.docs?.source}}}},"./node_modules/@tanstack/react-query/build/modern/useQuery.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{I:()=>useQuery});var _tanstack_query_core__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/@tanstack/query-core/build/modern/queryObserver.js"),_useBaseQuery_js__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/@tanstack/react-query/build/modern/useBaseQuery.js");function useQuery(options,queryClient){return(0,_useBaseQuery_js__WEBPACK_IMPORTED_MODULE_0__.t)(options,_tanstack_query_core__WEBPACK_IMPORTED_MODULE_1__.$,queryClient)}},"./src/apis/balanceContent.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Gd:()=>fetchBalanceContent,O:()=>fetchRoundVoteResult,bR:()=>checkMyGameStatus,jd:()=>fetchVoteIsFinished,sl:()=>voteBalanceContent});var _fetcher__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./src/apis/fetcher.ts"),_constants_url__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/constants/url.ts");const fetchBalanceContent=async roomId=>{const res=await _fetcher__WEBPACK_IMPORTED_MODULE_0__.A.get({url:_constants_url__WEBPACK_IMPORTED_MODULE_1__.H$.balanceContent(roomId)});return await res.json()},voteBalanceContent=async({optionId,contentId,roomId,memberId})=>{const res=await _fetcher__WEBPACK_IMPORTED_MODULE_0__.A.post({url:_constants_url__WEBPACK_IMPORTED_MODULE_1__.H$.vote(roomId,contentId),headers:{"Content-Type":"application/json"},body:{memberId,optionId}});return await res.json()},fetchRoundVoteResult=async({contentId,roomId})=>{const res=await _fetcher__WEBPACK_IMPORTED_MODULE_0__.A.get({url:_constants_url__WEBPACK_IMPORTED_MODULE_1__.H$.roundVoteResult(roomId,contentId)});return await res.json()},checkMyGameStatus=async({roomId,currentRound})=>{const res=await _fetcher__WEBPACK_IMPORTED_MODULE_0__.A.get({url:_constants_url__WEBPACK_IMPORTED_MODULE_1__.H$.myGameStatus(roomId,currentRound),headers:{"Content-Type":"application/json"}});return await res.json()},fetchVoteIsFinished=async({contentId,roomId})=>{const res=await _fetcher__WEBPACK_IMPORTED_MODULE_0__.A.get({url:_constants_url__WEBPACK_IMPORTED_MODULE_1__.H$.voteIsFinished(roomId,contentId)});return await res.json()}},"./src/apis/fetcher.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>apis_fetcher});const ERROR_MESSAGE={NOT_READY_ROOM:"해당 방의 게임이 이미 시작되었어요. 게임이 끝날 때까지 기다려볼까요?",NOT_PROGRESSED_ROOM:"이미 게임이 종료되었어요. 최종 결과를 확인해볼까요?",NOT_FINISHED_ROOM:"해당 방의 게임이 아직 종료되지 않았어요.",NOT_FOUND_ROOM:"해당 방을 찾을 수 없어요. 방을 새로 만들어주세요!",NOT_ROOM_MEMBER:"사용자가 해당 방에 존재하지 않아요. 다시 접속해볼까요?",EXCEED_MAX_MEMBER_COUNT:"방의 최대 인원을 초과했습니다.",ALREADY_EXIST_MASTER:"이미 방장이 존재합니다.",ALREADY_MASTER:"해당 멤버는 이미 방장입니다.",INVALID_MASTER_CREATION:"방에 멤버가 존재하면 방장을 생성할 수 없습니다.",NOT_EXIST_MASTER:"방장이 존재하지 않습니다.",NOT_EXIST_COMMON:"일반 멤버가 존재하지 않습니다.",INVALID_TIME_LIMIT:"타이머는 10초, 15초, 30초, 60초로만 설정 가능합니다.",INVALID_RANGE_TOTAL_ROUND:"총 라운드는 5, 7, 10 라운드로만 설정 가능합니다.",EMPTY_VOTE_DEADLINE:"라운드 종료 시간이 설정되지 않았습니다.",MISMATCH_ROUND:"이미 다음 라운드가 시작되었어요. 해당 라운드가 끝날 때까지 잠시만 기다려주세요!",ROUND_LESS_THAN_START_ROUND:"startRound보다 크거나 같아야 합니다.",ROUND_GREATER_THAN_CURRENT_ROUND:"currentRound보다 작거나 같아야 합니다.",INVALID_ROUND_GAP:"currentRound과 round의 차이는 ?이하여야 합니다.",NOT_FOUND_BALANCE_CONTENT:"존재하지 않는 컨텐츠네요. 게임을 다시 진행해주세요!",NOT_FOUND_ROOM_CONTENT:"해당 방에 존재하지 않은 컨텐츠입니다. 게임을 다시 진행해주세요!",NO_RESOURCE_FOUND:"요청한 리소스를 찾을 수 없습니다. 게임을 다시 진행해주세요!",NOT_FOUND_BALANCE_OPTION:"옵션을 올바르게 선택해주세요.",ALREADY_VOTED:"이미 투표가 반영되었어요. 해당 라운드가 끝날 때까지 기다려볼까요?",VOTE_FINISHED:"투표가 이미 종료되었어요.",VOTE_NOT_FINISHED:"이미 다음 라운드가 시작되었어요. 해당 라운드가 끝날 때까지 잠시만 기다려주세요!",CAN_NOT_CHECK_MATCHING_PERCENT:"종료되지 않은 방의 투표 매칭도는 확인할 수 없습니다.",FIELD_ERROR:"필드값 입력이 잘못되었습니다.",URL_PARAMETER_ERROR:"URL parameter 입력이 잘못되었습니다.",METHOD_ARGUMENT_TYPE_MISMATCH:"입력한 값의 타입이 잘못되었습니다.",METHOD_NOT_SUPPORTED:"허용되지 않은 메서드입니다.",INTERNAL_SERVER_ERROR:"서버에 오류가 발생했어요. 다시 시도해 주세요!",NOT_FOUND_COOKIE:"사용자 정보가 있어야 방에 참여할 수 있어요. 홈화면으로 이동하여 방을 새로 만들어주세요!",INVALID_COOKIE:"사용자 정보가 있어야 방에 참여할 수 있어요. 홈화면으로 이동하여 방을 새로 만들어주세요!"};class CustomError extends Error{constructor({errorCode,status}){super(),this.errorCode=errorCode,this.message=ERROR_MESSAGE[errorCode],this.status=status}}class NetworkError extends Error{status=555;message="네트워크가 불안정해요. 다시 시도해주세요!"}const apis_fetcher={async request({url,method,body,headers}){try{const response=await fetch(url,{method,body:body&&JSON.stringify(body),headers:headers&&headers});if(!response.ok){const apiError=await response.json();throw new CustomError({...apiError,status:response.status})}return response}catch(error){if(error instanceof CustomError)throw error;throw new NetworkError}},get({url,headers}){return this.request({url,method:"GET",headers})},post({url,body,headers}){return this.request({url,method:"POST",body,headers})},delete({url,headers}){return this.request({url,method:"DELETE",headers})},patch({url,body,headers}){return this.request({url,method:"PATCH",body,headers})},put({url,headers}){return this.request({url,method:"PUT",headers})}}},"./src/components/TopicContainer/TopicContainer.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>TopicContainer_TopicContainer});var dist=__webpack_require__("./node_modules/react-router/dist/index.js");const topicContainerLayout={name:"1u3km2u",styles:"display:flex;flex-basis:20%;flex-direction:column;justify-content:center;align-items:center;gap:2rem"},categoryText={name:"ywz92v",styles:"font-weight:bold;font-size:1.2rem"},topicText={name:"1akzvke",styles:"font-weight:bold;font-size:1.6rem"};var A11yOnly=__webpack_require__("./src/components/common/a11yOnly/A11yOnly.tsx"),routes=__webpack_require__("./src/constants/routes.ts"),useBalanceContentQuery=__webpack_require__("./src/hooks/useBalanceContentQuery.ts"),emotion_react_jsx_runtime_browser_esm=__webpack_require__("./node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js");const TopicContainer=()=>{const location=(0,dist.zy)(),{roomId}=(0,dist.g)(),{balanceContent}=(0,useBalanceContentQuery.A)(Number(roomId)),isGamePage=location.pathname===routes.b.game(Number(roomId)),screenReaderQuestion=`질문. ${balanceContent.question}.`;return(0,emotion_react_jsx_runtime_browser_esm.FD)("section",{css:topicContainerLayout,children:[(0,emotion_react_jsx_runtime_browser_esm.Y)(A11yOnly.A,{children:screenReaderQuestion}),(0,emotion_react_jsx_runtime_browser_esm.Y)("span",{css:categoryText,"aria-hidden":!0,children:isGamePage&&balanceContent.category}),(0,emotion_react_jsx_runtime_browser_esm.Y)("span",{css:topicText,"aria-hidden":!0,children:balanceContent.question})]})},TopicContainer_TopicContainer=TopicContainer;TopicContainer.__docgenInfo={description:"",methods:[],displayName:"TopicContainer"}},"./src/components/common/a11yOnly/A11yOnly.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>a11yOnly_A11yOnly});const a11yOnlyLayout={name:"90pyz3",styles:"overflow:hidden;position:absolute;width:1px;height:1px;margin:-1px;padding:0;border:0;white-space:nowrap;clip:rect(0, 0, 0, 0)"};var emotion_react_jsx_runtime_browser_esm=__webpack_require__("./node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js");const A11yOnly=({as,children,...props})=>{const Component=as||"span";return(0,emotion_react_jsx_runtime_browser_esm.Y)(Component,{css:a11yOnlyLayout,...props,children})},a11yOnly_A11yOnly=A11yOnly;A11yOnly.__docgenInfo={description:"",methods:[],displayName:"A11yOnly",props:{as:{required:!1,tsType:{name:"T"},description:""},role:{required:!1,tsType:{name:"AriaRole"},description:""}}}},"./src/constants/queryKeys.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{e:()=>QUERY_KEYS});const QUERY_KEYS={balanceContent:"balanceContent",matchingResult:"matchingResult",roundVoteResult:"roundVoteResult",myGameStatus:"myGameStatus",roundIsFinished:"roundIsFinished",roomMembers:"roomMembers",isRoomInitial:"isRoomInitial",categoryList:"categoryList"}},"./src/constants/routes.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{b:()=>ROUTES});const ROUTES={main:"/",nickname:"/nickname",ready:roomId=>`/${roomId}/ready`,game:roomId=>`/${roomId}/game`,roundResult:roomId=>`/${roomId}/round/result`,roundResultVote:"/round/result/vote",gameResult:roomId=>`/${roomId}/game/result`,roundResultStatus:roomId=>`/${roomId}/round/result/status`}},"./src/hooks/useBalanceContentQuery.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>__WEBPACK_DEFAULT_EXPORT__});var _tanstack_react_query__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/@tanstack/react-query/build/modern/useSuspenseQuery.js"),_apis_balanceContent__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./src/apis/balanceContent.ts"),_constants_queryKeys__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/constants/queryKeys.ts");const __WEBPACK_DEFAULT_EXPORT__=roomId=>{const balanceContentQuery=(0,_tanstack_react_query__WEBPACK_IMPORTED_MODULE_2__.U)({queryKey:[_constants_queryKeys__WEBPACK_IMPORTED_MODULE_1__.e.balanceContent,Number(roomId)],queryFn:async()=>await(0,_apis_balanceContent__WEBPACK_IMPORTED_MODULE_0__.Gd)(Number(roomId))});return{...balanceContentQuery,balanceContent:balanceContentQuery.data}}},"./src/recoil/atom.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{k:()=>roomUuidState,u:()=>memberInfoState});var recoil__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/recoil/es/index.js");const memberInfoState=(0,recoil__WEBPACK_IMPORTED_MODULE_0__.eU)({key:"memberInfo",default:{memberId:null,nickname:null,isMaster:!1}}),roomUuidState=(0,recoil__WEBPACK_IMPORTED_MODULE_0__.eU)({key:"roomUuid",default:""})},"./node_modules/core-js/internals/call-with-safe-iteration-closing.js":(module,__unused_webpack_exports,__webpack_require__)=>{var anObject=__webpack_require__("./node_modules/core-js/internals/an-object.js"),iteratorClose=__webpack_require__("./node_modules/core-js/internals/iterator-close.js");module.exports=function(iterator,fn,value,ENTRIES){try{return ENTRIES?fn(anObject(value)[0],value[1]):fn(value)}catch(error){iteratorClose(iterator,"throw",error)}}},"./node_modules/core-js/internals/create-iter-result-object.js":module=>{module.exports=function(value,done){return{value,done}}},"./node_modules/core-js/internals/define-built-ins.js":(module,__unused_webpack_exports,__webpack_require__)=>{var defineBuiltIn=__webpack_require__("./node_modules/core-js/internals/define-built-in.js");module.exports=function(target,src,options){for(var key in src)defineBuiltIn(target,key,src[key],options);return target}},"./node_modules/core-js/internals/iterator-create-proxy.js":(module,__unused_webpack_exports,__webpack_require__)=>{var call=__webpack_require__("./node_modules/core-js/internals/function-call.js"),create=__webpack_require__("./node_modules/core-js/internals/object-create.js"),createNonEnumerableProperty=__webpack_require__("./node_modules/core-js/internals/create-non-enumerable-property.js"),defineBuiltIns=__webpack_require__("./node_modules/core-js/internals/define-built-ins.js"),wellKnownSymbol=__webpack_require__("./node_modules/core-js/internals/well-known-symbol.js"),InternalStateModule=__webpack_require__("./node_modules/core-js/internals/internal-state.js"),getMethod=__webpack_require__("./node_modules/core-js/internals/get-method.js"),IteratorPrototype=__webpack_require__("./node_modules/core-js/internals/iterators-core.js").IteratorPrototype,createIterResultObject=__webpack_require__("./node_modules/core-js/internals/create-iter-result-object.js"),iteratorClose=__webpack_require__("./node_modules/core-js/internals/iterator-close.js"),TO_STRING_TAG=wellKnownSymbol("toStringTag"),setInternalState=InternalStateModule.set,createIteratorProxyPrototype=function(IS_ITERATOR){var getInternalState=InternalStateModule.getterFor(IS_ITERATOR?"WrapForValidIterator":"IteratorHelper");return defineBuiltIns(create(IteratorPrototype),{next:function next(){var state=getInternalState(this);if(IS_ITERATOR)return state.nextHandler();try{var result=state.done?void 0:state.nextHandler();return createIterResultObject(result,state.done)}catch(error){throw state.done=!0,error}},return:function(){var state=getInternalState(this),iterator=state.iterator;if(state.done=!0,IS_ITERATOR){var returnMethod=getMethod(iterator,"return");return returnMethod?call(returnMethod,iterator):createIterResultObject(void 0,!0)}if(state.inner)try{iteratorClose(state.inner.iterator,"normal")}catch(error){return iteratorClose(iterator,"throw",error)}return iteratorClose(iterator,"normal"),createIterResultObject(void 0,!0)}})},WrapForValidIteratorPrototype=createIteratorProxyPrototype(!0),IteratorHelperPrototype=createIteratorProxyPrototype(!1);createNonEnumerableProperty(IteratorHelperPrototype,TO_STRING_TAG,"Iterator Helper"),module.exports=function(nextHandler,IS_ITERATOR){var IteratorProxy=function Iterator(record,state){state?(state.iterator=record.iterator,state.next=record.next):state=record,state.type=IS_ITERATOR?"WrapForValidIterator":"IteratorHelper",state.nextHandler=nextHandler,state.counter=0,state.done=!1,setInternalState(this,state)};return IteratorProxy.prototype=IS_ITERATOR?WrapForValidIteratorPrototype:IteratorHelperPrototype,IteratorProxy}},"./node_modules/core-js/internals/iterator-map.js":(module,__unused_webpack_exports,__webpack_require__)=>{var call=__webpack_require__("./node_modules/core-js/internals/function-call.js"),aCallable=__webpack_require__("./node_modules/core-js/internals/a-callable.js"),anObject=__webpack_require__("./node_modules/core-js/internals/an-object.js"),getIteratorDirect=__webpack_require__("./node_modules/core-js/internals/get-iterator-direct.js"),createIteratorProxy=__webpack_require__("./node_modules/core-js/internals/iterator-create-proxy.js"),callWithSafeIterationClosing=__webpack_require__("./node_modules/core-js/internals/call-with-safe-iteration-closing.js"),IteratorProxy=createIteratorProxy((function(){var iterator=this.iterator,result=anObject(call(this.next,iterator));if(!(this.done=!!result.done))return callWithSafeIterationClosing(iterator,this.mapper,[result.value,this.counter++],!0)}));module.exports=function map(mapper){return anObject(this),aCallable(mapper),new IteratorProxy(getIteratorDirect(this),{mapper})}},"./node_modules/core-js/modules/esnext.iterator.map.js":(__unused_webpack_module,__unused_webpack_exports,__webpack_require__)=>{var $=__webpack_require__("./node_modules/core-js/internals/export.js"),map=__webpack_require__("./node_modules/core-js/internals/iterator-map.js");$({target:"Iterator",proto:!0,real:!0,forced:__webpack_require__("./node_modules/core-js/internals/is-pure.js")},{map})},"./src/assets/images/sillyDdangkongMedium.webp":(module,__unused_webpack_exports,__webpack_require__)=>{module.exports=__webpack_require__.p+"static/media/sillyDdangkongMedium.9937535c.webp"}}]); \ No newline at end of file diff --git a/storybook/components-TopicContainer-TopicContainer-stories.85895207.iframe.bundle.js b/storybook/components-TopicContainer-TopicContainer-stories.9cf5d02d.iframe.bundle.js similarity index 60% rename from storybook/components-TopicContainer-TopicContainer-stories.85895207.iframe.bundle.js rename to storybook/components-TopicContainer-TopicContainer-stories.9cf5d02d.iframe.bundle.js index 4aa6adb69..eb003a6db 100644 --- a/storybook/components-TopicContainer-TopicContainer-stories.85895207.iframe.bundle.js +++ b/storybook/components-TopicContainer-TopicContainer-stories.9cf5d02d.iframe.bundle.js @@ -1 +1 @@ -"use strict";(self.webpackChunkddangkong_frontend=self.webpackChunkddangkong_frontend||[]).push([[89],{"./src/components/TopicContainer/TopicContainer.stories.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{__namedExportsOrder:()=>__namedExportsOrder,default:()=>__WEBPACK_DEFAULT_EXPORT__,기본_카테고리_및_질문:()=>기본_카테고리_및_질문});const __WEBPACK_DEFAULT_EXPORT__={title:"TopicContainer",component:__webpack_require__("./src/components/TopicContainer/TopicContainer.tsx").A},기본_카테고리_및_질문={},__namedExportsOrder=["기본_카테고리_및_질문"];기본_카테고리_및_질문.parameters={...기본_카테고리_및_질문.parameters,docs:{...기본_카테고리_및_질문.parameters?.docs,source:{originalSource:"{}",...기본_카테고리_및_질문.parameters?.docs?.source}}}},"./src/apis/balanceContent.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Gd:()=>fetchBalanceContent,O:()=>fetchRoundVoteResult,bR:()=>checkMyGameStatus,jd:()=>fetchVoteIsFinished,sl:()=>voteBalanceContent});var _fetcher__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./src/apis/fetcher.ts"),_constants_url__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/constants/url.ts");const fetchBalanceContent=async roomId=>{const res=await _fetcher__WEBPACK_IMPORTED_MODULE_0__.A.get({url:_constants_url__WEBPACK_IMPORTED_MODULE_1__.H$.balanceContent(roomId)});return await res.json()},voteBalanceContent=async({optionId,contentId,roomId,memberId})=>{const res=await _fetcher__WEBPACK_IMPORTED_MODULE_0__.A.post({url:_constants_url__WEBPACK_IMPORTED_MODULE_1__.H$.vote(roomId,contentId),headers:{"Content-Type":"application/json"},body:{memberId,optionId}});return await res.json()},fetchRoundVoteResult=async({contentId,roomId})=>{const res=await _fetcher__WEBPACK_IMPORTED_MODULE_0__.A.get({url:_constants_url__WEBPACK_IMPORTED_MODULE_1__.H$.roundVoteResult(roomId,contentId)});return await res.json()},checkMyGameStatus=async({roomId,currentRound})=>{const res=await _fetcher__WEBPACK_IMPORTED_MODULE_0__.A.get({url:_constants_url__WEBPACK_IMPORTED_MODULE_1__.H$.myGameStatus(roomId,currentRound),headers:{"Content-Type":"application/json"}});return await res.json()},fetchVoteIsFinished=async({contentId,roomId})=>{const res=await _fetcher__WEBPACK_IMPORTED_MODULE_0__.A.get({url:_constants_url__WEBPACK_IMPORTED_MODULE_1__.H$.voteIsFinished(roomId,contentId)});return await res.json()}},"./src/apis/fetcher.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>apis_fetcher});const ERROR_MESSAGE={NOT_READY_ROOM:"해당 방의 게임이 이미 시작되었어요. 게임이 끝날 때까지 기다려볼까요?",NOT_PROGRESSED_ROOM:"이미 게임이 종료되었어요. 최종 결과를 확인해볼까요?",NOT_FINISHED_ROOM:"해당 방의 게임이 아직 종료되지 않았어요.",NOT_FOUND_ROOM:"해당 방을 찾을 수 없어요. 방을 새로 만들어주세요!",NOT_ROOM_MEMBER:"사용자가 해당 방에 존재하지 않아요. 다시 접속해볼까요?",EXCEED_MAX_MEMBER_COUNT:"방의 최대 인원을 초과했습니다.",ALREADY_EXIST_MASTER:"이미 방장이 존재합니다.",ALREADY_MASTER:"해당 멤버는 이미 방장입니다.",INVALID_MASTER_CREATION:"방에 멤버가 존재하면 방장을 생성할 수 없습니다.",NOT_EXIST_MASTER:"방장이 존재하지 않습니다.",NOT_EXIST_COMMON:"일반 멤버가 존재하지 않습니다.",INVALID_TIME_LIMIT:"타이머는 10초, 15초, 30초, 60초로만 설정 가능합니다.",INVALID_RANGE_TOTAL_ROUND:"총 라운드는 5, 7, 10 라운드로만 설정 가능합니다.",EMPTY_VOTE_DEADLINE:"라운드 종료 시간이 설정되지 않았습니다.",MISMATCH_ROUND:"이미 다음 라운드가 시작되었어요. 해당 라운드가 끝날 때까지 잠시만 기다려주세요!",ROUND_LESS_THAN_START_ROUND:"startRound보다 크거나 같아야 합니다.",ROUND_GREATER_THAN_CURRENT_ROUND:"currentRound보다 작거나 같아야 합니다.",INVALID_ROUND_GAP:"currentRound과 round의 차이는 ?이하여야 합니다.",NOT_FOUND_BALANCE_CONTENT:"존재하지 않는 컨텐츠네요. 게임을 다시 진행해주세요!",NOT_FOUND_ROOM_CONTENT:"해당 방에 존재하지 않은 컨텐츠입니다. 게임을 다시 진행해주세요!",NO_RESOURCE_FOUND:"요청한 리소스를 찾을 수 없습니다. 게임을 다시 진행해주세요!",NOT_FOUND_BALANCE_OPTION:"옵션을 올바르게 선택해주세요.",ALREADY_VOTED:"이미 투표가 반영되었어요. 해당 라운드가 끝날 때까지 기다려볼까요?",VOTE_FINISHED:"투표가 이미 종료되었어요.",VOTE_NOT_FINISHED:"이미 다음 라운드가 시작되었어요. 해당 라운드가 끝날 때까지 잠시만 기다려주세요!",CAN_NOT_CHECK_MATCHING_PERCENT:"종료되지 않은 방의 투표 매칭도는 확인할 수 없습니다.",FIELD_ERROR:"필드값 입력이 잘못되었습니다.",URL_PARAMETER_ERROR:"URL parameter 입력이 잘못되었습니다.",METHOD_ARGUMENT_TYPE_MISMATCH:"입력한 값의 타입이 잘못되었습니다.",METHOD_NOT_SUPPORTED:"허용되지 않은 메서드입니다.",INTERNAL_SERVER_ERROR:"서버에 오류가 발생했어요. 다시 시도해 주세요!",NOT_FOUND_COOKIE:"사용자 정보가 있어야 방에 참여할 수 있어요. 홈화면으로 이동하여 방을 새로 만들어주세요!",INVALID_COOKIE:"사용자 정보가 있어야 방에 참여할 수 있어요. 홈화면으로 이동하여 방을 새로 만들어주세요!"};class CustomError extends Error{constructor({errorCode,status}){super(),this.errorCode=errorCode,this.message=ERROR_MESSAGE[errorCode],this.status=status}}class NetworkError extends Error{status=555;message="네트워크가 불안정해요. 다시 시도해주세요!"}const apis_fetcher={async request({url,method,body,headers}){try{const response=await fetch(url,{method,body:body&&JSON.stringify(body),headers:headers&&headers});if(!response.ok){const apiError=await response.json();throw new CustomError({...apiError,status:response.status})}return response}catch(error){if(error instanceof CustomError)throw error;throw new NetworkError}},get({url,headers}){return this.request({url,method:"GET",headers})},post({url,body,headers}){return this.request({url,method:"POST",body,headers})},delete({url,headers}){return this.request({url,method:"DELETE",headers})},patch({url,body,headers}){return this.request({url,method:"PATCH",body,headers})},put({url,headers}){return this.request({url,method:"PUT",headers})}}},"./src/components/TopicContainer/TopicContainer.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>TopicContainer_TopicContainer});var dist=__webpack_require__("./node_modules/react-router/dist/index.js"),emotion_react_browser_esm=__webpack_require__("./node_modules/@emotion/react/dist/emotion-react.browser.esm.js");const topicContainerLayout={name:"1u3km2u",styles:"display:flex;flex-basis:20%;flex-direction:column;justify-content:center;align-items:center;gap:2rem"},categoryText={name:"ywz92v",styles:"font-weight:bold;font-size:1.2rem"};var _ref={name:"13siumc",styles:"width:85%;text-align:center;word-break:keep-all"};const topicText=isGamePage=>(0,emotion_react_browser_esm.AH)("font-weight:bold;font-size:1.6rem;line-height:2rem;",!isGamePage&&_ref,";","");var A11yOnly=__webpack_require__("./src/components/common/a11yOnly/A11yOnly.tsx"),routes=__webpack_require__("./src/constants/routes.ts"),useBalanceContentQuery=__webpack_require__("./src/hooks/useBalanceContentQuery.ts"),emotion_react_jsx_runtime_browser_esm=__webpack_require__("./node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js");const TopicContainer=()=>{const location=(0,dist.zy)(),{roomId}=(0,dist.g)(),{balanceContent}=(0,useBalanceContentQuery.A)(Number(roomId)),isGamePage=location.pathname===routes.b.game(Number(roomId)),screenReaderQuestion=`질문. ${balanceContent.question}.`;return(0,emotion_react_jsx_runtime_browser_esm.FD)("section",{css:topicContainerLayout,children:[(0,emotion_react_jsx_runtime_browser_esm.Y)(A11yOnly.A,{children:screenReaderQuestion}),(0,emotion_react_jsx_runtime_browser_esm.Y)("span",{css:categoryText,"aria-hidden":!0,children:isGamePage&&balanceContent.category}),(0,emotion_react_jsx_runtime_browser_esm.Y)("span",{css:topicText(isGamePage),"aria-hidden":!0,children:balanceContent.question})]})},TopicContainer_TopicContainer=TopicContainer;TopicContainer.__docgenInfo={description:"",methods:[],displayName:"TopicContainer"}},"./src/components/common/a11yOnly/A11yOnly.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>a11yOnly_A11yOnly});const a11yOnlyLayout={name:"90pyz3",styles:"overflow:hidden;position:absolute;width:1px;height:1px;margin:-1px;padding:0;border:0;white-space:nowrap;clip:rect(0, 0, 0, 0)"};var emotion_react_jsx_runtime_browser_esm=__webpack_require__("./node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js");const A11yOnly=({as,role="text",children,...props})=>{const Component=as||"span";return(0,emotion_react_jsx_runtime_browser_esm.Y)(Component,{css:a11yOnlyLayout,role,...props,children})},a11yOnly_A11yOnly=A11yOnly;A11yOnly.__docgenInfo={description:"",methods:[],displayName:"A11yOnly",props:{as:{required:!1,tsType:{name:"T"},description:""},role:{required:!1,tsType:{name:"AriaRole"},description:"",defaultValue:{value:"'text'",computed:!1}}}}},"./src/constants/queryKeys.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{e:()=>QUERY_KEYS});const QUERY_KEYS={balanceContent:"balanceContent",matchingResult:"matchingResult",roundVoteResult:"roundVoteResult",myGameStatus:"myGameStatus",roundIsFinished:"roundIsFinished",roomMembers:"roomMembers",isRoomInitial:"isRoomInitial",categoryList:"categoryList"}},"./src/constants/routes.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{b:()=>ROUTES});const ROUTES={main:"/",nickname:"/nickname",ready:roomId=>`/${roomId}/ready`,game:roomId=>`/${roomId}/game`,roundResult:roomId=>`/${roomId}/round/result`,roundResultVote:"/round/result/vote",gameResult:roomId=>`/${roomId}/game/result`,roundResultStatus:roomId=>`/${roomId}/round/result/status`}},"./src/hooks/useBalanceContentQuery.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>__WEBPACK_DEFAULT_EXPORT__});var _tanstack_react_query__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/@tanstack/react-query/build/modern/useSuspenseQuery.js"),_apis_balanceContent__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./src/apis/balanceContent.ts"),_constants_queryKeys__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/constants/queryKeys.ts");const __WEBPACK_DEFAULT_EXPORT__=roomId=>{const balanceContentQuery=(0,_tanstack_react_query__WEBPACK_IMPORTED_MODULE_2__.U)({queryKey:[_constants_queryKeys__WEBPACK_IMPORTED_MODULE_1__.e.balanceContent,Number(roomId)],queryFn:async()=>await(0,_apis_balanceContent__WEBPACK_IMPORTED_MODULE_0__.Gd)(Number(roomId))});return{...balanceContentQuery,balanceContent:balanceContentQuery.data}}}}]); \ No newline at end of file +"use strict";(self.webpackChunkddangkong_frontend=self.webpackChunkddangkong_frontend||[]).push([[89],{"./src/components/TopicContainer/TopicContainer.stories.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{__namedExportsOrder:()=>__namedExportsOrder,default:()=>__WEBPACK_DEFAULT_EXPORT__,기본_카테고리_및_질문:()=>기본_카테고리_및_질문});const __WEBPACK_DEFAULT_EXPORT__={title:"TopicContainer",component:__webpack_require__("./src/components/TopicContainer/TopicContainer.tsx").A},기본_카테고리_및_질문={},__namedExportsOrder=["기본_카테고리_및_질문"];기본_카테고리_및_질문.parameters={...기본_카테고리_및_질문.parameters,docs:{...기본_카테고리_및_질문.parameters?.docs,source:{originalSource:"{}",...기본_카테고리_및_질문.parameters?.docs?.source}}}},"./src/apis/balanceContent.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Gd:()=>fetchBalanceContent,O:()=>fetchRoundVoteResult,bR:()=>checkMyGameStatus,jd:()=>fetchVoteIsFinished,sl:()=>voteBalanceContent});var _fetcher__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./src/apis/fetcher.ts"),_constants_url__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/constants/url.ts");const fetchBalanceContent=async roomId=>{const res=await _fetcher__WEBPACK_IMPORTED_MODULE_0__.A.get({url:_constants_url__WEBPACK_IMPORTED_MODULE_1__.H$.balanceContent(roomId)});return await res.json()},voteBalanceContent=async({optionId,contentId,roomId,memberId})=>{const res=await _fetcher__WEBPACK_IMPORTED_MODULE_0__.A.post({url:_constants_url__WEBPACK_IMPORTED_MODULE_1__.H$.vote(roomId,contentId),headers:{"Content-Type":"application/json"},body:{memberId,optionId}});return await res.json()},fetchRoundVoteResult=async({contentId,roomId})=>{const res=await _fetcher__WEBPACK_IMPORTED_MODULE_0__.A.get({url:_constants_url__WEBPACK_IMPORTED_MODULE_1__.H$.roundVoteResult(roomId,contentId)});return await res.json()},checkMyGameStatus=async({roomId,currentRound})=>{const res=await _fetcher__WEBPACK_IMPORTED_MODULE_0__.A.get({url:_constants_url__WEBPACK_IMPORTED_MODULE_1__.H$.myGameStatus(roomId,currentRound),headers:{"Content-Type":"application/json"}});return await res.json()},fetchVoteIsFinished=async({contentId,roomId})=>{const res=await _fetcher__WEBPACK_IMPORTED_MODULE_0__.A.get({url:_constants_url__WEBPACK_IMPORTED_MODULE_1__.H$.voteIsFinished(roomId,contentId)});return await res.json()}},"./src/apis/fetcher.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>apis_fetcher});const ERROR_MESSAGE={NOT_READY_ROOM:"해당 방의 게임이 이미 시작되었어요. 게임이 끝날 때까지 기다려볼까요?",NOT_PROGRESSED_ROOM:"이미 게임이 종료되었어요. 최종 결과를 확인해볼까요?",NOT_FINISHED_ROOM:"해당 방의 게임이 아직 종료되지 않았어요.",NOT_FOUND_ROOM:"해당 방을 찾을 수 없어요. 방을 새로 만들어주세요!",NOT_ROOM_MEMBER:"사용자가 해당 방에 존재하지 않아요. 다시 접속해볼까요?",EXCEED_MAX_MEMBER_COUNT:"방의 최대 인원을 초과했습니다.",ALREADY_EXIST_MASTER:"이미 방장이 존재합니다.",ALREADY_MASTER:"해당 멤버는 이미 방장입니다.",INVALID_MASTER_CREATION:"방에 멤버가 존재하면 방장을 생성할 수 없습니다.",NOT_EXIST_MASTER:"방장이 존재하지 않습니다.",NOT_EXIST_COMMON:"일반 멤버가 존재하지 않습니다.",INVALID_TIME_LIMIT:"타이머는 10초, 15초, 30초, 60초로만 설정 가능합니다.",INVALID_RANGE_TOTAL_ROUND:"총 라운드는 5, 7, 10 라운드로만 설정 가능합니다.",EMPTY_VOTE_DEADLINE:"라운드 종료 시간이 설정되지 않았습니다.",MISMATCH_ROUND:"이미 다음 라운드가 시작되었어요. 해당 라운드가 끝날 때까지 잠시만 기다려주세요!",ROUND_LESS_THAN_START_ROUND:"startRound보다 크거나 같아야 합니다.",ROUND_GREATER_THAN_CURRENT_ROUND:"currentRound보다 작거나 같아야 합니다.",INVALID_ROUND_GAP:"currentRound과 round의 차이는 ?이하여야 합니다.",NOT_FOUND_BALANCE_CONTENT:"존재하지 않는 컨텐츠네요. 게임을 다시 진행해주세요!",NOT_FOUND_ROOM_CONTENT:"해당 방에 존재하지 않은 컨텐츠입니다. 게임을 다시 진행해주세요!",NO_RESOURCE_FOUND:"요청한 리소스를 찾을 수 없습니다. 게임을 다시 진행해주세요!",NOT_FOUND_BALANCE_OPTION:"옵션을 올바르게 선택해주세요.",ALREADY_VOTED:"이미 투표가 반영되었어요. 해당 라운드가 끝날 때까지 기다려볼까요?",VOTE_FINISHED:"투표가 이미 종료되었어요.",VOTE_NOT_FINISHED:"이미 다음 라운드가 시작되었어요. 해당 라운드가 끝날 때까지 잠시만 기다려주세요!",CAN_NOT_CHECK_MATCHING_PERCENT:"종료되지 않은 방의 투표 매칭도는 확인할 수 없습니다.",FIELD_ERROR:"필드값 입력이 잘못되었습니다.",URL_PARAMETER_ERROR:"URL parameter 입력이 잘못되었습니다.",METHOD_ARGUMENT_TYPE_MISMATCH:"입력한 값의 타입이 잘못되었습니다.",METHOD_NOT_SUPPORTED:"허용되지 않은 메서드입니다.",INTERNAL_SERVER_ERROR:"서버에 오류가 발생했어요. 다시 시도해 주세요!",NOT_FOUND_COOKIE:"사용자 정보가 있어야 방에 참여할 수 있어요. 홈화면으로 이동하여 방을 새로 만들어주세요!",INVALID_COOKIE:"사용자 정보가 있어야 방에 참여할 수 있어요. 홈화면으로 이동하여 방을 새로 만들어주세요!"};class CustomError extends Error{constructor({errorCode,status}){super(),this.errorCode=errorCode,this.message=ERROR_MESSAGE[errorCode],this.status=status}}class NetworkError extends Error{status=555;message="네트워크가 불안정해요. 다시 시도해주세요!"}const apis_fetcher={async request({url,method,body,headers}){try{const response=await fetch(url,{method,body:body&&JSON.stringify(body),headers:headers&&headers});if(!response.ok){const apiError=await response.json();throw new CustomError({...apiError,status:response.status})}return response}catch(error){if(error instanceof CustomError)throw error;throw new NetworkError}},get({url,headers}){return this.request({url,method:"GET",headers})},post({url,body,headers}){return this.request({url,method:"POST",body,headers})},delete({url,headers}){return this.request({url,method:"DELETE",headers})},patch({url,body,headers}){return this.request({url,method:"PATCH",body,headers})},put({url,headers}){return this.request({url,method:"PUT",headers})}}},"./src/components/TopicContainer/TopicContainer.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>TopicContainer_TopicContainer});var dist=__webpack_require__("./node_modules/react-router/dist/index.js");const topicContainerLayout={name:"1u3km2u",styles:"display:flex;flex-basis:20%;flex-direction:column;justify-content:center;align-items:center;gap:2rem"},categoryText={name:"ywz92v",styles:"font-weight:bold;font-size:1.2rem"},topicText={name:"1akzvke",styles:"font-weight:bold;font-size:1.6rem"};var A11yOnly=__webpack_require__("./src/components/common/a11yOnly/A11yOnly.tsx"),routes=__webpack_require__("./src/constants/routes.ts"),useBalanceContentQuery=__webpack_require__("./src/hooks/useBalanceContentQuery.ts"),emotion_react_jsx_runtime_browser_esm=__webpack_require__("./node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js");const TopicContainer=()=>{const location=(0,dist.zy)(),{roomId}=(0,dist.g)(),{balanceContent}=(0,useBalanceContentQuery.A)(Number(roomId)),isGamePage=location.pathname===routes.b.game(Number(roomId)),screenReaderQuestion=`질문. ${balanceContent.question}.`;return(0,emotion_react_jsx_runtime_browser_esm.FD)("section",{css:topicContainerLayout,children:[(0,emotion_react_jsx_runtime_browser_esm.Y)(A11yOnly.A,{children:screenReaderQuestion}),(0,emotion_react_jsx_runtime_browser_esm.Y)("span",{css:categoryText,"aria-hidden":!0,children:isGamePage&&balanceContent.category}),(0,emotion_react_jsx_runtime_browser_esm.Y)("span",{css:topicText,"aria-hidden":!0,children:balanceContent.question})]})},TopicContainer_TopicContainer=TopicContainer;TopicContainer.__docgenInfo={description:"",methods:[],displayName:"TopicContainer"}},"./src/components/common/a11yOnly/A11yOnly.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>a11yOnly_A11yOnly});const a11yOnlyLayout={name:"90pyz3",styles:"overflow:hidden;position:absolute;width:1px;height:1px;margin:-1px;padding:0;border:0;white-space:nowrap;clip:rect(0, 0, 0, 0)"};var emotion_react_jsx_runtime_browser_esm=__webpack_require__("./node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js");const A11yOnly=({as,children,...props})=>{const Component=as||"span";return(0,emotion_react_jsx_runtime_browser_esm.Y)(Component,{css:a11yOnlyLayout,...props,children})},a11yOnly_A11yOnly=A11yOnly;A11yOnly.__docgenInfo={description:"",methods:[],displayName:"A11yOnly",props:{as:{required:!1,tsType:{name:"T"},description:""},role:{required:!1,tsType:{name:"AriaRole"},description:""}}}},"./src/constants/queryKeys.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{e:()=>QUERY_KEYS});const QUERY_KEYS={balanceContent:"balanceContent",matchingResult:"matchingResult",roundVoteResult:"roundVoteResult",myGameStatus:"myGameStatus",roundIsFinished:"roundIsFinished",roomMembers:"roomMembers",isRoomInitial:"isRoomInitial",categoryList:"categoryList"}},"./src/constants/routes.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{b:()=>ROUTES});const ROUTES={main:"/",nickname:"/nickname",ready:roomId=>`/${roomId}/ready`,game:roomId=>`/${roomId}/game`,roundResult:roomId=>`/${roomId}/round/result`,roundResultVote:"/round/result/vote",gameResult:roomId=>`/${roomId}/game/result`,roundResultStatus:roomId=>`/${roomId}/round/result/status`}},"./src/hooks/useBalanceContentQuery.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>__WEBPACK_DEFAULT_EXPORT__});var _tanstack_react_query__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/@tanstack/react-query/build/modern/useSuspenseQuery.js"),_apis_balanceContent__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./src/apis/balanceContent.ts"),_constants_queryKeys__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/constants/queryKeys.ts");const __WEBPACK_DEFAULT_EXPORT__=roomId=>{const balanceContentQuery=(0,_tanstack_react_query__WEBPACK_IMPORTED_MODULE_2__.U)({queryKey:[_constants_queryKeys__WEBPACK_IMPORTED_MODULE_1__.e.balanceContent,Number(roomId)],queryFn:async()=>await(0,_apis_balanceContent__WEBPACK_IMPORTED_MODULE_0__.Gd)(Number(roomId))});return{...balanceContentQuery,balanceContent:balanceContentQuery.data}}}}]); \ No newline at end of file diff --git a/storybook/components-common-Spinner-Spinner-stories.881eea26.iframe.bundle.js b/storybook/components-common-Spinner-Spinner-stories.881eea26.iframe.bundle.js deleted file mode 100644 index 5177f55dd..000000000 --- a/storybook/components-common-Spinner-Spinner-stories.881eea26.iframe.bundle.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkddangkong_frontend=self.webpackChunkddangkong_frontend||[]).push([[827],{"./src/components/common/Spinner/Spinner.stories.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{__namedExportsOrder:()=>__namedExportsOrder,default:()=>Spinner_stories,기본_스피너:()=>기본_스피너});var emotion_react_browser_esm=__webpack_require__("./node_modules/@emotion/react/dist/emotion-react.browser.esm.js");const spinnerWrapper={name:"1342lff",styles:"display:flex;flex-direction:column;justify-content:center;align-items:center;gap:3rem;margin-top:6.5rem"},spinnerText={name:"tfd1mi",styles:"margin-top:1.6rem;font-size:1.8rem;text-align:center"};var spinDdangkong=__webpack_require__("./src/assets/images/spinDdangkong.webp"),emotion_react_jsx_runtime_browser_esm=__webpack_require__("./node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js");const Spinner=({message="로딩 중입니다...",imageSrc=spinDdangkong,imageSize=12})=>{return(0,emotion_react_jsx_runtime_browser_esm.FD)("div",{css:spinnerWrapper,children:[(0,emotion_react_jsx_runtime_browser_esm.Y)("img",{src:imageSrc,alt:"로딩 중...",css:(size=imageSize,(0,emotion_react_browser_esm.AH)("width:",size,"rem;height:18rem;animation:spin 2s linear infinite;@keyframes spin{0%{transform:rotate(0deg);}100%{transform:rotate(360deg);}}",""))}),(0,emotion_react_jsx_runtime_browser_esm.Y)("span",{css:spinnerText,children:message})]});var size},Spinner_Spinner=Spinner;Spinner.__docgenInfo={description:"",methods:[],displayName:"Spinner",props:{message:{required:!1,tsType:{name:"string"},description:"",defaultValue:{value:"'로딩 중입니다...'",computed:!1}},imageSrc:{required:!1,tsType:{name:"string"},description:"",defaultValue:{value:"SpinDdangKong",computed:!0}},imageSize:{required:!1,tsType:{name:"number"},description:"",defaultValue:{value:"12",computed:!1}}}};const 기본_스피너={},Spinner_stories={title:"Spinner",component:Spinner_Spinner},__namedExportsOrder=["기본_스피너"];기본_스피너.parameters={...기본_스피너.parameters,docs:{...기본_스피너.parameters?.docs,source:{originalSource:"{}",...기본_스피너.parameters?.docs?.source}}}},"./src/assets/images/spinDdangkong.webp":(module,__unused_webpack_exports,__webpack_require__)=>{module.exports=__webpack_require__.p+"static/media/spinDdangkong.f92ff614.webp"}}]); \ No newline at end of file diff --git a/storybook/components-common-Spinner-Spinner-stories.d7a81732.iframe.bundle.js b/storybook/components-common-Spinner-Spinner-stories.d7a81732.iframe.bundle.js new file mode 100644 index 000000000..22db13581 --- /dev/null +++ b/storybook/components-common-Spinner-Spinner-stories.d7a81732.iframe.bundle.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkddangkong_frontend=self.webpackChunkddangkong_frontend||[]).push([[827],{"./src/components/common/Spinner/Spinner.stories.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{__namedExportsOrder:()=>__namedExportsOrder,default:()=>Spinner_stories,기본_스피너:()=>기본_스피너});var emotion_react_browser_esm=__webpack_require__("./node_modules/@emotion/react/dist/emotion-react.browser.esm.js");const spinnerWrapper={name:"1342lff",styles:"display:flex;flex-direction:column;justify-content:center;align-items:center;gap:3rem;margin-top:6.5rem"},spinnerText={name:"tfd1mi",styles:"margin-top:1.6rem;font-size:1.8rem;text-align:center"};var spinDdangkong=__webpack_require__("./src/assets/images/spinDdangkong.webp"),emotion_react_jsx_runtime_browser_esm=__webpack_require__("./node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js");const Spinner=({message="로딩 중입니다...",imageSrc=spinDdangkong,imageSize=9})=>{return(0,emotion_react_jsx_runtime_browser_esm.FD)("div",{css:spinnerWrapper,children:[(0,emotion_react_jsx_runtime_browser_esm.Y)("img",{src:imageSrc,alt:"로딩 중...",css:(size=imageSize,(0,emotion_react_browser_esm.AH)("width:",size,"rem;height:20vh;animation:spin 2s linear infinite;@keyframes spin{0%{transform:rotate(0deg);}100%{transform:rotate(360deg);}}",""))}),(0,emotion_react_jsx_runtime_browser_esm.Y)("span",{css:spinnerText,children:message})]});var size},Spinner_Spinner=Spinner;Spinner.__docgenInfo={description:"",methods:[],displayName:"Spinner",props:{message:{required:!1,tsType:{name:"string"},description:"",defaultValue:{value:"'로딩 중입니다...'",computed:!1}},imageSrc:{required:!1,tsType:{name:"string"},description:"",defaultValue:{value:"SpinDdangKong",computed:!0}},imageSize:{required:!1,tsType:{name:"number"},description:"",defaultValue:{value:"9",computed:!1}}}};const 기본_스피너={},Spinner_stories={title:"Spinner",component:Spinner_Spinner},__namedExportsOrder=["기본_스피너"];기본_스피너.parameters={...기본_스피너.parameters,docs:{...기본_스피너.parameters?.docs,source:{originalSource:"{}",...기본_스피너.parameters?.docs?.source}}}},"./src/assets/images/spinDdangkong.webp":(module,__unused_webpack_exports,__webpack_require__)=>{module.exports=__webpack_require__.p+"static/media/spinDdangkong.f92ff614.webp"}}]); \ No newline at end of file diff --git a/storybook/iframe.html b/storybook/iframe.html index 5e73cd362..a8e0dc72c 100644 --- a/storybook/iframe.html +++ b/storybook/iframe.html @@ -504,7 +504,7 @@ window['TAGS_OPTIONS'] = {"dev-only":{"excludeFromDocsStories":true},"docs-only":{"excludeFromSidebar":true},"test-only":{"excludeFromSidebar":true,"excludeFromDocsStories":true}};