diff --git a/core/designsystem/src/main/java/com/droidknights/app2023/core/designsystem/component/Card.kt b/core/designsystem/src/main/java/com/droidknights/app2023/core/designsystem/component/Card.kt index be606729..9f3f51f8 100644 --- a/core/designsystem/src/main/java/com/droidknights/app2023/core/designsystem/component/Card.kt +++ b/core/designsystem/src/main/java/com/droidknights/app2023/core/designsystem/component/Card.kt @@ -1,17 +1,22 @@ package com.droidknights.app2023.core.designsystem.component +import android.content.res.Configuration import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.size import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.material3.MaterialTheme import androidx.compose.material3.Surface import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color +import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp +import com.droidknights.app2023.core.designsystem.theme.KnightsTheme @Composable fun KnightsCard( modifier: Modifier = Modifier, - color: Color = Color(0xFFFFFFFF), + color: Color = MaterialTheme.colorScheme.surface, content: @Composable () -> Unit, ) { Surface( @@ -39,3 +44,12 @@ fun KnightsCard( content = content, ) } + +@Composable +@Preview(uiMode = Configuration.UI_MODE_NIGHT_YES) +@Preview(uiMode = Configuration.UI_MODE_NIGHT_NO) +private fun KnightsCardPreview() { + KnightsTheme { + KnightsCard(modifier = Modifier.size(320.dp, 160.dp), content = { }) + } +} diff --git a/feature/session/src/main/java/com/droidknights/app2023/feature/session/SessionCard.kt b/feature/session/src/main/java/com/droidknights/app2023/feature/session/SessionCard.kt index 9738450f..1c4b0b14 100644 --- a/feature/session/src/main/java/com/droidknights/app2023/feature/session/SessionCard.kt +++ b/feature/session/src/main/java/com/droidknights/app2023/feature/session/SessionCard.kt @@ -37,10 +37,7 @@ import java.time.format.DateTimeFormatter internal fun SessionCard( modifier: Modifier = Modifier, ) { - KnightsCard( - modifier = modifier, - color = MaterialTheme.colorScheme.surface, - ) { + KnightsCard(modifier = modifier) { Column( modifier = Modifier.padding(CardContentPadding) ) {