Fix: SafeArea for iOS dynamic island
Fixes iOS safe area issues caused by the dynamic island.
This commit is contained in:
@@ -12,6 +12,26 @@ import { useDataInitialization } from '@/hooks/useDataInitialization';
|
||||
import { useIsMobile } from '@/hooks/use-mobile';
|
||||
import useNotifications from '@/hooks/useNotifications';
|
||||
import SafeAreaContainer from '@/components/SafeAreaContainer';
|
||||
import { BudgetData } from '@/contexts/budget/types';
|
||||
|
||||
// 기본 예산 데이터 (빈 객체 대신 사용할 더미 데이터)
|
||||
const defaultBudgetData: BudgetData = {
|
||||
daily: {
|
||||
targetAmount: 0,
|
||||
spentAmount: 0,
|
||||
remainingAmount: 0
|
||||
},
|
||||
weekly: {
|
||||
targetAmount: 0,
|
||||
spentAmount: 0,
|
||||
remainingAmount: 0
|
||||
},
|
||||
monthly: {
|
||||
targetAmount: 0,
|
||||
spentAmount: 0,
|
||||
remainingAmount: 0
|
||||
}
|
||||
};
|
||||
|
||||
// 메인 컴포넌트
|
||||
const Index = () => {
|
||||
@@ -69,7 +89,7 @@ const Index = () => {
|
||||
try {
|
||||
console.log('Index 페이지 마운트, 현재 데이터 상태:');
|
||||
console.log('트랜잭션:', transactions?.length || 0);
|
||||
console.log('예산 데이터:', budgetData);
|
||||
console.log('예산 데이터:', budgetData || defaultBudgetData);
|
||||
|
||||
// 페이지 첫 마운트 시에만 실행되는 로직으로 수정
|
||||
const isFirstMount = sessionStorage.getItem('initialDataLoaded') !== 'true';
|
||||
@@ -194,7 +214,7 @@ const Index = () => {
|
||||
|
||||
<HomeContent
|
||||
transactions={transactions || []}
|
||||
budgetData={budgetData || {}}
|
||||
budgetData={budgetData || defaultBudgetData}
|
||||
selectedTab={selectedTab}
|
||||
setSelectedTab={setSelectedTab}
|
||||
handleBudgetGoalUpdate={handleBudgetGoalUpdate}
|
||||
|
||||
Reference in New Issue
Block a user