Skip to content

Commit

Permalink
Fix layout inconsistencies in ChatView
Browse files Browse the repository at this point in the history
This PR focuses on improving chat view layout as it is defined in design
Mainly it focuses on the spacing between tableview cells, but also improves
the design of GVA components.

MOB-2587
  • Loading branch information
rasmustautsglia committed Aug 28, 2023
1 parent 56c0e33 commit af132e2
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions GliaWidgets/Sources/Theme/Theme+Gva.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ extension Theme {
text: .init(
color: UIColor.black.hex,
font: font.bodyText,
textStyle: .body,
textStyle: .headline,
accessibility: .init(isFontScalingEnabled: true)
),
background: .init(
Expand Down Expand Up @@ -58,7 +58,7 @@ extension Theme {
borderWidth: 0
),
title: .init(
font: font.bodyText,
font: font.mediumSubtitle1,
textColor: .black,
textStyle: .body
),
Expand Down
6 changes: 3 additions & 3 deletions GliaWidgets/Sources/View/Chat/GVA/GvaResponseTextView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ final class GvaResponseTextView: ChatMessageView {
private let viewStyle: Theme.OperatorMessageStyle
private var operatorImageView: UserImageView?
private let operatorImageViewContainer = UIView().makeView()
private let imageViewInsets = UIEdgeInsets(top: 4, left: 8, bottom: 2, right: 60)
private let imageViewInsets = UIEdgeInsets(top: 8, left: 8, bottom: 2, right: 60)
private let operatorImageViewSize: CGFloat = 28
private let environment: Environment

Expand Down Expand Up @@ -69,7 +69,7 @@ final class GvaResponseTextView: ChatMessageView {
var constraints = [NSLayoutConstraint](); defer { constraints.activate() }
constraints += operatorImageViewContainer.match(value: operatorImageViewSize)
constraints += operatorImageViewContainer.leadingAnchor.constraint(equalTo: leadingAnchor, constant: imageViewInsets.left)
constraints += operatorImageViewContainer.bottomAnchor.constraint(equalTo: bottomAnchor)
constraints += operatorImageViewContainer.bottomAnchor.constraint(equalTo: bottomAnchor, constant: -imageViewInsets.top)
constraints += operatorImageViewContainer.topAnchor.constraint(greaterThanOrEqualTo: topAnchor, constant: imageViewInsets.top)

addSubview(contentViews)
Expand All @@ -78,7 +78,7 @@ final class GvaResponseTextView: ChatMessageView {
constraints += contentViews.topAnchor.constraint(equalTo: topAnchor, constant: imageViewInsets.top)
constraints += contentViews.trailingAnchor.constraint(lessThanOrEqualTo: trailingAnchor, constant: -imageViewInsets.right)

constraints += contentViews.bottomAnchor.constraint(equalTo: bottomAnchor)
constraints += contentViews.bottomAnchor.constraint(equalTo: bottomAnchor, constant: -imageViewInsets.top)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class OperatorChatMessageView: ChatMessageView {
private let viewStyle: Theme.OperatorMessageStyle
private var operatorImageView: UserImageView?
private var operatorImageViewContainer = UIView().makeView()
private let imageViewInsets = UIEdgeInsets(top: 2, left: 10, bottom: 2, right: 60)
private let imageViewInsets = UIEdgeInsets(top: 8, left: 8, bottom: 8, right: 60)
private let operatorImageViewSize: CGFloat = 28
private let environment: Environment

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class VisitorChatMessageView: ChatMessageView {
}

private let statusLabel = UILabel().makeView()
private let contentInsets = UIEdgeInsets(top: 2, left: 88, bottom: 2, right: 16)
private let contentInsets = UIEdgeInsets(top: 8, left: 88, bottom: 8, right: 16)

init(
with style: Theme.VisitorMessageStyle,
Expand Down

0 comments on commit af132e2

Please sign in to comment.