mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2025-04-27 10:24:44 +00:00
Swiftformat .
This commit is contained in:
parent
fd3d9fc2bc
commit
058500f91e
13 changed files with 27 additions and 32 deletions
|
@ -322,7 +322,7 @@ struct AccountDetailHeaderView: View {
|
||||||
.foregroundColor(.accentColor)
|
.foregroundColor(.accentColor)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ViewBuilder
|
@ViewBuilder
|
||||||
private func makeNoteView(_ note: String) -> some View {
|
private func makeNoteView(_ note: String) -> some View {
|
||||||
VStack(alignment: .leading, spacing: 4) {
|
VStack(alignment: .leading, spacing: 4) {
|
||||||
|
|
|
@ -371,7 +371,7 @@ public struct AccountDetailView: View {
|
||||||
}
|
}
|
||||||
|
|
||||||
extension View {
|
extension View {
|
||||||
@MainActor
|
@MainActor
|
||||||
func applyAccountDetailsRowStyle(theme: Theme) -> some View {
|
func applyAccountDetailsRowStyle(theme: Theme) -> some View {
|
||||||
listRowInsets(.init())
|
listRowInsets(.init())
|
||||||
.listRowSeparator(.hidden)
|
.listRowSeparator(.hidden)
|
||||||
|
|
|
@ -49,8 +49,8 @@ public struct ConversationsListView: View {
|
||||||
}
|
}
|
||||||
} else if conversations.isEmpty, !viewModel.isLoadingFirstPage, !viewModel.isError {
|
} else if conversations.isEmpty, !viewModel.isLoadingFirstPage, !viewModel.isError {
|
||||||
PlaceholderView(iconName: "tray",
|
PlaceholderView(iconName: "tray",
|
||||||
title: "conversations.empty.title",
|
title: "conversations.empty.title",
|
||||||
message: "conversations.empty.message")
|
message: "conversations.empty.message")
|
||||||
} else if viewModel.isError {
|
} else if viewModel.isError {
|
||||||
ErrorView(title: "conversations.error.title",
|
ErrorView(title: "conversations.error.title",
|
||||||
message: "conversations.error.message",
|
message: "conversations.error.message",
|
||||||
|
|
|
@ -52,7 +52,7 @@ import UIKit
|
||||||
try? await Task.sleep(for: .seconds(0.1))
|
try? await Task.sleep(for: .seconds(0.1))
|
||||||
for delegate in observedSceneDelegate {
|
for delegate in observedSceneDelegate {
|
||||||
#if os(visionOS)
|
#if os(visionOS)
|
||||||
let newWidth = delegate.window?.bounds.size.width ?? 0
|
let newWidth = delegate.window?.bounds.size.width ?? 0
|
||||||
if delegate.windowWidth != newWidth {
|
if delegate.windowWidth != newWidth {
|
||||||
delegate.windowWidth = newWidth
|
delegate.windowWidth = newWidth
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@ import Combine
|
||||||
import SwiftUI
|
import SwiftUI
|
||||||
|
|
||||||
@MainActor
|
@MainActor
|
||||||
@Observable
|
@Observable
|
||||||
public final class Theme {
|
public final class Theme {
|
||||||
final class ThemeStorage {
|
final class ThemeStorage {
|
||||||
enum ThemeKey: String {
|
enum ThemeKey: String {
|
||||||
|
|
|
@ -46,7 +46,5 @@ public struct ErrorView: View {
|
||||||
#Preview {
|
#Preview {
|
||||||
ErrorView(title: "Error",
|
ErrorView(title: "Error",
|
||||||
message: "Error loading. Please try again",
|
message: "Error loading. Please try again",
|
||||||
buttonTitle: "Retry") {
|
buttonTitle: "Retry") {}
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,13 +52,10 @@ public struct NextPageView: View {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#Preview {
|
#Preview {
|
||||||
List {
|
List {
|
||||||
Text("Item 1")
|
Text("Item 1")
|
||||||
NextPageView {
|
NextPageView {}
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
.listStyle(.plain)
|
.listStyle(.plain)
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,15 +1,15 @@
|
||||||
import SwiftUI
|
|
||||||
import Network
|
import Network
|
||||||
|
import SwiftUI
|
||||||
|
|
||||||
@MainActor
|
@MainActor
|
||||||
public extension View {
|
public extension View {
|
||||||
func withPreviewsEnv() -> some View{
|
func withPreviewsEnv() -> some View {
|
||||||
environment(RouterPath())
|
environment(RouterPath())
|
||||||
.environment(Client(server: ""))
|
.environment(Client(server: ""))
|
||||||
.environment(CurrentAccount.shared)
|
.environment(CurrentAccount.shared)
|
||||||
.environment(UserPreferences.shared)
|
.environment(UserPreferences.shared)
|
||||||
.environment(CurrentInstance.shared)
|
.environment(CurrentInstance.shared)
|
||||||
.environment(PushNotificationsService.shared)
|
.environment(PushNotificationsService.shared)
|
||||||
.environment(QuickLook.shared)
|
.environment(QuickLook.shared)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,11 +42,11 @@ public enum SheetDestination: Identifiable, Hashable {
|
||||||
public static func == (lhs: SheetDestination, rhs: SheetDestination) -> Bool {
|
public static func == (lhs: SheetDestination, rhs: SheetDestination) -> Bool {
|
||||||
lhs.id == rhs.id
|
lhs.id == rhs.id
|
||||||
}
|
}
|
||||||
|
|
||||||
public func hash(into hasher: inout Hasher) {
|
public func hash(into hasher: inout Hasher) {
|
||||||
hasher.combine(id)
|
hasher.combine(id)
|
||||||
}
|
}
|
||||||
|
|
||||||
case newStatusEditor(visibility: Models.Visibility)
|
case newStatusEditor(visibility: Models.Visibility)
|
||||||
case editStatusEditor(status: Status)
|
case editStatusEditor(status: Status)
|
||||||
case replyToStatusEditor(status: Status)
|
case replyToStatusEditor(status: Status)
|
||||||
|
|
|
@ -33,8 +33,8 @@ public struct ExploreView: View {
|
||||||
if let results = viewModel.results[viewModel.searchQuery] {
|
if let results = viewModel.results[viewModel.searchQuery] {
|
||||||
if results.isEmpty, !viewModel.isSearching {
|
if results.isEmpty, !viewModel.isSearching {
|
||||||
PlaceholderView(iconName: "magnifyingglass",
|
PlaceholderView(iconName: "magnifyingglass",
|
||||||
title: "explore.search.empty.title",
|
title: "explore.search.empty.title",
|
||||||
message: "explore.search.empty.message")
|
message: "explore.search.empty.message")
|
||||||
.listRowBackground(theme.secondaryBackgroundColor)
|
.listRowBackground(theme.secondaryBackgroundColor)
|
||||||
.listRowSeparator(.hidden)
|
.listRowSeparator(.hidden)
|
||||||
} else {
|
} else {
|
||||||
|
@ -54,8 +54,8 @@ public struct ExploreView: View {
|
||||||
}
|
}
|
||||||
} else if viewModel.allSectionsEmpty {
|
} else if viewModel.allSectionsEmpty {
|
||||||
PlaceholderView(iconName: "magnifyingglass",
|
PlaceholderView(iconName: "magnifyingglass",
|
||||||
title: "explore.search.title",
|
title: "explore.search.title",
|
||||||
message: "explore.search.message-\(client.server)")
|
message: "explore.search.message-\(client.server)")
|
||||||
#if !os(visionOS)
|
#if !os(visionOS)
|
||||||
.listRowBackground(theme.secondaryBackgroundColor)
|
.listRowBackground(theme.secondaryBackgroundColor)
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -145,7 +145,7 @@ public final class Account: Codable, Identifiable, Hashable, Sendable, Equatable
|
||||||
bot = try container.decode(Bool.self, forKey: .bot)
|
bot = try container.decode(Bool.self, forKey: .bot)
|
||||||
discoverable = try container.decodeIfPresent(Bool.self, forKey: .discoverable)
|
discoverable = try container.decodeIfPresent(Bool.self, forKey: .discoverable)
|
||||||
moved = try container.decodeIfPresent(Account.self, forKey: .moved)
|
moved = try container.decodeIfPresent(Account.self, forKey: .moved)
|
||||||
|
|
||||||
if let displayName, !displayName.isEmpty {
|
if let displayName, !displayName.isEmpty {
|
||||||
cachedDisplayName = .init(stringValue: displayName)
|
cachedDisplayName = .init(stringValue: displayName)
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -154,8 +154,8 @@ public struct NotificationsListView: View {
|
||||||
case let .display(notifications, nextPageState):
|
case let .display(notifications, nextPageState):
|
||||||
if notifications.isEmpty {
|
if notifications.isEmpty {
|
||||||
PlaceholderView(iconName: "bell.slash",
|
PlaceholderView(iconName: "bell.slash",
|
||||||
title: "notifications.empty.title",
|
title: "notifications.empty.title",
|
||||||
message: "notifications.empty.message")
|
message: "notifications.empty.message")
|
||||||
#if !os(visionOS)
|
#if !os(visionOS)
|
||||||
.listRowBackground(theme.primaryBackgroundColor)
|
.listRowBackground(theme.primaryBackgroundColor)
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import DesignSystem
|
import DesignSystem
|
||||||
import SwiftUI
|
|
||||||
import Env
|
import Env
|
||||||
|
import SwiftUI
|
||||||
|
|
||||||
@MainActor
|
@MainActor
|
||||||
public struct TimelineContentFilterView: View {
|
public struct TimelineContentFilterView: View {
|
||||||
|
@ -32,7 +32,7 @@ public struct TimelineContentFilterView: View {
|
||||||
#if !os(visionOS)
|
#if !os(visionOS)
|
||||||
.listRowBackground(theme.primaryBackgroundColor)
|
.listRowBackground(theme.primaryBackgroundColor)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
Section {
|
Section {
|
||||||
if currentInstance.isFiltersSupported {
|
if currentInstance.isFiltersSupported {
|
||||||
Button {
|
Button {
|
||||||
|
|
Loading…
Reference in a new issue