Skip to content

Commit

Permalink
[PBIOS-583] Add Props To PBMessage (#456)
Browse files Browse the repository at this point in the history
**What does this PR do?** 
[PBIOS-583] Add Props To PBMessage

### Checklist
- [x] **LABELS** - Add a label: `breaking`, `bug`, `improvement`,
`documentation`, or `enhancement`. See
[Labels](https://github.com/powerhome/playbook-apple/labels) for
descriptions.
- [x] **RELEASES** - Add the appropriate label: `Ready for Testing` /
`Ready for Release`
- [x] **TESTING** - Have you tested your story?

---------

Co-authored-by: isis.silva <isisms2602@gmail.com>
  • Loading branch information
RachelRadford21 and isismsilva authored Oct 18, 2024
1 parent 3c33e97 commit fdc2c1e
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions Sources/Playbook/Components/Message/PBMessage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ public struct PBMessage<Content: View>: View {
let changeTimeStampOnHover: Bool
let verticalPadding: CGFloat
let horizontalPadding: CGFloat
let messageAmPmStyle: PBTimestamp.AmPmStyle
let showMessageDate: Bool
let showMessageUser: Bool
let content: Content?
let timestampVariant: PBTimestamp.Variant
var isOnClick: Bool
Expand All @@ -35,6 +38,9 @@ public struct PBMessage<Content: View>: View {
changeTimeStampOnHover: Bool = false,
verticalPadding: CGFloat = Spacing.none,
horizontalPadding: CGFloat = Spacing.none,
messageAmPmStyle: PBTimestamp.AmPmStyle = .full,
showMessageDate: Bool = false,
showMessageUser: Bool = false,
isOnClick: Bool = false,
isLoading: Binding<Bool> = .constant(false),
onHeaderClick: (() -> Void)? = nil,
Expand All @@ -49,6 +55,9 @@ public struct PBMessage<Content: View>: View {
self.changeTimeStampOnHover = changeTimeStampOnHover
self.verticalPadding = verticalPadding
self.horizontalPadding = horizontalPadding
self.messageAmPmStyle = messageAmPmStyle
self.showMessageDate = showMessageDate
self.showMessageUser = showMessageUser
self.isOnClick = isOnClick
self._isLoading = isLoading
self.onHeaderClick = onHeaderClick
Expand Down Expand Up @@ -79,9 +88,9 @@ public struct PBMessage<Content: View>: View {
if let timestamp = timestamp {
PBTimestamp(
timestamp,
amPmStyle: .full,
showDate: false,
showUser: false,
amPmStyle: messageAmPmStyle,
showDate: showMessageDate,
showUser: showMessageUser,
variant: returnTimestamp(isHovering: isHovering)
)
}
Expand Down

0 comments on commit fdc2c1e

Please # to comment.