mirror of
https://github.com/bbara04/Purefin.git
synced 2026-07-24 03:36:51 +00:00
feat: add exit confirmation dialog on back navigation
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
package hu.bbara.purefin.ui.common.dialog
|
||||
|
||||
import androidx.compose.material3.AlertDialog
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.material3.TextButton
|
||||
import androidx.compose.runtime.Composable
|
||||
|
||||
@Composable
|
||||
fun ExitAppDialog(
|
||||
onCloseConfirmed: () -> Unit,
|
||||
onDismiss: () -> Unit
|
||||
) {
|
||||
AlertDialog(
|
||||
onDismissRequest = onDismiss,
|
||||
title = { Text("Close app?") },
|
||||
text = { Text("Are you sure?") },
|
||||
confirmButton = {
|
||||
TextButton(onClick = onCloseConfirmed) {
|
||||
Text("Close")
|
||||
}
|
||||
},
|
||||
dismissButton = {
|
||||
TextButton(onClick = onDismiss) {
|
||||
Text("Cancel")
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user