fix: confirm dialog before clearing WebDAV config, ensure full button text
This commit is contained in:
parent
55785fe9e3
commit
ea29f52fad
1 changed files with 20 additions and 8 deletions
|
|
@ -48,12 +48,24 @@ export default function SettingsScreen() {
|
||||||
Alert.alert('Opgeslagen', 'WebDAV instellingen zijn opgeslagen')
|
Alert.alert('Opgeslagen', 'WebDAV instellingen zijn opgeslagen')
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleClear = async () => {
|
const handleClear = () => {
|
||||||
await deleteConfig()
|
Alert.alert(
|
||||||
setUrl('')
|
'Instellingen wissen?',
|
||||||
setUsername('')
|
'WebDAV configuratie definitief verwijderen? Je kunt deze later opnieuw invoeren.',
|
||||||
setPassword('')
|
[
|
||||||
Alert.alert('Verwijderd', 'WebDAV instellingen zijn gewist')
|
{ text: 'Annuleren', style: 'cancel' },
|
||||||
|
{
|
||||||
|
text: 'Ja, wissen',
|
||||||
|
style: 'destructive',
|
||||||
|
onPress: async () => {
|
||||||
|
await deleteConfig()
|
||||||
|
setUrl('')
|
||||||
|
setUsername('')
|
||||||
|
setPassword('')
|
||||||
|
},
|
||||||
|
},
|
||||||
|
]
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleSync = async () => {
|
const handleSync = async () => {
|
||||||
|
|
@ -111,7 +123,7 @@ export default function SettingsScreen() {
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
|
|
||||||
<TouchableOpacity style={styles.clearButton} onPress={handleClear}>
|
<TouchableOpacity style={styles.clearButton} onPress={handleClear}>
|
||||||
<Text style={styles.clearButtonText}>Instellingen wissen</Text>
|
<Text style={styles.clearButtonText} numberOfLines={1}>Instellingen wissen</Text>
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
|
|
||||||
<TouchableOpacity
|
<TouchableOpacity
|
||||||
|
|
@ -136,7 +148,7 @@ const styles = StyleSheet.create({
|
||||||
eyeButton: { padding: 12 },
|
eyeButton: { padding: 12 },
|
||||||
eyeIcon: { fontSize: 20 },
|
eyeIcon: { fontSize: 20 },
|
||||||
saveButton: { backgroundColor: '#4CAF50', padding: 14, borderRadius: 8, alignItems: 'center', marginTop: 24 },
|
saveButton: { backgroundColor: '#4CAF50', padding: 14, borderRadius: 8, alignItems: 'center', marginTop: 24 },
|
||||||
clearButton: { padding: 14, alignItems: 'center', marginTop: 8 },
|
clearButton: { padding: 14, borderRadius: 8, alignItems: 'center', alignSelf: 'stretch', marginTop: 8 },
|
||||||
clearButtonText: { color: '#e53935', fontSize: 14 },
|
clearButtonText: { color: '#e53935', fontSize: 14 },
|
||||||
syncButton: { backgroundColor: '#2196F3', padding: 14, borderRadius: 8, alignItems: 'center', marginTop: 24 },
|
syncButton: { backgroundColor: '#2196F3', padding: 14, borderRadius: 8, alignItems: 'center', marginTop: 24 },
|
||||||
syncButtonDisabled: { opacity: 0.6 },
|
syncButtonDisabled: { opacity: 0.6 },
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue