mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-20 00:24:43 +02:00
Add MVVM-C for InfoSheet
This commit is contained in:
-34
@@ -100,37 +100,3 @@ class UserSessionOverviewViewModel: UserSessionOverviewViewModelType, UserSessio
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
extension UserSessionOverviewViewState {
|
||||
var bottomSheetTitle: String {
|
||||
cardViewData.verificationState.bottomSheetTitle
|
||||
}
|
||||
|
||||
var bottomSheetDescription: String {
|
||||
cardViewData.verificationState.bottomSheetDescription
|
||||
}
|
||||
}
|
||||
|
||||
private extension UserSessionInfo.VerificationState {
|
||||
var bottomSheetTitle: String {
|
||||
switch self {
|
||||
case .unverified:
|
||||
return VectorL10n.userSessionUnverifiedSessionTitle
|
||||
case .verified:
|
||||
return VectorL10n.userSessionVerifiedSessionTitle
|
||||
case .unknown:
|
||||
return ""
|
||||
}
|
||||
}
|
||||
|
||||
var bottomSheetDescription: String {
|
||||
switch self {
|
||||
case .unverified:
|
||||
return VectorL10n.userSessionUnverifiedSessionDescription
|
||||
case .verified:
|
||||
return VectorL10n.userSessionVerifiedSessionDescription
|
||||
case .unknown:
|
||||
return ""
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -82,11 +82,6 @@ struct UserSessionOverview: View {
|
||||
}
|
||||
}
|
||||
.accentColor(theme.colors.accent)
|
||||
.bottomSheet(isPresented: $viewModel.showBottomSheet) {
|
||||
InfoSheet(title: viewModel.viewState.bottomSheetTitle,
|
||||
description: viewModel.viewState.bottomSheetDescription,
|
||||
action: .init(text: VectorL10n.userSessionGotIt, action: { viewModel.showBottomSheet = false }))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user