From 722141be4c4a411ab693e708a8e9d3b12dcf5e0e Mon Sep 17 00:00:00 2001 From: boiledegg Date: Sat, 13 Jul 2024 03:16:06 +0900 Subject: [PATCH] =?UTF-8?q?[MOD/#62]=20=EA=B8=B0=ED=83=80=20=EC=BD=94?= =?UTF-8?q?=EB=93=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../designsystem/component/item/ScrapBox.kt | 38 ++++++++++--------- .../feature/calendar/scrap/CalendarScrap.kt | 25 +----------- 2 files changed, 22 insertions(+), 41 deletions(-) diff --git a/core/src/main/java/com/terning/core/designsystem/component/item/ScrapBox.kt b/core/src/main/java/com/terning/core/designsystem/component/item/ScrapBox.kt index a2f26072a..5e2399b91 100644 --- a/core/src/main/java/com/terning/core/designsystem/component/item/ScrapBox.kt +++ b/core/src/main/java/com/terning/core/designsystem/component/item/ScrapBox.kt @@ -1,5 +1,6 @@ package com.terning.core.designsystem.component.item +import android.util.Log import androidx.compose.foundation.background import androidx.compose.foundation.border import androidx.compose.foundation.layout.Box @@ -8,6 +9,7 @@ import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.width +import androidx.compose.foundation.layout.wrapContentHeight import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier @@ -19,6 +21,8 @@ import androidx.compose.ui.unit.dp import com.terning.core.designsystem.theme.CalPink import com.terning.core.designsystem.theme.CalPurple import com.terning.core.designsystem.theme.Grey150 +import com.terning.core.designsystem.theme.TerningPointTheme +import com.terning.core.designsystem.theme.TerningTheme import com.terning.core.designsystem.theme.White /** @@ -49,16 +53,8 @@ fun ScrapBox( .shadow( elevation = elevation, RoundedCornerShape(cornerRadius), - ) + ).background(scrapColor) ) { - Box( - modifier = Modifier - .background( - color = scrapColor, - shape = RoundedCornerShape(cornerRadius) - ) - .fillMaxSize() - ) Box( modifier = Modifier .fillMaxSize() @@ -90,12 +86,20 @@ fun BorderedScrapBoxPreview() { @Preview(showBackground = true) @Composable fun ShadowedScrapBoxPreview() { - ScrapBox( - modifier = Modifier - .height(height = 92.dp) - .fillMaxWidth(), - scrapColor = CalPurple, - cornerRadius = 10.dp, - elevation = 1.dp - ) {} + TerningPointTheme { + ScrapBox( + modifier = Modifier, + scrapColor = CalPurple, + cornerRadius = 10.dp, + elevation = 1.dp + ) { + InternItem( + imageUrl = "", + title = "[Someone] 콘텐츠 마케터 대학생", + dateDeadline = "3", + workingPeriod = "3", + isScraped = false + ) + } + } } \ No newline at end of file diff --git a/feature/src/main/java/com/terning/feature/calendar/scrap/CalendarScrap.kt b/feature/src/main/java/com/terning/feature/calendar/scrap/CalendarScrap.kt index d89c1e9b2..e7d7c5a3f 100644 --- a/feature/src/main/java/com/terning/feature/calendar/scrap/CalendarScrap.kt +++ b/feature/src/main/java/com/terning/feature/calendar/scrap/CalendarScrap.kt @@ -1,15 +1,10 @@ package com.terning.feature.calendar.scrap -import androidx.compose.foundation.layout.fillMaxWidth -import androidx.compose.foundation.layout.height import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier -import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import com.terning.core.designsystem.component.item.InternItem import com.terning.core.designsystem.component.item.ScrapBox -import com.terning.core.designsystem.theme.CalBlue1 -import com.terning.core.designsystem.theme.TerningPointTheme import com.terning.feature.calendar.models.Scrap @Composable @@ -18,12 +13,10 @@ fun CalendarScrap( modifier: Modifier = Modifier, ) { ScrapBox( + modifier = modifier, cornerRadius = 10.dp, scrapColor = scrap.backgroundColor, elevation = 1.dp, - modifier = modifier - .height(height = 92.dp) - .fillMaxWidth(), ) { InternItem( imageUrl = scrap.image.orEmpty(), @@ -33,20 +26,4 @@ fun CalendarScrap( isScraped = scrap.isScraped ) } -} - -@Preview(showBackground = true) -@Composable -fun CalendarScrapPreview() { - TerningPointTheme { - CalendarScrap( - scrap = Scrap( - text = "Task1_1", - backgroundColor = CalBlue1, - dDay = "1", - period = "3", - isScraped = true - ) - ) - } } \ No newline at end of file