Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,24 @@ public enum BKBookSummaryViewStyle {
var showsExtraLabel: Bool { self == .big }
var extraLabelTopOffset: CGFloat { showsExtraLabel ? BKInset.inset05 : .zero }
var titleLabelNumberOfLines: Int { showsExtraLabel ? 2 : 1 }

var thumbnailBorderWidth: CGFloat {
switch self {
case .regular, .big, .record, .compact:
return 1.0
case .alreadyEnroll:
return 0.0
}
}

var thumbnailBorderColor: UIColor {
switch self {
case .regular, .big, .record, .compact:
return .bkBorderColor(.primary)
case .alreadyEnroll:
return .clear
}
}
}

public class BKBookSummaryView: UIView {
Expand Down Expand Up @@ -251,6 +269,8 @@ public class BKBookSummaryView: UIView {
publisherLabel.setText(text: publisher)
thumbnail.clipsToBounds = true
thumbnail.layer.cornerRadius = LayoutConstants.imageRadius
thumbnail.layer.borderWidth = style.thumbnailBorderWidth
thumbnail.layer.borderColor = style.thumbnailBorderColor.cgColor

if let imageURL = image {
thumbnail.kf.setImage(with: imageURL)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@ final class HomeCardCell: UICollectionViewCell {
thumbnail.clipsToBounds = true
thumbnail.layer.masksToBounds = true
thumbnail.layer.cornerRadius = BKRadius.xsmall

thumbnail.layer.borderWidth = 1.0
thumbnail.layer.borderColor = UIColor.bkBorderColor(.primary).cgColor
}

func setupView() {
Expand Down