From 28b34dbd278d8e69325de112a61cbed8619f9907 Mon Sep 17 00:00:00 2001 From: G-hoon Date: Tue, 24 Sep 2024 02:50:58 +0900 Subject: [PATCH] =?UTF-8?q?[feat/#58]=20=EB=8C=80=EC=8B=9C=EB=B3=B4?= =?UTF-8?q?=EB=93=9C=20=EB=94=94=EC=9E=90=EC=9D=B8=20=EC=A0=95=ED=95=A9?= =?UTF-8?q?=EC=84=B1=20QA=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 자세분석 카드 사이즈 변경 - 기간별 추이 텍스트 추가 --- src/pages/AnalysisDashboard.tsx | 54 ++++++++++++++++++++++----------- 1 file changed, 36 insertions(+), 18 deletions(-) diff --git a/src/pages/AnalysisDashboard.tsx b/src/pages/AnalysisDashboard.tsx index 11b9a5f..cd9a0aa 100644 --- a/src/pages/AnalysisDashboard.tsx +++ b/src/pages/AnalysisDashboard.tsx @@ -22,8 +22,21 @@ const AnalysisDashboard = () => { endDate: null, }) + const [isLargeViewport, setIsLargeViewport] = useState(false) + const { todayAnalysis, totalAnalysis, isLoading, isError } = usePoseAnalysis(dateRange) + useEffect(() => { + const checkViewportSize = () => { + setIsLargeViewport(window.innerWidth >= 1560) + } + + checkViewportSize() // 초기 체크 + window.addEventListener("resize", checkViewportSize) + + return () => window.removeEventListener("resize", checkViewportSize) + }, []) + console.log("totalAnalysis: ", dateRange) const getPoseCount = (type: poseType) => { @@ -61,19 +74,21 @@ const AnalysisDashboard = () => {
@@ -84,24 +99,26 @@ const AnalysisDashboard = () => { {isError &&
데이터를 불러오는 것에 실패했습니다
} {!isLoading && !isError && todayAnalysis && ( -
+
{/* 고정된 전체 틀어짐 횟수 카드 */} -
-

전체 틀어짐 횟수

-
- {totalCount} - -
-
- +
+
+

전체 자세 경고 횟수

+
+ {totalCount} + +
+
+ +
{/* 캐러셀 컨테이너 */}
{/* 왼쪽 그라디언트 */} - {currentIndex > 0 && ( + {!isLargeViewport && currentIndex > 0 && (
)} @@ -109,10 +126,10 @@ const AnalysisDashboard = () => {
{carouselItems.map(({ title, type, image }, index) => ( -
+
{title}
@@ -128,7 +145,7 @@ const AnalysisDashboard = () => {
{/* 오른쪽 그라디언트 */} - {currentIndex < 1 && ( + {!isLargeViewport && currentIndex < 1 && (
)}
@@ -139,7 +156,8 @@ const AnalysisDashboard = () => {
{/* 차트 섹션 */} -
+
+ 기간별 자세 추이