feat: pre-fill WebDAV URL, add password visibility toggle

This commit is contained in:
Eddy de Vink 2026-06-27 22:58:27 +02:00
commit d2e8f4444f

View file

@ -27,9 +27,10 @@ export async function getWebDAVConfig(): Promise<WebDAVConfig | null> {
}
export default function SettingsScreen() {
const [url, setUrl] = useState('')
const [url, setUrl] = useState('https://nextcloud.eddydevink.nl')
const [username, setUsername] = useState('')
const [password, setPassword] = useState('')
const [showPassword, setShowPassword] = useState(false)
const [syncing, setSyncing] = useState(false)
useEffect(() => {
@ -77,7 +78,7 @@ export default function SettingsScreen() {
style={styles.input}
value={url}
onChangeText={setUrl}
placeholder="https://nextcloud.example.nl/remote.php/dav/files/gebruiker/"
placeholder="https://nextcloud.eddydevink.nl/remote.php/dav/files/gebruiker/"
autoCapitalize="none"
autoCorrect={false}
/>
@ -92,12 +93,18 @@ export default function SettingsScreen() {
/>
<Text style={styles.label}>Wachtwoord</Text>
<View style={styles.passwordRow}>
<TextInput
style={styles.input}
style={styles.passwordInput}
value={password}
onChangeText={setPassword}
secureTextEntry
secureTextEntry={!showPassword}
autoCapitalize="none"
/>
<TouchableOpacity style={styles.eyeButton} onPress={() => setShowPassword(!showPassword)}>
<Text style={styles.eyeIcon}>{showPassword ? '👁' : '👁‍🗨'}</Text>
</TouchableOpacity>
</View>
<TouchableOpacity style={styles.saveButton} onPress={handleSave}>
<Text style={styles.buttonText}>Instellingen opslaan</Text>
@ -124,6 +131,10 @@ const styles = StyleSheet.create({
sectionTitle: { fontSize: 18, fontWeight: '700', marginBottom: 16 },
label: { fontSize: 14, fontWeight: '600', color: '#333', marginBottom: 4, marginTop: 12 },
input: { backgroundColor: '#fff', borderRadius: 8, padding: 12, fontSize: 16, borderWidth: 1, borderColor: '#ddd' },
passwordRow: { flexDirection: 'row', alignItems: 'center', backgroundColor: '#fff', borderRadius: 8, borderWidth: 1, borderColor: '#ddd' },
passwordInput: { flex: 1, padding: 12, fontSize: 16 },
eyeButton: { padding: 12 },
eyeIcon: { fontSize: 20 },
saveButton: { backgroundColor: '#4CAF50', padding: 14, borderRadius: 8, alignItems: 'center', marginTop: 24 },
clearButton: { padding: 14, alignItems: 'center', marginTop: 8 },
clearButtonText: { color: '#e53935', fontSize: 14 },