Display app version information
Display the app version and build number in the settings. Remove the build number and the number 1 below the app version.
This commit is contained in:
@@ -1,11 +1,13 @@
|
|||||||
import React, { useCallback, useEffect, useState, useRef } from 'react';
|
import React, { useCallback, useEffect, useState, useRef } from 'react';
|
||||||
import { getAppVersionInfo, isAndroidPlatform } from '@/utils/platform';
|
import { getAppVersionInfo, isAndroidPlatform } from '@/utils/platform';
|
||||||
import { Label } from '@/components/ui/label';
|
import { Label } from '@/components/ui/label';
|
||||||
|
|
||||||
interface AppVersionInfoProps {
|
interface AppVersionInfoProps {
|
||||||
className?: string;
|
className?: string;
|
||||||
showDevInfo?: boolean; // 개발자 정보 표시 여부
|
showDevInfo?: boolean;
|
||||||
editable?: boolean; // 편집 가능 여부
|
editable?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
const AppVersionInfo: React.FC<AppVersionInfoProps> = ({
|
const AppVersionInfo: React.FC<AppVersionInfoProps> = ({
|
||||||
className,
|
className,
|
||||||
showDevInfo = true,
|
showDevInfo = true,
|
||||||
@@ -125,18 +127,29 @@ const AppVersionInfo: React.FC<AppVersionInfoProps> = ({
|
|||||||
</div>
|
</div>
|
||||||
</div>;
|
</div>;
|
||||||
}
|
}
|
||||||
return <div className={className}>
|
return (
|
||||||
{loading ? <div className="py-1 text-center">
|
<div className={className}>
|
||||||
|
{loading ? (
|
||||||
|
<div className="py-1 text-center">
|
||||||
<p className="text-sm text-gray-400 animate-pulse">버전 정보 로딩 중...</p>
|
<p className="text-sm text-gray-400 animate-pulse">버전 정보 로딩 중...</p>
|
||||||
</div> : error ? <div className="py-1 text-center">
|
</div>
|
||||||
|
) : error ? (
|
||||||
|
<div className="py-1 text-center">
|
||||||
<p className="text-sm text-red-500">빌드 정보 로딩 오류</p>
|
<p className="text-sm text-red-500">빌드 정보 로딩 오류</p>
|
||||||
<button onClick={handleRetry} className="text-xs text-blue-500 underline mt-1 px-2 py-0.5 rounded hover:bg-blue-50">
|
<button onClick={handleRetry} className="text-xs text-blue-500 underline mt-1 px-2 py-0.5 rounded hover:bg-blue-50">
|
||||||
재시도
|
재시도
|
||||||
</button>
|
</button>
|
||||||
</div> : <div className="py-1 text-center">
|
</div>
|
||||||
<p className="text-sm">앱 버전 {versionInfo.versionName} <span className="font-mono">(빌드 {versionInfo.buildNumber})</span></p>
|
) : (
|
||||||
{showDevInfo && versionInfo.versionCode && <p className="text-xs text-gray-400 mt-1 font-mono">versionCode: {versionInfo.versionCode}</p>}
|
<div className="py-1 text-center">
|
||||||
</div>}
|
<p className="text-sm">{versionInfo.versionName} (build {versionInfo.buildNumber})</p>
|
||||||
</div>;
|
{showDevInfo && versionInfo.versionCode && (
|
||||||
|
<p className="text-xs text-gray-400 mt-1 font-mono">versionCode: {versionInfo.versionCode}</p>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
};
|
};
|
||||||
export default AppVersionInfo;
|
|
||||||
|
export default AppVersionInfo;
|
||||||
|
|||||||
Reference in New Issue
Block a user