diff --git a/src/components/common/PopupMessage.tsx b/src/components/common/PopupMessage.tsx index a90d5f2..e333d67 100644 --- a/src/components/common/PopupMessage.tsx +++ b/src/components/common/PopupMessage.tsx @@ -19,7 +19,7 @@ const PopupMessage = () => { { - return element; + return element || <>; }} open={isPopupShow} onClose={() => { diff --git a/src/pages/record/EditRecordPage.tsx b/src/pages/record/EditRecordPage.tsx index 92176b4..b76ec0b 100644 --- a/src/pages/record/EditRecordPage.tsx +++ b/src/pages/record/EditRecordPage.tsx @@ -539,6 +539,7 @@ const EditRecordPage = (): ReactElement => { setPopupText('서버에 오류가 발생했습니다. 다시 시도 해주세요.'); }); } + /** * update event record * @param startedAt start time diff --git a/src/pages/settings/SettingsPage.tsx b/src/pages/settings/SettingsPage.tsx index 89a767a..e5448cb 100644 --- a/src/pages/settings/SettingsPage.tsx +++ b/src/pages/settings/SettingsPage.tsx @@ -2,6 +2,7 @@ import { Box, Button, + Container, List, ListItemButton, ListItemText, @@ -27,6 +28,7 @@ import { useModalCommon } from '@/hooks/modalCommon'; import Wrapper from '../auth/common/Wrapper'; import { currentUserInfo } from '@/store/info'; import { UserModeList } from '../category/CategoryPage'; +import CommonHeader from '@/components/layout/CommonHeader'; const SettingPage = () => { const navigation = useNavigate(); @@ -121,9 +123,9 @@ const SettingPage = () => { * @returns */ const getUserNickname = () => { - const type = UserModeList.filter( - (mode) => mode.type === userInfo.templateType, - )[0]?.name || 'TEST ACCOUNT'; + const type = + UserModeList.filter((mode) => mode.type === userInfo.templateType)[0] + ?.name || 'TEST ACCOUNT'; return `#${type} ${userInfo.nickname}님`; }; @@ -133,116 +135,160 @@ const SettingPage = () => { }); return ( - - - - - {getListSubHeader('커스텀화')} - {getListItem({ - text: '모드 및 카테고리 설정', - handler: () => { - setCategoryMode('MODEVISIBLE'); - navigation('/category'); - }, - })} + + + } + > + {/* */} + {/* */} + + {getListSubHeader('커스텀화')} + {getListItem({ + text: '모드 및 카테고리 설정', + handler: () => { + setCategoryMode('MODEVISIBLE'); + navigation('/category'); + }, + })} - {getListSubHeader('고객 센터')} - {getListItem({ - text: 'FAQ', - handler: () => navigation('/settings/faq'), - })} + {getListSubHeader('고객 센터')} + {getListItem({ + text: 'FAQ', + handler: () => navigation('/settings/faq'), + })} - {getListSubHeader('계정')} - {getListItem({ - text: '비밀번호 변경', - handler: () => navigation('/resetPW'), - })} - {getListItem({ - text: '로그아웃', - handler: async () => { - setModalInfo({ - ...modalInfo, - open: true, - title: '로그아웃', - msg: '로그아웃 하시겠습니까?', - optionList: null, - btn1Text: modalAnswer.no, - btn1ClickHandler: closeModal, - btn2Text: modalAnswer.yes, - btn2ClickHandler: logoutClickHandler, - }); - return true; - }, - })} - - - + {'회원 탈퇴'} + + + {/* */} ); }; diff --git a/src/pages/statistics/ChartContainer.tsx b/src/pages/statistics/ChartContainer.tsx index 0a847e0..7a3e239 100644 --- a/src/pages/statistics/ChartContainer.tsx +++ b/src/pages/statistics/ChartContainer.tsx @@ -423,112 +423,116 @@ const ChartContainer = () => { return ( <> {dataArray.length && - dataArray.map((data: any, idx) => ( - + dataArray.map((data: any, idx) => { + if (!data.timeSum) { + return ; + } + return ( - { - const subCategoryData = data.children; - const periodTypeTitle = periodTypeList!.filter( - (type) => type.id === periodType, - )[0].subTitle; - if (subCategoryData) { - setCategoryDetailData(subCategoryData); - setTotalSumTitle( - addPostposition( - `${periodTypeTitle} ${data.categoryName}`, - ), - ); - } else { - setCategoryDetailData(statisticsResult); - setTotalSumTitle(addPostposition(periodTypeTitle)); - setClickedIndex(-1); - } - setCategorySum( - () => - (subCategoryData - ? categoryDetailData - : statisticsResult - )?.reduce( - - (accu: number, curr: StatisticsDetail) => - accu + curr.timeSum, - 0, - ) | 0, - ); - }} - /> - { + const subCategoryData = data.children; + const periodTypeTitle = periodTypeList!.filter( + (type) => type.id === periodType, + )[0].subTitle; + if (subCategoryData) { + setCategoryDetailData(subCategoryData); + setTotalSumTitle( + addPostposition( + `${periodTypeTitle} ${data.categoryName}`, + ), + ); + } else { + setCategoryDetailData(statisticsResult); + setTotalSumTitle(addPostposition(periodTypeTitle)); + setClickedIndex(-1); + } + setCategorySum( + () => + (subCategoryData + ? categoryDetailData + : statisticsResult + )?.reduce( + (accu: number, curr: StatisticsDetail) => + accu + curr.timeSum, + 0, + ) | 0, + ); }} - > - {data.categoryName} - + /> - - .MuiLinearProgress-bar': { - backgroundColor: data.categoryColor, - borderRadius: 5, - }, - }} - /> + + {data.categoryName} + + + + .MuiLinearProgress-bar': { + backgroundColor: data.categoryColor, + borderRadius: 5, + }, + }} + /> + + + {setCategoryDetailDataTime(data.timeSum)} - - {setCategoryDetailDataTime(data.timeSum)} - - ))} + ); + })} ); }; @@ -578,10 +582,18 @@ const ChartContainer = () => { backgroundColor: palette.chart.customBackground, display: 'flex', flexDirection: 'column', - paddingBottom: '6vh', + // height: '100vh', + marginBottom: '6vh', + overflow: 'hidden' + }} > - + { )} - {!!totalSum && ( - - - - - + + {!!totalSum && ( + - - - )} - {!!!totalSum && ( - - - + + + + + + )} + {!!!totalSum && ( + + - {'아직 데이터가 없어요'} -
- {'기록을 남겨보세요 :)'} - -
-
- )} + + {'아직 데이터가 없어요'} +
+ {'기록을 남겨보세요 :)'} +
+
+ + )} +
{setCategoryDetailDataList(