Safe area added

This commit is contained in:
EthanShoeDev
2025-09-15 00:55:45 -04:00
parent 89cb6c4b6b
commit 8d325db847
2 changed files with 32 additions and 29 deletions

View File

@@ -105,11 +105,11 @@ export default function Index() {
);
return (
<SafeAreaView style={styles.container}>
<ScrollView
contentContainerStyle={styles.scrollContent}
keyboardShouldPersistTaps="handled"
>
<ScrollView
contentContainerStyle={styles.scrollContent}
keyboardShouldPersistTaps="handled"
>
<SafeAreaView style={styles.container}>
<View style={styles.header}>
<Text style={styles.appName}>fressh</Text>
<Text style={styles.appTagline}>A fast, friendly SSH client</Text>
@@ -218,8 +218,8 @@ export default function Index() {
}
}}
/>
</ScrollView>
</SafeAreaView>
</SafeAreaView>
</ScrollView>
);
}

View File

@@ -13,6 +13,7 @@ import {
TextInput,
View,
} from 'react-native';
import { SafeAreaView } from 'react-native-safe-area-context';
export default function Shell() {
// https://docs.expo.dev/router/reference/url-parameters/
@@ -63,28 +64,30 @@ export default function Shell() {
}, [shellData]);
return (
<View style={styles.container}>
<Text style={styles.title}>SSH Shell</Text>
<View style={styles.terminal}>
<ScrollView
ref={scrollViewRef}
contentContainerStyle={styles.terminalContent}
keyboardShouldPersistTaps="handled"
>
<Text selectable style={styles.terminalText}>
{shellData || 'Connected. Output will appear here...'}
</Text>
</ScrollView>
</View>
<CommandInput
executeCommand={async (command) => {
console.log('Executing command:', command);
await shell?.sendData(
Uint8Array.from(new TextEncoder().encode(command + '\n')).buffer,
);
}}
/>
</View>
<ScrollView keyboardShouldPersistTaps="handled">
<SafeAreaView style={styles.container}>
<Text style={styles.title}>SSH Shell</Text>
<View style={styles.terminal}>
<ScrollView
ref={scrollViewRef}
contentContainerStyle={styles.terminalContent}
keyboardShouldPersistTaps="handled"
>
<Text selectable style={styles.terminalText}>
{shellData || 'Connected. Output will appear here...'}
</Text>
</ScrollView>
</View>
<CommandInput
executeCommand={async (command) => {
console.log('Executing command:', command);
await shell?.sendData(
Uint8Array.from(new TextEncoder().encode(command + '\n')).buffer,
);
}}
/>
</SafeAreaView>
</ScrollView>
);
}