make the fake chat bubbles in landing screen scrollable

pull/891/head
Ryan ZHAO 10 months ago
parent c9130326bc
commit 63ca28b002

@ -209,35 +209,39 @@ struct FakeChat: View {
] ]
var body: some View { var body: some View {
VStack( ScrollView(showsIndicators: false) {
alignment: .leading, VStack(
spacing: 18 alignment: .leading,
) { spacing: 18
ForEach( ) {
0...(chatBubbles.count - 1), ForEach(
id: \.self 0...(chatBubbles.count - 1),
) { index in id: \.self
let chatBubble: ChatBubble = chatBubbles[index] ) { index in
let bubble = chatBubble let chatBubble: ChatBubble = chatBubbles[index]
.frame( let bubble = chatBubble
maxWidth: .infinity, .frame(
alignment: chatBubble.outgoing ? .trailing : .leading maxWidth: .infinity,
) alignment: chatBubble.outgoing ? .trailing : .leading
if index < numberOfBubblesShown {
bubble
.transition(
AnyTransition
.move(edge: .bottom)
.combined(with:.opacity.animation(.easeIn(duration: 0.68)))
) )
if index < numberOfBubblesShown {
bubble
.transition(
AnyTransition
.move(edge: .bottom)
.combined(with:.opacity.animation(.easeIn(duration: 0.68)))
)
}
} }
} }
.frame(maxWidth: .infinity)
.frame(
height: 320,
alignment: .bottom
)
.padding(.horizontal, 36)
} }
.frame( .fixedSize(horizontal: false, vertical: true)
height: 320,
alignment: .bottom
)
.padding(.horizontal, 36)
.onAppear { .onAppear {
guard numberOfBubblesShown < 4 else { return } guard numberOfBubblesShown < 4 else { return }

Loading…
Cancel
Save