Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 21 additions & 16 deletions app/(dashboard)/_ui/analysis-container/analysis-content.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,9 @@ const AnalysisContent = ({
}
}

if (analysisData?.content === null || analysisData?.content === undefined) return null

return (
<div className={cx('table-wrapper', 'analysis')}>
{!isEditable && (
{!isEditable && analysisData && (
<Button
onClick={handleDownload}
size="small"
Expand Down Expand Up @@ -149,19 +147,26 @@ const AnalysisContent = ({
</Button>
</div>
)}

<VerticalTable
tableHead={tableHeader}
tableBody={analysisData?.content}
currentPage={currentPage}
countPerPage={ANALYSIS_PAGE_COUNT}
isEditable={isEditable}
/>
<Pagination
currentPage={currentPage}
maxPage={analysisData?.totalPages}
onPageChange={onPageChange}
/>
{analysisData ? (
<>
<VerticalTable
tableHead={tableHeader}
tableBody={analysisData.content}
currentPage={1}
countPerPage={ANALYSIS_PAGE_COUNT}
isEditable={isEditable}
/>
<Pagination
currentPage={currentPage}
maxPage={analysisData.totalPages}
onPageChange={onPageChange}
/>
</>
) : (
<div className={cx('no-data')}>
<p>업데이트 된 분석 데이터가 없습니다.</p>
</div>
)}

{uploadType && (
<AnalysisUploadModal
Expand Down
16 changes: 9 additions & 7 deletions app/(dashboard)/_ui/analysis-container/statistics-content.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,17 @@ interface Props {
}

const StatisticsContent = ({ statisticsData }: Props) => {
if (statisticsData === null || statisticsData === undefined) return null

const statisticsDataToArray = Object.entries(statisticsData)

return (
<div className={cx('table-wrapper')}>
{statisticsDataToArray.map(([title, data]) => (
<StatisticsTable key={title} title={title} statisticsData={data} />
))}
{statisticsData ? (
Object.entries(statisticsData).map(([title, data]) => (
<StatisticsTable key={title} title={title} statisticsData={data} />
))
) : (
<div className={cx('no-data')}>
<p>업데이트 된 통계 데이터가 없습니다.</p>
</div>
)}
</div>
)
}
Expand Down
5 changes: 3 additions & 2 deletions app/(dashboard)/_ui/analysis-container/styles.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,10 @@
.no-data {
display: flex;
justify-content: center;
margin: 60px 0 40px;
margin-top: 80px;
color: $color-gray-600;
@include typo-b2;
height: 200px;
@include typo-b1;
}

.button-container {
Expand Down
1 change: 1 addition & 0 deletions app/(dashboard)/_ui/details-information/styles.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
width: 100%;
height: 100%;
border-right: 1px solid $color-gray-200;
padding-right: 4px;
&:last-child {
border-right: 0;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import getMyDailyAnalysis from '../../_api/get-my-daily-analysis'

const useGetAnalysis = (strategyId: number, page: number, size: number) => {
return useQuery({
queryKey: ['myDailyAnalysis', strategyId],
queryKey: ['myDailyAnalysis', strategyId, page],
queryFn: () => getMyDailyAnalysis(strategyId, page, size),
})
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import getAnalysis from '../../_api/get-analysis'

const useGetAnalysis = (strategyId: number, type: AnalysisTabType, page: number, size: number) => {
return useQuery({
queryKey: ['analysis', strategyId, type],
queryKey: ['analysis', strategyId, type, page],
queryFn: () => getAnalysis(strategyId, type, page, size),
})
}
Expand Down