From 63ca28b0027d92bbfa09cf4d0dd3606e58687c5d Mon Sep 17 00:00:00 2001 From: Ryan ZHAO <> Date: Wed, 5 Jun 2024 14:11:36 +1000 Subject: [PATCH] make the fake chat bubbles in landing screen scrollable --- Session/Onboarding/LandingScreen.swift | 54 ++++++++++++++------------ 1 file changed, 29 insertions(+), 25 deletions(-) diff --git a/Session/Onboarding/LandingScreen.swift b/Session/Onboarding/LandingScreen.swift index 840ff0a36..216c71400 100644 --- a/Session/Onboarding/LandingScreen.swift +++ b/Session/Onboarding/LandingScreen.swift @@ -209,35 +209,39 @@ struct FakeChat: View { ] var body: some View { - VStack( - alignment: .leading, - spacing: 18 - ) { - ForEach( - 0...(chatBubbles.count - 1), - id: \.self - ) { index in - let chatBubble: ChatBubble = chatBubbles[index] - let bubble = chatBubble - .frame( - maxWidth: .infinity, - alignment: chatBubble.outgoing ? .trailing : .leading - ) - if index < numberOfBubblesShown { - bubble - .transition( - AnyTransition - .move(edge: .bottom) - .combined(with:.opacity.animation(.easeIn(duration: 0.68))) + ScrollView(showsIndicators: false) { + VStack( + alignment: .leading, + spacing: 18 + ) { + ForEach( + 0...(chatBubbles.count - 1), + id: \.self + ) { index in + let chatBubble: ChatBubble = chatBubbles[index] + let bubble = chatBubble + .frame( + maxWidth: .infinity, + alignment: chatBubble.outgoing ? .trailing : .leading ) + 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( - height: 320, - alignment: .bottom - ) - .padding(.horizontal, 36) + .fixedSize(horizontal: false, vertical: true) .onAppear { guard numberOfBubblesShown < 4 else { return }