File tree Expand file tree Collapse file tree 1 file changed +4
-7
lines changed
firebaseai/ChatExample/Views Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -84,23 +84,20 @@ struct MessageView: View {
8484 var message : ChatMessage
8585
8686 private var participantLabel : String {
87- message. participant == . user ? " USER " : " MODEL "
88- }
89-
90- private var alignment : HorizontalAlignment {
91- message. participant == . user ? . trailing : . leading
87+ message. participant == . user ? " User " : " Model "
9288 }
9389
9490 var body : some View {
95- VStack ( alignment: alignment , spacing: 4 ) {
91+ VStack ( alignment: message . participant == . user ? . trailing : . leading , spacing: 4 ) {
9692 // Sender label
9793 Text ( participantLabel)
9894 . font ( . caption2)
9995 . fontWeight ( . medium)
10096 . foregroundColor ( . secondary)
97+ . textCase ( . uppercase)
10198 . padding ( . horizontal, 8 )
10299 . padding ( . vertical, 2 )
103- . frame ( maxWidth: . infinity, alignment: alignment )
100+ . frame ( maxWidth: . infinity, alignment: message . participant == . user ? . trailing : . leading )
104101
105102 // Message content
106103 HStack {
You can’t perform that action at this time.
0 commit comments