From d615cbf736b42bdf45778f1b326d9bb7274f8b2e Mon Sep 17 00:00:00 2001 From: kwakjoohyeong Date: Sat, 20 Jul 2024 22:01:16 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20bookmark=20=EB=B2=84=ED=8A=BC=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core/ui/bookmark/BookmarkButton.kt | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/core/ui/src/main/java/com/withpeace/withpeace/core/ui/bookmark/BookmarkButton.kt b/core/ui/src/main/java/com/withpeace/withpeace/core/ui/bookmark/BookmarkButton.kt index 093586d3..e23809c6 100644 --- a/core/ui/src/main/java/com/withpeace/withpeace/core/ui/bookmark/BookmarkButton.kt +++ b/core/ui/src/main/java/com/withpeace/withpeace/core/ui/bookmark/BookmarkButton.kt @@ -4,14 +4,36 @@ import androidx.compose.foundation.Image import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.res.painterResource +import androidx.compose.ui.tooling.preview.Preview +import com.withpeace.withpeace.core.designsystem.theme.WithpeaceTheme +import com.withpeace.withpeace.core.ui.R @Composable fun BookmarkButton( modifier: Modifier = Modifier, + isClick: Boolean = false, ) { Image( modifier = modifier, - painter = painterResource(id = com.withpeace.withpeace.core.ui.R.drawable.ic_empty_heart), + painter = painterResource( + id = if (isClick) R.drawable.ic_heart else com.withpeace.withpeace.core.ui.R.drawable.ic_empty_heart, + ), contentDescription = "찜하기", ) +} + +@Composable +@Preview() +fun BookmarkButtonPreview() { + WithpeaceTheme { + BookmarkButton() + } +} + +@Composable +@Preview() +fun BookmarkButtonClickedPreview() { + WithpeaceTheme { + BookmarkButton(isClick = true) + } } \ No newline at end of file