From fa7f68b9425450437c722bacb1049eaec3be0369 Mon Sep 17 00:00:00 2001 From: N0VAN0M4LY <224130499+N0VAN0M4LY@users.noreply.github.com> Date: Wed, 2 Dec 2026 20:06:51 +0800 Subject: [PATCH] feat(launcher): use two-column About layout and add Discord link --- .../src/renderer/src/i18n/locales/en.json | 7 +- .../src/renderer/src/i18n/locales/zh-CN.json | 7 +- .../renderer/src/pages/about/AboutPage.tsx | 95 +++++++++++++------ .../src/pages/about/AppUpdateSection.tsx | 20 ++-- .../src/renderer/src/styles/controls.css | 4 + .../src/renderer/src/styles/pages.css | 64 +++++++++++++ 6 files changed, 156 insertions(+), 41 deletions(-) diff --git a/apps/launcher/src/renderer/src/i18n/locales/en.json b/apps/launcher/src/renderer/src/i18n/locales/en.json index 44010bf..93f5234 100644 --- a/apps/launcher/src/renderer/src/i18n/locales/en.json +++ b/apps/launcher/src/renderer/src/i18n/locales/en.json @@ -638,7 +638,12 @@ } }, "statement": "Project information", - "statementBody": "WTOffline is a noncommercial hobby project independent of Gaijin. Running it requires your own War Thunder base game files." + "statementBody": "WTOffline is a noncommercial hobby project independent of Gaijin. Running it requires your own War Thunder base game files.", + "community": { + "discord": "Discord", + "discordHint": "Development discussion, general chat, troubleshooting, and bug reports.", + "openDiscord": "Open Discord" + } }, "features": { "A-Offline startup": "Offline startup", diff --git a/apps/launcher/src/renderer/src/i18n/locales/zh-CN.json b/apps/launcher/src/renderer/src/i18n/locales/zh-CN.json index 4a600f3..8caa118 100644 --- a/apps/launcher/src/renderer/src/i18n/locales/zh-CN.json +++ b/apps/launcher/src/renderer/src/i18n/locales/zh-CN.json @@ -638,7 +638,12 @@ } }, "statement": "项目信息", - "statementBody": "WTOffline 是一个独立于 Gaijin 的非商业兴趣项目。运行需要自备战争雷霆游戏本体文件。" + "statementBody": "WTOffline 是一个独立于 Gaijin 的非商业兴趣项目。运行需要自备战争雷霆游戏本体文件。", + "community": { + "discord": "Discord", + "discordHint": "开发讨论、日常交流、使用求助与问题反馈。", + "openDiscord": "打开 Discord" + } }, "features": { "A-Offline startup": "离线启动", diff --git a/apps/launcher/src/renderer/src/pages/about/AboutPage.tsx b/apps/launcher/src/renderer/src/pages/about/AboutPage.tsx index 8091aaa..bff26e2 100644 --- a/apps/launcher/src/renderer/src/pages/about/AboutPage.tsx +++ b/apps/launcher/src/renderer/src/pages/about/AboutPage.tsx @@ -1,13 +1,14 @@ import { useState } from 'react'; import { useTranslation } from 'react-i18next'; import { Notice } from '../../components/Notice.tsx'; -import { Row } from '../../components/Row.tsx'; import { Sheet } from '../../components/Sheet.tsx'; import { ipcInvoke } from '../../ipc.ts'; import type { AppUpdateState } from '../../shell/useAppUpdate.ts'; import { AppUpdateSection } from './AppUpdateSection.tsx'; import type { PatchPackState } from '../../shell/usePatchPack.ts'; +const DISCORD_INVITE_URL = 'https://discord.gg/P566xWNpEs'; + interface AboutPageProps { readonly launcherVersion: string; readonly supportedVersions: readonly string[]; @@ -17,7 +18,7 @@ interface AboutPageProps { readonly onError: (error: unknown) => void; } -/** The launcher's version, the game versions it supports, adaptation pack updates, log export, and the project statement. */ +/** The launcher's version, the game versions it supports, updates, community links, log export, and the project statement. */ export function AboutPage({ launcherVersion, supportedVersions, patchPack, appUpdate, loggingEnabled, onError }: AboutPageProps) { const { t } = useTranslation(); return ( @@ -30,15 +31,41 @@ export function AboutPage({ launcherVersion, supportedVersions, patchPack, appUp {t('about.supported', { versions: supportedVersions.join(', ') })} - - - -

{t('about.statement')}

-

{t('about.statementBody')}

+
+
+ + +
+
+ + +
+

{t('about.statement')}

+

{t('about.statementBody')}

+
+
+
); } +function CommunitySection() { + const { t } = useTranslation(); + return ( +
+
+

{t('about.community.discord')}

+ +
+

{t('about.community.discordHint')}

+
+ ); +} + function FeedbackLogsSection({ loggingEnabled, onError }: { readonly loggingEnabled: boolean; readonly onError: (error: unknown) => void; @@ -61,16 +88,19 @@ function FeedbackLogsSection({ loggingEnabled, onError }: { } return ( - <> -

{t('about.feedback.title')}

- - - +
+
+

{t('about.feedback.title')}

+
+ +
+
+

{t('about.feedback.exportHint')}

{!loggingEnabled &&

{t('settings.diagnostics.loggingDisabledNotice')}

} {savedPath &&

{t('settings.diagnostics.saved', { path: savedPath })}

} - +
); } @@ -85,25 +115,30 @@ function PatchPackSection({ state }: { readonly state: PatchPackState }) { ? t('about.pack.bundledVersion', { version: active.version }) : t('about.pack.bundled'); return ( - <> -

{t('about.pack.title')}

- - {current} - {active?.source === 'downloaded' && ( - - )} - - - - + {active?.source === 'downloaded' && ( + + )} + + +

+ {t('about.pack.current')} + {' · '} + {current} +

+

{t('about.pack.currentHint')}

{busy === 'applying' &&

{t('about.pack.applying')}

} {state.applyFailure &&

{t(`about.pack.applyFailed.${state.applyFailure}`)}

} {check && busy !== 'checking' && } - + ); } diff --git a/apps/launcher/src/renderer/src/pages/about/AppUpdateSection.tsx b/apps/launcher/src/renderer/src/pages/about/AppUpdateSection.tsx index 1ea09b8..40cee36 100644 --- a/apps/launcher/src/renderer/src/pages/about/AppUpdateSection.tsx +++ b/apps/launcher/src/renderer/src/pages/about/AppUpdateSection.tsx @@ -1,7 +1,6 @@ import { useTranslation } from 'react-i18next'; import { Notice } from '../../components/Notice.tsx'; import { ProgressBar } from '../../components/ProgressBar.tsx'; -import { Row } from '../../components/Row.tsx'; import { formatBytes } from '../../format.ts'; import type { AppUpdateState } from '../../shell/useAppUpdate.ts'; @@ -10,13 +9,16 @@ export function AppUpdateSection({ state }: { readonly state: AppUpdateState }) if (!state.supported) return null; const { check, busy, progress } = state; return ( - <> -

{t('about.update.title')}

- - - +
+
+

{t('about.update.title')}

+
+ +
+
+

{t('about.update.check')}

{check?.status === 'current' && busy !== 'checking' &&

{t('about.update.current')}

} {check?.status === 'failed' && busy !== 'checking' &&

{t(`about.update.errors.${check.problem}`)}

} {check?.status === 'available' && busy !== 'checking' && ( @@ -43,6 +45,6 @@ export function AppUpdateSection({ state }: { readonly state: AppUpdateState }) )} )} - +
); } diff --git a/apps/launcher/src/renderer/src/styles/controls.css b/apps/launcher/src/renderer/src/styles/controls.css index fc07c5e..6bd8dcf 100644 --- a/apps/launcher/src/renderer/src/styles/controls.css +++ b/apps/launcher/src/renderer/src/styles/controls.css @@ -215,9 +215,13 @@ /* ===== Buttons and links ===== */ .button { + display: inline-flex; + align-items: center; + justify-content: center; font: 500 14px var(--font-display); letter-spacing: 0.04em; text-transform: uppercase; + text-decoration: none; padding: 7px 16px; cursor: pointer; white-space: nowrap; diff --git a/apps/launcher/src/renderer/src/styles/pages.css b/apps/launcher/src/renderer/src/styles/pages.css index 610df00..bef5000 100644 --- a/apps/launcher/src/renderer/src/styles/pages.css +++ b/apps/launcher/src/renderer/src/styles/pages.css @@ -371,3 +371,67 @@ line-height: 1.6; color: var(--text-dim); } + +.about-columns { + display: grid; + grid-template-columns: repeat(2, minmax(0, 1fr)); + gap: 14px; + align-items: start; +} + +.about-column { + display: flex; + flex-direction: column; + gap: 14px; + min-width: 0; +} + +.about-card { + min-width: 0; + padding: 14px 16px; + background: rgba(0, 0, 0, 0.14); + border: 1px solid var(--line); + border-radius: var(--radius); +} + +.about-card-head { + display: flex; + align-items: center; + justify-content: space-between; + gap: 10px; + flex-wrap: wrap; +} + +.about-card-title { + margin: 0; + font: 500 14px var(--font-display); + text-transform: uppercase; + letter-spacing: 0.08em; + color: var(--white); +} + +.about-card-actions { + display: flex; + align-items: center; + gap: 8px; + flex-wrap: wrap; +} + +.about-card-meta { + margin: 8px 0 0; + font-size: 13px; + line-height: 1.5; + color: var(--text); +} + +.about-card-label { + color: var(--text-dim); +} + +.about-card .notice { + margin-top: 10px; +} + +.about-card .notice .button { + margin-top: 8px; +}