Skip to content

Commit

Permalink
feat: bookmark 버튼 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
rhkrwngud445 committed Jul 20, 2024
1 parent ff1ff14 commit d615cbf
Showing 1 changed file with 23 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}

0 comments on commit d615cbf

Please sign in to comment.