diff --git a/src/components/Header.tsx b/src/components/Header.tsx index ab114d4..9e300f1 100644 --- a/src/components/Header.tsx +++ b/src/components/Header.tsx @@ -118,10 +118,7 @@ export default function Header({ className={`h-16 ${darkMode ? "invert" : ""}`} /> ) : ( -

+

{getPageTitle()}

)} diff --git a/src/components/common/GradientButton.tsx b/src/components/common/GradientButton.tsx index 5b7b6bd..0767618 100644 --- a/src/components/common/GradientButton.tsx +++ b/src/components/common/GradientButton.tsx @@ -8,12 +8,11 @@ type Props = { gradientTo?: string; textColor?: string; borderWidth?: number; - width?: number; - height?: number; borderRadius?: number; - fontSize?: number; className?: string; + buttonClassName?: string; disabled?: boolean; + fullWidth?: boolean; }; export default function GradientButton({ @@ -24,34 +23,30 @@ export default function GradientButton({ gradientTo = "#678BF7", textColor = "#FFFFFF", borderWidth = 3, - width = 40, - height = 12, borderRadius, - fontSize, className = "", + buttonClassName = "", disabled = false, + fullWidth = false, }: Props) { return ( - // 바깥 div: 그라데이션 배경 (테두리 역할)
- {/* 안쪽 버튼: 단색 배경 */} -
- - {/* 콘텐츠 */} -
- {isLoading ? ( -
-
-
- ) : ( - <> - {/* 공유 데이터 풀 정보 */} - {sharedPoolData && ( -
-
-

총 공유 데이터

- - D-{remainingDays} - -
- -
-
-
- {sharedPoolData.sharedPoolTotalData.toFixed(2)} GB -
- { - onClose(); - navigate("/log"); - }} - width={20} - height={8} - borderRadius={15} - > - clock - 사용 로그 - -
- -
-
- 기본 공유 -
- {sharedPoolData.sharedPoolBaseData.toFixed(2)} GB -
-
-
- 가족 추가 -
- {sharedPoolData.sharedPoolAdditionalData.toFixed(2)} GB -
-
-
-
- -
-
현재 사용량
-
-
-
-
- - 사용 {usedData.toFixed(2)}GB / 잔여 {sharedPoolData.sharedPoolRemainingData.toFixed(2)}GB - -
-
-
- )} - - {/* 가족 구성원 정보 */} - {familyData && ( -
-

가족 구성원

-
- {familyData.members.map((member) => { - const isOwner = member.role === "OWNER"; - - return ( -
-
- -
-
- {member.userName} - - {isOwner ? "대표자" : "구성원"} - -
-
{member.phone}
-
-
-
- ); - })} -
-
- )} - - )} -
-
-
- ); -} diff --git a/src/page/Admin/components/policy/BlockPolicyTab.tsx b/src/page/Admin/components/policy/BlockPolicyTab.tsx index b0f1e05..b278df6 100644 --- a/src/page/Admin/components/policy/BlockPolicyTab.tsx +++ b/src/page/Admin/components/policy/BlockPolicyTab.tsx @@ -9,13 +9,19 @@ type Props = { const BlockPolicyTab = ({ onBlockApply, lineId, onPolicyChange }: Props) => { if (!lineId) return null; - + return ( -
+
- + { + onBlockApply?.(blockEndAt); + onPolicyChange?.(); + }} + />
); }; -export default BlockPolicyTab; \ No newline at end of file +export default BlockPolicyTab; diff --git a/src/page/Admin/components/policy/LimitPolicyTab.tsx b/src/page/Admin/components/policy/LimitPolicyTab.tsx index 17b97fb..488b419 100644 --- a/src/page/Admin/components/policy/LimitPolicyTab.tsx +++ b/src/page/Admin/components/policy/LimitPolicyTab.tsx @@ -2,10 +2,10 @@ import { useQuery } from "@tanstack/react-query"; import SliderCard from "./SliderCard"; import { limitService } from "@/api"; -const LimitPolicyTab = ({ - lineId, - onPolicyChange -}: { +const LimitPolicyTab = ({ + lineId, + onPolicyChange, +}: { lineId?: number; onPolicyChange?: () => void; }) => { @@ -16,7 +16,7 @@ const LimitPolicyTab = ({ }); return ( -
+
- - - +
+ + + - - - + + + +
- - {isLoading ? "로그인 중..." : "로그인"} - + {isLoading ? "로그인 중..." : "로그인"}
diff --git a/src/page/Main/MainPage.tsx b/src/page/Main/MainPage.tsx index 357290b..94820d2 100644 --- a/src/page/Main/MainPage.tsx +++ b/src/page/Main/MainPage.tsx @@ -18,12 +18,14 @@ import { pageTransition, pageVariants, } from "@/utils/pageAnimation"; +import { usePieChartSize } from "@/hooks/usePieChartSize"; export default function Main() { const navigate = useNavigate(); const lineId = useUserStore((state) => state.userInfo?.lineId); // store에 저장된 user 정보 가져오기 const userData = useUserStore((state) => state.userInfo); + const { size: pieSize, strokeWidth: pieStrokeWidth } = usePieChartSize(); // 현재 로그인한 사용자가 대표자인가 const isOwner = userData?.role === "OWNER"; @@ -184,14 +186,23 @@ export default function Main() { transition={{ ...pageTransition, delay: 0.1 }} className="flex flex-col items-center gap-4 pt-5" > - + {" "} {/* 공유 데이터 담기 페이지 이동 버튼 */} - navigate("/shared-data")}> + navigate("/shared-data")} + > 가족 공유 데이터 담기 @@ -201,7 +212,7 @@ export default function Main() { diff --git a/src/page/Main/components/FamilyMemberList.tsx b/src/page/Main/components/FamilyMemberList.tsx index 00047ec..fbe9a05 100644 --- a/src/page/Main/components/FamilyMemberList.tsx +++ b/src/page/Main/components/FamilyMemberList.tsx @@ -35,19 +35,22 @@ export default function FamilyMemberList({ }); }); + // FamilyMemberList.tsx return (

가족 구성원

- {members.map((member) => ( - - ))} +
+ {members.map((member) => ( + + ))} +
); } diff --git a/src/page/Policy/Policy.tsx b/src/page/Policy/Policy.tsx index 2c93eb3..beac748 100644 --- a/src/page/Policy/Policy.tsx +++ b/src/page/Policy/Policy.tsx @@ -116,24 +116,27 @@ export default function Policy() { initial="initial" animate="animate" transition={pageTransition} - className="min-h-full flex flex-col gap-5 px-4 pb-[20px]" + className="min-h-full flex flex-col gap-5 px-4 pb-[20px] + tablet:grid tablet:grid-cols-2 tablet:items-start tablet:gap-6 tablet:px-8 + desktop:flex desktop:flex-col desktop:gap-5 desktop:px-4" > - {/* 사용자 정보 영역 */} - {/* /api/data/usages/balances 로 사용자 정보 받아오기 */} + {/* 1. UserInfo - 모바일: 1번째 / 태블릿: 왼쪽 상단 */} {userData && ( )} - {/* 현재 적용중인 정책 영역 */} + {/* 2. 현재 적용중인 정책 - 모바일: 2번째 / 태블릿: 전체 너비 3번째 행 */} {appliedPolicies.length > 0 && ( ({ @@ -145,15 +148,12 @@ export default function Policy() { )} - {/* 데이터 임계치 설정 영역(가족 공유 데이터 임계치, 개인 데이터 임계치) */} - {/* 가족 공유 데이터: 대표자만 접근 가능 - /api/shared-pools/limit로 데이터 넘기기 - 개인 데이터 임계치 설정: 각자 자신의 것 - /api/lines/thresholds로 데이터 넘기기 */} + {/* 3. 데이터 임계치 - 모바일: 3번째 / 태블릿: 오른쪽 상단 (UserInfo 옆) */} {sharedPoolThreshold && lineThreshold && ( )} - {/* 권한 관리 */} + {/* 4. 권한 관리 - 태블릿: 전체 너비 4번째 행 */} {isOwner && ( )} - {/* 구성원별 정책 제어 버튼 */} + {/* 5. 구성원별 정책 제어 + 권한 양도 - 태블릿: 2컬럼 5번째 행 */} {isOwner && ( + {policyFilter} + + + + - {showPolicyDropdown && ( - <> -
setShowPolicyDropdown(false)} - /> -
- {(["전체", "정책없음", "정책적용", "정책예외"] as const).map( - (filter) => ( - - ), - )} -
- - )} + {showPolicyDropdown && ( + <> +
setShowPolicyDropdown(false)} + /> +
+ {(["전체", "정책없음", "정책적용", "정책예외"] as const).map( + (filter) => ( + + ), + )} +
+ + )} +
- 조건 + 조건
{(["사용량 제한", "속도 제한"] as const).map((condition) => (