Skip to content

Commit 488bb42

Browse files
authored
Merge pull request #260 from YAPP-Github/BOOK-429-fix/#257
feat: thumbnail image에 border 추가
2 parents db135b5 + 5c4972a commit 488bb42

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

src/Projects/BKDesign/Sources/Components/Summary/BKBookSummaryView.swift

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,24 @@ public enum BKBookSummaryViewStyle {
4141
var showsExtraLabel: Bool { self == .big }
4242
var extraLabelTopOffset: CGFloat { showsExtraLabel ? BKInset.inset05 : .zero }
4343
var titleLabelNumberOfLines: Int { showsExtraLabel ? 2 : 1 }
44+
45+
var thumbnailBorderWidth: CGFloat {
46+
switch self {
47+
case .regular, .big, .record, .compact:
48+
return 1.0
49+
case .alreadyEnroll:
50+
return 0.0
51+
}
52+
}
53+
54+
var thumbnailBorderColor: UIColor {
55+
switch self {
56+
case .regular, .big, .record, .compact:
57+
return .bkBorderColor(.primary)
58+
case .alreadyEnroll:
59+
return .clear
60+
}
61+
}
4462
}
4563

4664
public class BKBookSummaryView: UIView {
@@ -251,6 +269,8 @@ public class BKBookSummaryView: UIView {
251269
publisherLabel.setText(text: publisher)
252270
thumbnail.clipsToBounds = true
253271
thumbnail.layer.cornerRadius = LayoutConstants.imageRadius
272+
thumbnail.layer.borderWidth = style.thumbnailBorderWidth
273+
thumbnail.layer.borderColor = style.thumbnailBorderColor.cgColor
254274

255275
if let imageURL = image {
256276
thumbnail.kf.setImage(with: imageURL)

src/Projects/BKPresentation/Sources/MainFlow/Home/View/HomeCardCell.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,9 @@ final class HomeCardCell: UICollectionViewCell {
9999
thumbnail.clipsToBounds = true
100100
thumbnail.layer.masksToBounds = true
101101
thumbnail.layer.cornerRadius = BKRadius.xsmall
102+
103+
thumbnail.layer.borderWidth = 1.0
104+
thumbnail.layer.borderColor = UIColor.bkBorderColor(.primary).cgColor
102105
}
103106

104107
func setupView() {

0 commit comments

Comments
 (0)