Created
October 26, 2020 18:30
-
-
Save saroar/3a63874e68b41752e726928fb15b2c8c 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
var body: some View { | |
Group { | |
if !currenuser(chatMessageResponse.sender.id) { | |
HStack { | |
Group { | |
AsyncImage( | |
avatarLink: chatMessageResponse.sender.avatarUrl, | |
placeholder: Text("Loading ..."), | |
cache: self.cache, configuration: { | |
$0.resizable() | |
} | |
) | |
.aspectRatio(contentMode: .fit) | |
.frame(width: 40, height: 40) | |
.clipShape(Circle()) | |
Text(chatMessageResponse.messageBody) | |
.bold() | |
.padding(10) | |
.foregroundColor(Color.white) | |
.background(Color.blue) | |
.cornerRadius(10) | |
} | |
.background(colorScheme == .dark ? Color.black : Color.white) | |
Spacer() | |
} | |
.background(colorScheme == .dark ? Color.black : Color.white) | |
} else { | |
HStack { | |
Group { | |
Spacer() | |
Text(chatMessageResponse.messageBody) | |
.bold() | |
.foregroundColor(Color.white) | |
.padding(10) | |
.background(Color.red) | |
.cornerRadius(10) | |
AsyncImage( | |
avatarLink: chatMessageResponse.sender.avatarUrl, | |
placeholder: Text("Loading ..."), cache: self.cache, | |
configuration: { | |
$0.resizable() | |
} | |
) | |
.aspectRatio(contentMode: .fit) | |
.frame(width: 40, height: 40) | |
.clipShape(Circle()) | |
} | |
} | |
.background(colorScheme == .dark ? Color.black : Color.white) | |
} | |
} | |
.background(colorScheme == .dark ? Color.black : Color.white) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment