reverting some of the performance improvements

This commit is contained in:
Mauro Romito
2023-10-18 11:51:03 +02:00
committed by Mauro
parent 6e8dff2ef6
commit 2b89721aa0
3 changed files with 3 additions and 22 deletions
+1 -2
View File
@@ -34,6 +34,7 @@ struct PillView: View {
.padding(.vertical, 4)
// for now design has defined no color so we will just use gray
.background(Capsule().foregroundColor(context.viewState.isOwnMention ? .compound.bgCriticalPrimary : .gray))
.frame(maxWidth: PillConstants.maxWidth)
.onChange(of: context.viewState.displayText) { _ in
didChangeText()
}
@@ -53,13 +54,11 @@ struct PillView_Previews: PreviewProvider, TestablePreview {
PillView(imageProvider: mockMediaProvider,
context: PillContext.mock(type: .loadedUser(isOwn: false))) { }
// To simulate the trimming that happens at UIKit level
.frame(maxWidth: PillConstants.maxWidth)
.previewDisplayName("Loaded Long")
PillView(imageProvider: mockMediaProvider,
context: PillContext.mock(type: .loadedUser(isOwn: true))) { }
// To simulate the trimming that happens at UIKit level
.frame(maxWidth: PillConstants.maxWidth)
.previewDisplayName("Loaded Long Own")
PillView(imageProvider: mockMediaProvider,
context: PillContext.mock(type: .allUsers)) { }
.previewDisplayName("All Users")