From 1f296314f408769ecf6d9c2b1b5af1951b8512a9 Mon Sep 17 00:00:00 2001 From: mudabbir-ahmad Date: Thu, 4 Dec 2025 13:29:00 +0000 Subject: [PATCH] Added Alert for Delete --- src/components/entity/modules/ModuleView.js | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/src/components/entity/modules/ModuleView.js b/src/components/entity/modules/ModuleView.js index c055efb..d1852ec 100644 --- a/src/components/entity/modules/ModuleView.js +++ b/src/components/entity/modules/ModuleView.js @@ -1,4 +1,4 @@ -import {StyleSheet, Text, View} from "react-native"; +import {Alert, StyleSheet, Text, View} from "react-native"; import FullWidthImage from "react-native-fullwidth-image"; import {Button, ButtonTray} from "../../UI/Button"; import Icons from "../../UI/Icons.js" @@ -10,6 +10,17 @@ const ModuleView = ({module, onDelete}) => { const handleDelete = () => onDelete(module); + const requestDelete = () => { + Alert.alert( + 'Delete Warning', + `Are you sure you want to delete module ${module.ModuleCode} ${module.ModuleName}?`, + [ + {text: 'cancel'}, + {text: 'Delete', onPress: handleDelete} + ] + ); + } + // View ----------------------- return ( @@ -28,9 +39,9 @@ const ModuleView = ({module, onDelete}) => {