mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-22 01:22:46 +02:00
Configured and applied SwiftFormat
This commit is contained in:
committed by
Stefan Ceriu
parent
ff2e6ddfa7
commit
43c28d23b7
+2
-2
@@ -14,8 +14,8 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
import CommonKit
|
||||
import SwiftUI
|
||||
|
||||
struct UserSessionDetailsCoordinatorParameters {
|
||||
let userSessionInfo: UserSessionInfo
|
||||
@@ -63,6 +63,6 @@ final class UserSessionDetailsCoordinator: Coordinator, Presentable {
|
||||
}
|
||||
|
||||
func toPresentable() -> UIViewController {
|
||||
return userSessionDetailsHostingController
|
||||
userSessionDetailsHostingController
|
||||
}
|
||||
}
|
||||
|
||||
+3
-3
@@ -1,4 +1,4 @@
|
||||
//
|
||||
//
|
||||
// Copyright 2021 New Vector Ltd
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@@ -33,11 +33,11 @@ enum MockUserSessionDetailsScreenState: MockScreenState, CaseIterable {
|
||||
/// A list of screen state definitions
|
||||
static var allCases: [MockUserSessionDetailsScreenState] {
|
||||
// Each of the presence statuses
|
||||
return [.allSections, .sessionSectionOnly]
|
||||
[.allSections, .sessionSectionOnly]
|
||||
}
|
||||
|
||||
/// Generate the view struct for the screen state.
|
||||
var screenView: ([Any], AnyView) {
|
||||
var screenView: ([Any], AnyView) {
|
||||
let currentSessionInfo: UserSessionInfo
|
||||
switch self {
|
||||
case .allSections:
|
||||
|
||||
+2
-2
@@ -14,8 +14,8 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
import XCTest
|
||||
import RiotSwiftUI
|
||||
import XCTest
|
||||
|
||||
class UserSessionDetailsUITests: MockScreenTestCase {
|
||||
func test_longPressDetailsCell_CopiesValueToClipboard() throws {
|
||||
@@ -30,6 +30,6 @@ class UserSessionDetailsUITests: MockScreenTestCase {
|
||||
app.buttons["Copy"].tap()
|
||||
|
||||
let clipboard = try XCTUnwrap(UIPasteboard.general.string)
|
||||
XCTAssertEqual(clipboard,"iOS")
|
||||
XCTAssertEqual(clipboard, "iOS")
|
||||
}
|
||||
}
|
||||
|
||||
+1
-2
@@ -1,4 +1,4 @@
|
||||
//
|
||||
//
|
||||
// Copyright 2021 New Vector Ltd
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@@ -96,7 +96,6 @@ class UserSessionDetailsViewModelTests: XCTestCase {
|
||||
isVerified: isVerified,
|
||||
lastSeenIP: lastSeenIP,
|
||||
lastSeenTimestamp: lastSeenTimestamp)
|
||||
|
||||
}
|
||||
|
||||
private func sessionNameItem(sessionName: String) -> UserSessionDetailsSectionItemViewData {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//
|
||||
//
|
||||
// Copyright 2021 New Vector Ltd
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@@ -20,13 +20,11 @@ import Foundation
|
||||
|
||||
// MARK: View model
|
||||
|
||||
enum UserSessionDetailsViewModelResult {
|
||||
}
|
||||
enum UserSessionDetailsViewModelResult { }
|
||||
|
||||
// MARK: View
|
||||
|
||||
enum UserSessionDetailsViewAction {
|
||||
}
|
||||
enum UserSessionDetailsViewAction { }
|
||||
|
||||
struct UserSessionDetailsViewState: BindableState, Equatable {
|
||||
let sections: [UserSessionDetailsSectionViewData]
|
||||
@@ -48,14 +46,14 @@ struct UserSessionDetailsSectionItemViewData: Identifiable {
|
||||
extension UserSessionDetailsSectionViewData: Equatable {
|
||||
static func == (lhs: UserSessionDetailsSectionViewData, rhs: UserSessionDetailsSectionViewData) -> Bool {
|
||||
lhs.header == rhs.header &&
|
||||
lhs.footer == rhs.footer &&
|
||||
lhs.items == rhs.items
|
||||
lhs.footer == rhs.footer &&
|
||||
lhs.items == rhs.items
|
||||
}
|
||||
}
|
||||
|
||||
extension UserSessionDetailsSectionItemViewData: Equatable {
|
||||
static func == (lhs: UserSessionDetailsSectionItemViewData, rhs: UserSessionDetailsSectionItemViewData) -> Bool {
|
||||
lhs.title == rhs.title &&
|
||||
lhs.value == rhs.value
|
||||
lhs.value == rhs.value
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -17,8 +17,8 @@
|
||||
import Foundation
|
||||
|
||||
typealias UserSessionDetailsViewModelType = StateStoreViewModel<UserSessionDetailsViewState,
|
||||
Never,
|
||||
UserSessionDetailsViewAction>
|
||||
Never,
|
||||
UserSessionDetailsViewAction>
|
||||
|
||||
class UserSessionDetailsViewModel: UserSessionDetailsViewModelType, UserSessionDetailsViewModelProtocol {
|
||||
var completion: ((UserSessionDetailsViewModelResult) -> Void)?
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
//
|
||||
//
|
||||
// Copyright 2021 New Vector Ltd
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//
|
||||
//
|
||||
// Copyright 2021 New Vector Ltd
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
|
||||
+6
-6
@@ -1,4 +1,4 @@
|
||||
//
|
||||
//
|
||||
// Copyright 2022 New Vector Ltd
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@@ -28,7 +28,7 @@ struct UserSessionDetailsItem: View {
|
||||
}
|
||||
|
||||
var body: some View {
|
||||
HStack() {
|
||||
HStack {
|
||||
Text(viewData.title)
|
||||
.font(theme.fonts.subheadline)
|
||||
.foregroundColor(theme.colors.secondaryContent)
|
||||
@@ -59,10 +59,10 @@ struct UserSessionDetailsItem_Previews: PreviewProvider {
|
||||
List {
|
||||
UserSessionDetailsItem(viewData: UserSessionDetailsSectionItemViewData(title: "Session name",
|
||||
value: "Element Web: Firefox on macOS"))
|
||||
.listRowInsets(EdgeInsets())
|
||||
.listRowInsets(EdgeInsets())
|
||||
UserSessionDetailsItem(viewData: UserSessionDetailsSectionItemViewData(title: "Session ID",
|
||||
value: "76c95352559d-react-7c57680b93db-js-b64dbdce74b0"))
|
||||
.listRowInsets(EdgeInsets())
|
||||
.listRowInsets(EdgeInsets())
|
||||
}
|
||||
.preferredColorScheme(.light)
|
||||
|
||||
@@ -70,10 +70,10 @@ struct UserSessionDetailsItem_Previews: PreviewProvider {
|
||||
List {
|
||||
UserSessionDetailsItem(viewData: UserSessionDetailsSectionItemViewData(title: "Session name",
|
||||
value: "Element Web: Firefox on macOS"))
|
||||
.listRowInsets(EdgeInsets())
|
||||
.listRowInsets(EdgeInsets())
|
||||
UserSessionDetailsItem(viewData: UserSessionDetailsSectionItemViewData(title: "Session ID",
|
||||
value: "76c95352559d-react-7c57680b93db-js-b64dbdce74b0"))
|
||||
.listRowInsets(EdgeInsets())
|
||||
.listRowInsets(EdgeInsets())
|
||||
}
|
||||
.preferredColorScheme(.dark)
|
||||
.theme(.dark)
|
||||
|
||||
Reference in New Issue
Block a user