From ae23e19210abe2821b384b7821ec8f6c3485c26c Mon Sep 17 00:00:00 2001 From: gbattistel Date: Tue, 21 Jan 2025 16:19:04 -0300 Subject: [PATCH] chore: added preview of the SipCredentialsView --- TelnyxWebRTCDemo/Views/SipCredentialsView.swift | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/TelnyxWebRTCDemo/Views/SipCredentialsView.swift b/TelnyxWebRTCDemo/Views/SipCredentialsView.swift index 6767be81..d6f855e6 100644 --- a/TelnyxWebRTCDemo/Views/SipCredentialsView.swift +++ b/TelnyxWebRTCDemo/Views/SipCredentialsView.swift @@ -10,6 +10,8 @@ struct SipCredentialsView: View { @State private var internalIsShowingCredentialsInput: Bool @State private var viewHeight: CGFloat = 0 + let kViewHeight: CGFloat = 300.0 + let onCredentialSelected: (SipCredential?) -> Void let onSignIn: (SipCredential?) -> Void @@ -59,7 +61,7 @@ struct SipCredentialsView: View { .offset(y: 0) .onAppear { withAnimation{ - viewHeight = 300 + viewHeight = kViewHeight } } .onDisappear { @@ -162,3 +164,16 @@ struct SipCredentialsView: View { } } } + +// MARK: - +struct SipCredentialsView_Previews: PreviewProvider { + @State static var isShowingCredentialsInput = true + + static var previews: some View { + SipCredentialsView( + isShowingCredentialsInput: $isShowingCredentialsInput, + onCredentialSelected: { _ in }, + onSignIn: { _ in } + ) + } +}