Created
September 20, 2019 06:48
-
-
Save d-srd/d85ff7e8b470297954de0f1802a7a36c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct MessageView: View { | |
let message: Message | |
var body: some View { | |
Text(message.content) | |
.multilineTextAlignment(.leading) | |
.fixedSize(horizontal: false, vertical: true) | |
.padding(.horizontal, 12) | |
.padding(.vertical, 4) | |
.background(message.sender == .me ? Color.blue : Color.gray) | |
.foregroundColor(message.sender == .me ? Color.white : Color.black) | |
.cornerRadius(16) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment