@@ -38,19 +38,25 @@ public struct MessageBubbleModifier: ViewModifier {
38
38
public var injectedBackgroundColor : UIColor ?
39
39
public var cornerRadius : CGFloat = 18
40
40
public var forceLeftToRight = false
41
+ public var topPadding : CGFloat = 0
42
+ public var bottomPadding : CGFloat = 0
41
43
42
44
public init (
43
45
message: ChatMessage ,
44
46
isFirst: Bool ,
45
47
injectedBackgroundColor: UIColor ? = nil ,
46
48
cornerRadius: CGFloat = 18 ,
47
- forceLeftToRight: Bool = false
49
+ forceLeftToRight: Bool = false ,
50
+ topPadding: CGFloat = 0 ,
51
+ bottomPadding: CGFloat = 0
48
52
) {
49
53
self . message = message
50
54
self . isFirst = isFirst
51
55
self . injectedBackgroundColor = injectedBackgroundColor
52
56
self . cornerRadius = cornerRadius
53
57
self . forceLeftToRight = forceLeftToRight
58
+ self . topPadding = topPadding
59
+ self . bottomPadding = bottomPadding
54
60
}
55
61
56
62
public func body( content: Content ) -> some View {
@@ -62,6 +68,8 @@ public struct MessageBubbleModifier: ViewModifier {
62
68
cornerRadius: cornerRadius
63
69
)
64
70
)
71
+ . padding ( . top, topPadding)
72
+ . padding ( . bottom, bottomPadding)
65
73
}
66
74
67
75
private var corners : UIRectCorner {
0 commit comments