From 51bcdf2d05889fccc5457d49f2760b55ce9fea4d Mon Sep 17 00:00:00 2001 From: "gpt-engineer-app[bot]" <159125892+gpt-engineer-app[bot]@users.noreply.github.com> Date: Fri, 21 Mar 2025 13:17:30 +0000 Subject: [PATCH] Center align app version info Center align the app version and description text in the settings page. --- src/components/AppVersionInfo.tsx | 11 ++++++----- src/pages/Settings.tsx | 10 +++++----- src/utils/platform.ts | 2 +- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/components/AppVersionInfo.tsx b/src/components/AppVersionInfo.tsx index 1cb0f41..411a774 100644 --- a/src/components/AppVersionInfo.tsx +++ b/src/components/AppVersionInfo.tsx @@ -1,3 +1,4 @@ + import React, { useCallback, useEffect, useState, useRef } from 'react'; import { getAppVersionInfo, isAndroidPlatform } from '@/utils/platform'; import { Label } from '@/components/ui/label'; @@ -105,15 +106,15 @@ const AppVersionInfo: React.FC = ({ return
- -
+ +
{editableVersionName} (build {editableBuildNumber})
- -
The first build
+ +
The first build
@@ -136,4 +137,4 @@ const AppVersionInfo: React.FC = ({
}
; }; -export default AppVersionInfo; \ No newline at end of file +export default AppVersionInfo; diff --git a/src/pages/Settings.tsx b/src/pages/Settings.tsx index 8949f31..2b98f37 100644 --- a/src/pages/Settings.tsx +++ b/src/pages/Settings.tsx @@ -1,3 +1,4 @@ + import React from 'react'; import { useNavigate } from 'react-router-dom'; import NavBar from '@/components/NavBar'; @@ -104,10 +105,9 @@ const Settings = () => { navigate('/login')} />
-
-
- - +
+
+
{/* 앱 버전 카드 아래 추가 공간 */} @@ -118,4 +118,4 @@ const Settings = () => {
; }; -export default Settings; \ No newline at end of file +export default Settings; diff --git a/src/utils/platform.ts b/src/utils/platform.ts index e64389d..49bf5a5 100644 --- a/src/utils/platform.ts +++ b/src/utils/platform.ts @@ -42,7 +42,7 @@ export const getAppVersionInfo = async () => { if (Capacitor.isPluginAvailable('BuildInfo')) { // Capacitor.Plugins 대신에 직접 window 객체에서 접근 // @ts-ignore - 플러그인이 런타임에 등록되므로 타입 체크를 무시 - const buildInfo = await Capacitor.Plugins.BuildInfo?.getBuildInfo(); + const buildInfo = await Capacitor.Plugins?.BuildInfo?.getBuildInfo(); return { versionName: buildInfo?.versionName || '1.0.1', buildNumber: buildInfo?.buildNumber ? parseInt(buildInfo.buildNumber, 10) : 2,