Skip to content

Commit

Permalink
[chore] #4 alert dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
Sangwook123 committed May 1, 2024
1 parent d7fbf57 commit 61d50d3
Showing 1 changed file with 37 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package org.sopt.designsystem.component.dialog

import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.material3.AlertDialog
import androidx.compose.material3.Text
import androidx.compose.material3.TextButton
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.text.style.TextAlign

@Composable
fun SoptAlertDialog(
title: String,
positiveLabel: String,
negativeLabel: String,
onClickPositive: () -> Unit,
onClickNegative: () -> Unit,
){
AlertDialog(
onDismissRequest = { onClickNegative() },
title = { Text(text = title, modifier = Modifier.fillMaxWidth(), textAlign = TextAlign.Center) },
dismissButton = {
TextButton(onClick = { onClickNegative() }) {
Text(text = negativeLabel, color = Color.Black)
}
},
confirmButton = {
TextButton(
onClick = {
onClickPositive()
}) {
Text(text = positiveLabel, color = Color.Black)
}
}
)
}

0 comments on commit 61d50d3

Please sign in to comment.