Skip to content

Commit

Permalink
chore: added preview of the SipCredentialsView
Browse files Browse the repository at this point in the history
  • Loading branch information
gbattistel committed Jan 21, 2025
1 parent 5f71286 commit ae23e19
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion TelnyxWebRTCDemo/Views/SipCredentialsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -59,7 +61,7 @@ struct SipCredentialsView: View {
.offset(y: 0)
.onAppear {
withAnimation{
viewHeight = 300
viewHeight = kViewHeight
}
}
.onDisappear {
Expand Down Expand Up @@ -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 }
)
}
}

0 comments on commit ae23e19

Please sign in to comment.