diff --git a/WordPress/Classes/ViewRelated/Comments/CommentContentTableViewCell.swift b/WordPress/Classes/ViewRelated/Comments/CommentContentTableViewCell.swift index bc2339eb721e..ac38e8fb77ce 100644 --- a/WordPress/Classes/ViewRelated/Comments/CommentContentTableViewCell.swift +++ b/WordPress/Classes/ViewRelated/Comments/CommentContentTableViewCell.swift @@ -28,8 +28,15 @@ class CommentContentTableViewCell: UITableViewCell, NibReusable { } } + // MARK: Constants + + private let customBottomSpacing: CGFloat = 10 + // MARK: Outlets + @IBOutlet private weak var containerStackView: UIStackView! + @IBOutlet private weak var containerStackBottomConstraint: NSLayoutConstraint! + @IBOutlet private weak var avatarImageView: CircularImageView! @IBOutlet private weak var nameLabel: UILabel! @IBOutlet private weak var dateLabel: UILabel! @@ -139,6 +146,13 @@ class CommentContentTableViewCell: UITableViewCell, NibReusable { isAccessoryButtonEnabled = comment.isApproved() isModerationEnabled = comment.allowsModeration() + // When reaction bar is hidden, add some space between the webview and the moderation bar. + containerStackView.setCustomSpacing(isReactionEnabled ? 0 : customBottomSpacing, after: webView) + + // When both reaction bar and moderation bar is hidden, the custom spacing for the webview won't be applied since it's at the bottom of the stack view. + // The reaction bar and the moderation bar have their own spacing, unlike the webview. Therefore, additional bottom spacing is needed. + containerStackBottomConstraint.constant = (isReactionEnabled || isModerationEnabled) ? 0 : customBottomSpacing + if isModerationEnabled { moderationBar.commentStatus = CommentStatusType.typeForStatus(comment.status) } diff --git a/WordPress/Classes/ViewRelated/Comments/CommentContentTableViewCell.xib b/WordPress/Classes/ViewRelated/Comments/CommentContentTableViewCell.xib index dc0c71ccf858..abd8dff0e832 100644 --- a/WordPress/Classes/ViewRelated/Comments/CommentContentTableViewCell.xib +++ b/WordPress/Classes/ViewRelated/Comments/CommentContentTableViewCell.xib @@ -1,9 +1,9 @@ - + - + @@ -106,7 +106,7 @@