From 69bcb72061248b269356274c4193c45cae654ca4 Mon Sep 17 00:00:00 2001 From: GitStart <1501599+gitstart@users.noreply.github.com> Date: Tue, 30 May 2023 19:56:30 +0100 Subject: [PATCH] update delete app password confirmation modal (#803) --- src/view/screens/AppPasswords.tsx | 28 +++++++++------------------- 1 file changed, 9 insertions(+), 19 deletions(-) diff --git a/src/view/screens/AppPasswords.tsx b/src/view/screens/AppPasswords.tsx index 3adbf09d..ca60787d 100644 --- a/src/view/screens/AppPasswords.tsx +++ b/src/view/screens/AppPasswords.tsx @@ -1,6 +1,5 @@ import React from 'react' import {StyleSheet, TouchableOpacity, View} from 'react-native' -import {Alert} from 'view/com/util/Alert' import {FontAwesomeIcon} from '@fortawesome/react-native-fontawesome' import {ScrollView} from 'react-native-gesture-handler' import {Text} from '../com/util/text/Text' @@ -160,24 +159,15 @@ function AppPassword({ const store = useStores() const onDelete = React.useCallback(async () => { - Alert.alert( - 'Delete App Password', - `Are you sure you want to delete the app password "${name}"?`, - [ - { - text: 'Cancel', - style: 'cancel', - }, - { - text: 'Delete', - style: 'destructive', - onPress: async () => { - await store.me.deleteAppPassword(name) - Toast.show('App password deleted') - }, - }, - ], - ) + store.shell.openModal({ + name: 'confirm', + title: 'Delete App Password', + message: `Are you sure you want to delete the app password "${name}"?`, + async onPressConfirm() { + await store.me.deleteAppPassword(name) + Toast.show('App password deleted') + }, + }) }, [store, name]) const {contentLanguages} = store.preferences