add carousel view to message details screen

pull/874/head
Ryan Zhao 2 years ago
parent 6568ab0d19
commit b4d414bbfe

@ -16,6 +16,7 @@ struct MessageInfoView: View {
Color.black
}
ScrollView(.vertical, showsIndicators: false) {
VStack(
alignment: .leading,
spacing: 10
@ -44,14 +45,29 @@ struct MessageInfoView: View {
.fixedSize(horizontal: true, vertical: true)
.padding(
EdgeInsets(
top: 10,
top: 8,
leading: 30,
bottom: 10,
bottom: 4,
trailing: 30
)
)
}
// TODO: Attachment carousel view
SessionCarouselView_SwiftUI(colors: [.orange, .gray, .blue, .yellow])
.frame(
maxWidth: .infinity,
maxHeight: .infinity,
alignment: .topLeading
)
.padding(
EdgeInsets(
top: 4,
leading: 0,
bottom: 4,
trailing: 0
)
)
// Attachment Info
if (messageViewModel.attachments?.isEmpty != false) {
@ -164,9 +180,9 @@ struct MessageInfoView: View {
.fixedSize(horizontal: false, vertical: true)
.padding(
EdgeInsets(
top: 10,
top: 4,
leading: 30,
bottom: 10,
bottom: 4,
trailing: 30
)
)
@ -261,9 +277,9 @@ struct MessageInfoView: View {
.fixedSize(horizontal: false, vertical: true)
.padding(
EdgeInsets(
top: 10,
top: 4,
leading: 30,
bottom: 10,
bottom: 4,
trailing: 30
)
)
@ -287,6 +303,7 @@ struct MessageInfoView: View {
}
}
}
}
struct MessageInfoView_Previews: PreviewProvider {
static var previews: some View {

@ -2,12 +2,17 @@
import SwiftUI
struct SessionCarouselView_SwiftUI: View {
public struct SessionCarouselView_SwiftUI: View {
@State var index = 0
var colors: [Color] = [.red, .orange, .blue]
var body: some View {
HStack {
var colors: [Color]
public init(colors: [Color]) {
self.colors = colors
}
public var body: some View {
HStack(spacing: 0) {
ArrowView(value: $index.animation(.easeInOut), range: 0...(colors.count - 1), type: .decrement)
.zIndex(1)
@ -175,7 +180,7 @@ struct SessionCarouselView_SwiftUI_Previews: PreviewProvider {
Color.black
}
SessionCarouselView_SwiftUI()
SessionCarouselView_SwiftUI(colors: [.red, .orange, .blue])
}
}
}

Loading…
Cancel
Save