mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +00:00
Run SwiftFormat.
This commit is contained in:
@@ -11,7 +11,7 @@ import SwiftUI
|
||||
struct RoomListFilterView: View {
|
||||
let filter: RoomListFilter
|
||||
@Binding var isActive: Bool
|
||||
|
||||
|
||||
var body: some View {
|
||||
Toggle(isOn: $isActive) {
|
||||
Text(filter.localizedName)
|
||||
|
||||
+1
-1
@@ -37,7 +37,7 @@ struct RoomListFiltersEmptyStateView: View {
|
||||
}
|
||||
return L10n.screenRoomlistFilterMixedEmptyStateSubtitle
|
||||
}
|
||||
|
||||
|
||||
var body: some View {
|
||||
VStack(spacing: 24) {
|
||||
Text(emptyStateTitle)
|
||||
|
||||
@@ -49,7 +49,7 @@ struct HomeScreen: View {
|
||||
L10n.screenRoomlistMainSpaceTitle
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ToolbarContentBuilder
|
||||
private var toolbar: some ToolbarContent {
|
||||
ToolbarItem(placement: .navigationBarLeading) {
|
||||
@@ -70,7 +70,7 @@ struct HomeScreen: View {
|
||||
if #available(iOS 26, *) {
|
||||
ToolbarSpacer(.fixed, placement: .primaryAction)
|
||||
}
|
||||
|
||||
|
||||
ToolbarItem(placement: .primaryAction) {
|
||||
SpaceFiltersButton(selected: context.viewState.selectedSpaceFilter != nil) {
|
||||
context.send(viewAction: .spaceFilters)
|
||||
@@ -221,7 +221,7 @@ struct HomeScreen_Previews: PreviewProvider, TestablePreview {
|
||||
roomSummaryProvider: RoomSummaryProviderMock(.init(state: roomSummaryProviderState))))
|
||||
|
||||
let userSession = UserSessionMock(.init(clientProxy: clientProxy))
|
||||
|
||||
|
||||
return HomeScreenViewModel(userSession: userSession,
|
||||
selectedRoomPublisher: CurrentValueSubject<String?, Never>(nil).asCurrentValuePublisher(),
|
||||
appSettings: .volatile(),
|
||||
|
||||
@@ -79,7 +79,7 @@ struct HomeScreenEmptyStateLayout: Layout {
|
||||
|
||||
// Place the main view in the center if there is space, otherwise add it to the stack.
|
||||
guard let mainView else { return }
|
||||
|
||||
|
||||
let mainViewSize = mainView.sizeThatFits(proposal)
|
||||
if (y + mainViewSize.height / 2) < bounds.height / 2 {
|
||||
let center = CGPoint(x: bounds.midX, y: bounds.midY)
|
||||
|
||||
@@ -134,7 +134,7 @@ struct HomeScreenInviteCell: View {
|
||||
.fill(Color.compound.borderDisabled)
|
||||
.frame(height: 1 / UIScreen.main.scale)
|
||||
}
|
||||
|
||||
|
||||
private var title: String {
|
||||
room.name
|
||||
}
|
||||
@@ -199,7 +199,7 @@ struct HomeScreenInviteCell_Previews: PreviewProvider, TestablePreview {
|
||||
let clientProxy = ClientProxyMock(.init())
|
||||
|
||||
let userSession = UserSessionMock(.init(clientProxy: clientProxy))
|
||||
|
||||
|
||||
return HomeScreenViewModel(userSession: userSession,
|
||||
selectedRoomPublisher: CurrentValueSubject<String?, Never>(nil).asCurrentValuePublisher(),
|
||||
appSettings: .volatile(),
|
||||
|
||||
@@ -46,7 +46,7 @@ struct HomeScreenKnockedCell: View {
|
||||
}
|
||||
|
||||
// MARK: - Private
|
||||
|
||||
|
||||
private var mainContent: some View {
|
||||
VStack(alignment: .leading, spacing: 0) {
|
||||
VStack(alignment: .leading, spacing: 0) {
|
||||
@@ -86,7 +86,7 @@ struct HomeScreenKnockedCell: View {
|
||||
.fill(Color.compound.borderDisabled)
|
||||
.frame(height: 1 / UIScreen.main.scale)
|
||||
}
|
||||
|
||||
|
||||
private var title: String {
|
||||
room.name
|
||||
}
|
||||
@@ -131,7 +131,7 @@ struct HomeScreenKnockedCell_Previews: PreviewProvider, TestablePreview {
|
||||
let clientProxy = ClientProxyMock(.init())
|
||||
|
||||
let userSession = UserSessionMock(.init(clientProxy: clientProxy))
|
||||
|
||||
|
||||
return HomeScreenViewModel(userSession: userSession,
|
||||
selectedRoomPublisher: CurrentValueSubject<String?, Never>(nil).asCurrentValuePublisher(),
|
||||
appSettings: .volatile(),
|
||||
|
||||
+4
-4
@@ -21,21 +21,21 @@ struct HomeScreenRecoveryKeyConfirmationBanner: View {
|
||||
case .recoveryOutOfSync: L10n.confirmRecoveryKeyBannerTitle
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
var message: String {
|
||||
switch state {
|
||||
case .setUpRecovery: L10n.bannerSetUpRecoveryContent
|
||||
case .recoveryOutOfSync: L10n.confirmRecoveryKeyBannerMessage
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
var actionTitle: String {
|
||||
switch state {
|
||||
case .setUpRecovery: L10n.bannerSetUpRecoverySubmit
|
||||
case .recoveryOutOfSync: L10n.confirmRecoveryKeyBannerPrimaryButtonTitle
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
var primaryAction: HomeScreenViewAction {
|
||||
switch state {
|
||||
case .setUpRecovery: .setupRecovery
|
||||
@@ -119,7 +119,7 @@ struct HomeScreenRecoveryKeyConfirmationBanner_Previews: PreviewProvider, Testab
|
||||
roomSummaryProvider: RoomSummaryProviderMock(.init(state: .loading))))
|
||||
|
||||
let userSession = UserSessionMock(.init(clientProxy: clientProxy))
|
||||
|
||||
|
||||
return HomeScreenViewModel(userSession: userSession,
|
||||
selectedRoomPublisher: CurrentValueSubject<String?, Never>(nil).asCurrentValuePublisher(),
|
||||
appSettings: .volatile(),
|
||||
|
||||
@@ -140,7 +140,7 @@ struct HomeScreenRoomCell: View {
|
||||
CompoundIcon(\.videoCallSolid, size: .xSmall, relativeTo: .compound.bodySM)
|
||||
.accessibilityLabel(L10n.a11yNotificationsOngoingCall)
|
||||
}
|
||||
|
||||
|
||||
if room.badges.isMuteShown {
|
||||
CompoundIcon(\.notificationsOffSolid, size: .custom(15), relativeTo: .compound.bodyMD)
|
||||
.accessibilityLabel(L10n.a11yNotificationsMuted)
|
||||
@@ -159,7 +159,7 @@ struct HomeScreenRoomCell: View {
|
||||
.foregroundColor(room.isHighlighted ? .compound.iconAccentTertiary : .compound.iconQuaternary)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private var mentionIcon: some View {
|
||||
CompoundIcon(\.mention, size: .custom(15), relativeTo: .compound.bodyMD)
|
||||
.accessibilityLabel(L10n.a11yNotificationsNewMentions)
|
||||
@@ -252,7 +252,7 @@ struct HomeScreenRoomCell_Previews: PreviewProvider, TestablePreview {
|
||||
|
||||
static func makeViewModel(roomSummaryProvider: RoomSummaryProviderProtocol) -> HomeScreenViewModel {
|
||||
let userSession = UserSessionMock(.init(clientProxy: ClientProxyMock(.init(userID: "John Doe", roomSummaryProvider: roomSummaryProvider))))
|
||||
|
||||
|
||||
return HomeScreenViewModel(userSession: userSession,
|
||||
selectedRoomPublisher: CurrentValueSubject<String?, Never>(nil).asCurrentValuePublisher(),
|
||||
appSettings: .volatile(),
|
||||
|
||||
Reference in New Issue
Block a user