From cf2143d5e5b39807601fe51101644b49d4e94672 Mon Sep 17 00:00:00 2001 From: tianma-if Date: Sat, 15 Aug 2026 14:34:49 +0800 Subject: [PATCH] fix: simplify login screens --- .../EdgeEver/Features/Auth/LoginView.swift | 18 +-------------- apps/mobile/src/components/icons.tsx | 1 + apps/mobile/src/screens/LoginScreen.tsx | 22 ++----------------- .../src/components/GitHubRepositoryLink.tsx | 8 ++++++- apps/web/src/components/LoginScreen.tsx | 10 +-------- packages/shared/src/i18n/en-US.ts | 2 -- packages/shared/src/i18n/zh-CN.ts | 2 -- 7 files changed, 12 insertions(+), 51 deletions(-) diff --git a/apps/ios/EdgeEver/Features/Auth/LoginView.swift b/apps/ios/EdgeEver/Features/Auth/LoginView.swift index 5ea3a29d..816dc002 100644 --- a/apps/ios/EdgeEver/Features/Auth/LoginView.swift +++ b/apps/ios/EdgeEver/Features/Auth/LoginView.swift @@ -34,6 +34,7 @@ struct LoginView: View { .clipShape(Circle()) .overlay(Circle().stroke(AppTheme.border, lineWidth: 1)) } + .accessibilityLabel(env.preferences.t("GitHub 仓库", en: "GitHub repository")) .padding(.trailing, 18) .padding(.top, 18) .zIndex(2) @@ -70,23 +71,6 @@ struct LoginView: View { keyboard: .URL, secure: false ) - Text(env.preferences.t( - "请填写完整 HTTPS 地址,不要只输入 demo。", - en: "Enter the full HTTPS URL, not just “demo”." - )) - .font(.system(size: 12, weight: .medium)) - .foregroundStyle(AppTheme.secondary) - .padding(.top, 8) - Button { - baseUrl = EdgeEverPublicDemo.instanceURLString - } label: { - Text(env.preferences.t("填入公开演示实例", en: "Use public demo instance")) - .font(.system(size: 13, weight: .semibold)) - .foregroundStyle(AppTheme.accent) - } - .buttonStyle(.plain) - .accessibilityLabel(env.preferences.t("填入公开演示实例", en: "Use public demo instance")) - .padding(.top, 6) .padding(.bottom, 14) field( diff --git a/apps/mobile/src/components/icons.tsx b/apps/mobile/src/components/icons.tsx index ea9f5f08..4f7887f9 100644 --- a/apps/mobile/src/components/icons.tsx +++ b/apps/mobile/src/components/icons.tsx @@ -41,6 +41,7 @@ export const FileSpreadsheet = createIcon("grid"); export const FileText = createIcon("file-text"); export const Folder = createIcon("folder"); export const Grid = createIcon("grid"); +export const GitHub = createIcon("github"); export const HardDrive = createIcon("hard-drive"); export const Heading2 = createIcon("type"); export const History = createIcon("clock"); diff --git a/apps/mobile/src/screens/LoginScreen.tsx b/apps/mobile/src/screens/LoginScreen.tsx index 6a44fd3a..a23f6703 100644 --- a/apps/mobile/src/screens/LoginScreen.tsx +++ b/apps/mobile/src/screens/LoginScreen.tsx @@ -9,7 +9,7 @@ import { } from "react-native"; import { PUBLIC_DEMO_INSTANCE_URL } from "@edgeever/shared"; import { SafeAreaView } from "react-native-safe-area-context"; -import { ActivityIndicator, ExternalLink, LockKeyhole } from "../components/icons"; +import { ActivityIndicator, GitHub, LockKeyhole } from "../components/icons"; import { Pressable, Text, TextInput } from "../components/LocalizedText"; import { resolveMobileThemeStyles, useMobileTheme, type MobileResolvedTheme } from "../lib/mobile-theme"; import { useSession } from "../lib/session"; @@ -48,7 +48,7 @@ export const LoginScreen = () => { return ( Linking.openURL(GITHUB_REPOSITORY_URL)} style={styles.githubButton}> - + { style={styles.input} value={baseUrl} /> - 请填写完整 HTTPS 地址,不要只输入 demo。 - setBaseUrl(PUBLIC_DEMO_INSTANCE_URL)} - > - 填入公开演示实例 - @@ -217,16 +209,6 @@ const baseLoginStyles = StyleSheet.create({ minHeight: 48, paddingHorizontal: 14, }, - hint: { - color: "#64748b", - fontSize: 12, - lineHeight: 16, - }, - demoLink: { - color: "#059669", - fontSize: 13, - fontWeight: "700", - }, error: { color: "#dc2626", fontSize: 13, diff --git a/apps/web/src/components/GitHubRepositoryLink.tsx b/apps/web/src/components/GitHubRepositoryLink.tsx index 1fba98e7..84278de0 100644 --- a/apps/web/src/components/GitHubRepositoryLink.tsx +++ b/apps/web/src/components/GitHubRepositoryLink.tsx @@ -31,7 +31,13 @@ export const GitHubRepositoryLink = ({ - + {children} diff --git a/apps/web/src/components/LoginScreen.tsx b/apps/web/src/components/LoginScreen.tsx index be481962..700c7f17 100644 --- a/apps/web/src/components/LoginScreen.tsx +++ b/apps/web/src/components/LoginScreen.tsx @@ -1,7 +1,7 @@ import { useState, type FormEvent } from "react"; import { LockKeyhole } from "lucide-react"; import { useTranslation } from "react-i18next"; -import { PUBLIC_DEMO_INSTANCE_URL, resolveInstanceUrlInput } from "@edgeever/shared"; +import { resolveInstanceUrlInput } from "@edgeever/shared"; import { Button } from "@/components/ui/button"; import { GitHubRepositoryLink } from "@/components/GitHubRepositoryLink"; import { Input } from "@/components/ui/input"; @@ -92,14 +92,6 @@ export const LoginScreen = ({ error, instanceUrl: initialInstanceUrl, isSubmitti value={instanceUrl} onChange={(event) => setInstanceUrl(event.target.value)} /> -

{t("login.instanceUrlHint")}

- ) : null} diff --git a/packages/shared/src/i18n/en-US.ts b/packages/shared/src/i18n/en-US.ts index 6322da56..0da8cbd5 100644 --- a/packages/shared/src/i18n/en-US.ts +++ b/packages/shared/src/i18n/en-US.ts @@ -74,8 +74,6 @@ export const enUS = { desktopChangeInstance: "Change instance URL", desktopInstanceUrlInvalid: "Enter a valid instance URL beginning with http:// or https://.", instanceUrlPlaceholder: "https://demo.edgeever.org", - instanceUrlHint: "Enter the full HTTPS URL, not just “demo”.", - usePublicDemo: "Use public demo instance", }, nav: { mobileMain: "Mobile primary navigation", diff --git a/packages/shared/src/i18n/zh-CN.ts b/packages/shared/src/i18n/zh-CN.ts index ed55e4ae..8d528027 100644 --- a/packages/shared/src/i18n/zh-CN.ts +++ b/packages/shared/src/i18n/zh-CN.ts @@ -74,8 +74,6 @@ export const zhCN = { desktopChangeInstance: "更换实例地址", desktopInstanceUrlInvalid: "请输入以 http:// 或 https:// 开头的有效实例地址。", instanceUrlPlaceholder: "https://demo.edgeever.org", - instanceUrlHint: "请填写完整 HTTPS 地址,不要只输入 demo。", - usePublicDemo: "填入公开演示实例", }, nav: { mobileMain: "移动端主导航",