manager: a small fix to WarningCard (#809)
This commit is contained in:
@@ -23,7 +23,6 @@ import androidx.compose.ui.graphics.Color
|
|||||||
import androidx.compose.ui.platform.LocalContext
|
import androidx.compose.ui.platform.LocalContext
|
||||||
import androidx.compose.ui.platform.LocalUriHandler
|
import androidx.compose.ui.platform.LocalUriHandler
|
||||||
import androidx.compose.ui.res.stringResource
|
import androidx.compose.ui.res.stringResource
|
||||||
import androidx.compose.ui.text.font.FontFamily
|
|
||||||
import androidx.compose.ui.tooling.preview.Preview
|
import androidx.compose.ui.tooling.preview.Preview
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import com.ramcosta.composedestinations.annotation.Destination
|
import com.ramcosta.composedestinations.annotation.Destination
|
||||||
@@ -232,7 +231,7 @@ private fun StatusCard(kernelVersion: KernelVersion, ksuVersion: Int?) {
|
|||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun WarningCard(
|
fun WarningCard(
|
||||||
message: String, color: Color = MaterialTheme.colorScheme.error, onClick: () -> Unit = {}
|
message: String, color: Color = MaterialTheme.colorScheme.error, onClick: (() -> Unit)? = null
|
||||||
) {
|
) {
|
||||||
ElevatedCard(
|
ElevatedCard(
|
||||||
colors = CardDefaults.elevatedCardColors(
|
colors = CardDefaults.elevatedCardColors(
|
||||||
@@ -242,18 +241,14 @@ fun WarningCard(
|
|||||||
Row(
|
Row(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
|
.then(onClick?.let { Modifier.clickable { it() } } ?: Modifier)
|
||||||
.padding(24.dp)
|
.padding(24.dp)
|
||||||
.clickable {
|
|
||||||
onClick()
|
|
||||||
}, verticalAlignment = Alignment.CenterVertically
|
|
||||||
) {
|
) {
|
||||||
Column() {
|
|
||||||
Text(
|
Text(
|
||||||
text = message, style = MaterialTheme.typography.bodyMedium
|
text = message, style = MaterialTheme.typography.bodyMedium
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
@@ -363,3 +358,12 @@ private fun StatusCardPreview() {
|
|||||||
StatusCard(KernelVersion(4, 10, 101), null)
|
StatusCard(KernelVersion(4, 10, 101), null)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Preview
|
||||||
|
@Composable
|
||||||
|
private fun WarningCardPreview() {
|
||||||
|
Column {
|
||||||
|
WarningCard(message = "Warning message")
|
||||||
|
WarningCard(message = "Warning message ", MaterialTheme.colorScheme.outlineVariant, onClick = {})
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user