minor fix on document view swift ui

pull/874/head
ryanzhao 2 years ago
parent b9ba355008
commit 2a148f17d4

@ -16,13 +16,13 @@ struct DocumentView_SwiftUI: View {
var body: some View { var body: some View {
HStack( HStack(
alignment: .center, alignment: .center,
spacing: Values.mediumSpacing spacing: 0
) { ) {
ZStack { ZStack {
Rectangle() Rectangle()
.foregroundColor(themeColor: .messageBubble_overlay) .foregroundColor(themeColor: .messageBubble_overlay)
.frame( .frame(
width: <#T##CGFloat?#> width: 24 + Values.mediumSpacing
) )
Image(systemName: "doc") Image(systemName: "doc")
@ -55,6 +55,7 @@ struct DocumentView_SwiftUI: View {
alignment: .leading alignment: .leading
) { ) {
Text(attachment.documentFileName) Text(attachment.documentFileName)
.lineLimit(1)
.font(.system(size: Values.mediumFontSize)) .font(.system(size: Values.mediumFontSize))
.foregroundColor(themeColor: textColor) .foregroundColor(themeColor: textColor)
@ -62,6 +63,8 @@ struct DocumentView_SwiftUI: View {
.font(.system(size: Values.verySmallFontSize)) .font(.system(size: Values.verySmallFontSize))
.foregroundColor(themeColor: textColor) .foregroundColor(themeColor: textColor)
} }
.fixedSize(horizontal: false, vertical: true)
.padding(.horizontal, Values.mediumSpacing)
Image(systemName: (attachment.isAudio ? "play.fill" : "arrow.down")) Image(systemName: (attachment.isAudio ? "play.fill" : "arrow.down"))
.resizable() .resizable()
@ -72,7 +75,6 @@ struct DocumentView_SwiftUI: View {
width:24, width:24,
height: 24 height: 24
) )
} }
} }
} }
@ -89,8 +91,8 @@ struct DocumentView_SwiftUI_Previews: PreviewProvider {
textColor: .messageBubble_outgoingText textColor: .messageBubble_outgoingText
) )
.frame( .frame(
width: 300, width: 200,
height: 100 height: 58
) )
DocumentView_SwiftUI( DocumentView_SwiftUI(
@ -102,8 +104,8 @@ struct DocumentView_SwiftUI_Previews: PreviewProvider {
textColor: .messageBubble_outgoingText textColor: .messageBubble_outgoingText
) )
.frame( .frame(
width: 300, width: 200,
height: 100 height: 58
) )
} }
} }

Loading…
Cancel
Save