Skip to content

Commit

Permalink
Merge pull request #105 from laco-dev/feature/#104
Browse files Browse the repository at this point in the history
[designsystem] KnightsCard 테마에 따라 색상 자동 변경
  • Loading branch information
laco-dev authored Jul 26, 2023
2 parents e6105e3 + 05f7efb commit 146cb32
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -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(
Expand Down Expand Up @@ -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 = { })
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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)
) {
Expand Down

0 comments on commit 146cb32

Please sign in to comment.