Skip to content

AI-native knowledge base & Evernote/Obsidian alternative with instant sync & native MCP. Free on Cloudflare or self-hosted via Docker.

feat(mobile): allow landscape orientation

tianma-if548cf3de2a1f
diff --git a/apps/mobile/app.json b/apps/mobile/app.json
index 650f0b5d..e984f63a 100644
--- a/apps/mobile/app.json
+++ b/apps/mobile/app.json
@@ -16,7 +16,7 @@
}
},
"icon": "./assets/icon.png",
- "orientation": "portrait",
+ "orientation": "default",
"userInterfaceStyle": "light",
"newArchEnabled": true,
"ios": {
diff --git a/apps/mobile/src/screens/LoginScreen.tsx b/apps/mobile/src/screens/LoginScreen.tsx
index 0244e8da..c2b7053f 100644
--- a/apps/mobile/src/screens/LoginScreen.tsx
+++ b/apps/mobile/src/screens/LoginScreen.tsx
@@ -4,6 +4,7 @@ import {
KeyboardAvoidingView,
Linking,
Platform,
+ ScrollView,
StyleSheet,
View,
} from "react-native";
@@ -50,70 +51,76 @@ export const LoginScreen = () => {
<ExternalLink color="#475569" size={20} />
</Pressable>
<KeyboardAvoidingView behavior={Platform.OS === "ios" ? "padding" : undefined} style={styles.keyboard}>
- <View style={styles.form}>
- <View style={styles.header}>
- <View style={styles.logo}>
- <LockKeyhole color="#ffffff" size={22} />
+ <ScrollView
+ contentContainerStyle={styles.scrollContent}
+ keyboardShouldPersistTaps="handled"
+ showsVerticalScrollIndicator={false}
+ >
+ <View style={styles.form}>
+ <View style={styles.header}>
+ <View style={styles.logo}>
+ <LockKeyhole color="#ffffff" size={22} />
+ </View>
+ <View style={styles.headerText}>
+ <Text style={styles.title}>EdgeEver</Text>
+ <Text style={styles.subtitle}>连接你的自托管笔记空间</Text>
+ </View>
</View>
- <View style={styles.headerText}>
- <Text style={styles.title}>EdgeEver</Text>
- <Text style={styles.subtitle}>连接你的自托管笔记空间</Text>
+ <View style={styles.field}>
+ <Text style={styles.label}>实例地址</Text>
+ <TextInput
+ autoCapitalize="none"
+ autoCorrect={false}
+ keyboardType="url"
+ onChangeText={setBaseUrl}
+ placeholder="https://notes.example.com"
+ placeholderTextColor="#94a3b8"
+ style={styles.input}
+ value={baseUrl}
+ />
</View>
- </View>
- <View style={styles.field}>
- <Text style={styles.label}>实例地址</Text>
- <TextInput
- autoCapitalize="none"
- autoCorrect={false}
- keyboardType="url"
- onChangeText={setBaseUrl}
- placeholder="https://notes.example.com"
- placeholderTextColor="#94a3b8"
- style={styles.input}
- value={baseUrl}
- />
- </View>
- <View style={styles.field}>
- <Text style={styles.label}>用户名</Text>
- <TextInput
- autoCapitalize="none"
- autoCorrect={false}
- onChangeText={setUsername}
- placeholder="owner"
- placeholderTextColor="#94a3b8"
- style={styles.input}
- value={username}
- />
- </View>
+ <View style={styles.field}>
+ <Text style={styles.label}>用户名</Text>
+ <TextInput
+ autoCapitalize="none"
+ autoCorrect={false}
+ onChangeText={setUsername}
+ placeholder="owner"
+ placeholderTextColor="#94a3b8"
+ style={styles.input}
+ value={username}
+ />
+ </View>
- <View style={styles.field}>
- <Text style={styles.label}>密码</Text>
- <TextInput
- onChangeText={setPassword}
- placeholder="首次登录密码"
- placeholderTextColor="#94a3b8"
- secureTextEntry
- style={styles.input}
- value={password}
- />
- </View>
+ <View style={styles.field}>
+ <Text style={styles.label}>密码</Text>
+ <TextInput
+ onChangeText={setPassword}
+ placeholder="首次登录密码"
+ placeholderTextColor="#94a3b8"
+ secureTextEntry
+ style={styles.input}
+ value={password}
+ />
+ </View>
- {error ? <Text style={styles.error}>{error}</Text> : null}
+ {error ? <Text style={styles.error}>{error}</Text> : null}
- <Pressable
- accessibilityRole="button"
- disabled={!canSubmit || submitting}
- onPress={handleSubmit}
- style={({ pressed }) => [
- styles.button,
- (!canSubmit || submitting) && styles.buttonDisabled,
- pressed && canSubmit ? styles.buttonPressed : null,
- ]}
- >
- {submitting ? <ActivityIndicator color="#ffffff" /> : <Text style={styles.buttonText}>登录</Text>}
- </Pressable>
- </View>
+ <Pressable
+ accessibilityRole="button"
+ disabled={!canSubmit || submitting}
+ onPress={handleSubmit}
+ style={({ pressed }) => [
+ styles.button,
+ (!canSubmit || submitting) && styles.buttonDisabled,
+ pressed && canSubmit ? styles.buttonPressed : null,
+ ]}
+ >
+ {submitting ? <ActivityIndicator color="#ffffff" /> : <Text style={styles.buttonText}>登录</Text>}
+ </Pressable>
+ </View>
+ </ScrollView>
</KeyboardAvoidingView>
</SafeAreaView>
);
@@ -140,6 +147,9 @@ const baseLoginStyles = StyleSheet.create({
},
keyboard: {
flex: 1,
+ },
+ scrollContent: {
+ flexGrow: 1,
justifyContent: "center",
padding: 24,
},