From 4cfc48c8e1d942fbb88899565f3cc0f824dd242e Mon Sep 17 00:00:00 2001 From: "gpt-engineer-app[bot]" <159125892+gpt-engineer-app[bot]@users.noreply.github.com> Date: Wed, 19 Mar 2025 14:21:18 +0000 Subject: [PATCH] Visual edit in Lovable Edited UI in Lovable --- src/App.tsx | 84 +++++++++++++++++++++++------------------------------ 1 file changed, 37 insertions(+), 47 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index 4743f81..84506ee 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,4 +1,3 @@ - import React, { useEffect } from 'react'; import { BrowserRouter as Router, Route, Routes } from 'react-router-dom'; import { SplashScreen } from '@capacitor/splash-screen'; @@ -27,27 +26,36 @@ const handleError = (error: Error | unknown) => { }; // 오류 경계 컴포넌트 -class ErrorBoundary extends React.Component< - { children: React.ReactNode }, - { hasError: boolean; error: Error | null } -> { - constructor(props: { children: React.ReactNode }) { +class ErrorBoundary extends React.Component<{ + children: React.ReactNode; +}, { + hasError: boolean; + error: Error | null; +}> { + constructor(props: { + children: React.ReactNode; + }) { super(props); - this.state = { hasError: false, error: null }; + this.state = { + hasError: false, + error: null + }; } - static getDerivedStateFromError(error: Error) { - return { hasError: true, error }; + return { + hasError: true, + error + }; } - componentDidCatch(error: Error, errorInfo: React.ErrorInfo) { - handleError({ error, errorInfo }); + handleError({ + error, + errorInfo + }); } - render() { if (this.state.hasError) { - return ( -
+ return

오류가 발생했습니다

@@ -56,21 +64,15 @@ class ErrorBoundary extends React.Component<

               {this.state.error?.message}
             
-
-
- ); +
; } - return this.props.children; } } - function App() { // 앱 로딩이 완료되었을 때 스플래시 화면을 숨김 useEffect(() => { @@ -90,46 +92,40 @@ function App() { console.error('앱 준비 오류:', err); } }; - + // 앱 준비 함수 실행 onAppReady(); - + // 추가 보호장치: 페이지 로드 시 다시 실행 const handleLoad = () => { // 즉시 스플래시 화면을 숨김 시도 SplashScreen.hide().catch(() => {}); - + // 백업 시도 setTimeout(() => { SplashScreen.hide().catch(() => {}); }, 300); }; - window.addEventListener('load', handleLoad); - return () => { window.removeEventListener('load', handleLoad); }; }, []); - - return ( - + return
-
{/* 상단 여백 5px에서 10px로 증가 */} +
{/* 상단 여백 5px에서 10px로 증가 */}
} /> } /> } /> - + - - } /> + } /> } /> {/* 지출 페이지는 더 이상 인증이 필요하지 않음 */} } /> @@ -137,18 +133,14 @@ function App() { } /> {/* 보안 및 개인정보 페이지도 로그인 없이 접근 가능하도록 수정 */} } /> - + - - } /> + } /> } /> } /> - + - - } /> + } /> } />
@@ -157,8 +149,6 @@ function App() { - - ); + ; } - -export default App; +export default App; \ No newline at end of file