feat: add isEnable property to AppButton
This commit is contained in:
parent
a797e0084c
commit
1eb282f3ac
|
|
@ -22,16 +22,20 @@ import com.syaroful.agrilinkvocpro.ui.theme.MainGreen
|
||||||
@Composable
|
@Composable
|
||||||
fun AppButton(
|
fun AppButton(
|
||||||
label: String,
|
label: String,
|
||||||
|
isEnable: Boolean = true,
|
||||||
onClick: () -> Unit,
|
onClick: () -> Unit,
|
||||||
){
|
) {
|
||||||
Button(
|
Button(
|
||||||
onClick = onClick,
|
onClick = onClick,
|
||||||
modifier = Modifier.fillMaxWidth().padding(16.dp),
|
modifier = Modifier
|
||||||
|
.fillMaxWidth()
|
||||||
|
.padding(16.dp),
|
||||||
shape = RoundedCornerShape(8.dp),
|
shape = RoundedCornerShape(8.dp),
|
||||||
colors = ButtonDefaults.buttonColors(
|
colors = ButtonDefaults.buttonColors(
|
||||||
containerColor = MainGreen,
|
containerColor = MainGreen,
|
||||||
contentColor = Color.White
|
contentColor = Color.White
|
||||||
),
|
),
|
||||||
|
enabled = isEnable,
|
||||||
contentPadding = PaddingValues(vertical = 16.dp, horizontal = 0.dp)
|
contentPadding = PaddingValues(vertical = 16.dp, horizontal = 0.dp)
|
||||||
) {
|
) {
|
||||||
Row(
|
Row(
|
||||||
|
|
@ -44,7 +48,7 @@ fun AppButton(
|
||||||
|
|
||||||
@Preview
|
@Preview
|
||||||
@Composable
|
@Composable
|
||||||
fun AppButtonPreview(){
|
fun AppButtonPreview() {
|
||||||
AppButton(
|
AppButton(
|
||||||
label = "Sign in",
|
label = "Sign in",
|
||||||
onClick = {}
|
onClick = {}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user