diff --git a/Packages/Account/Sources/Account/AccountDetailHeaderView.swift b/Packages/Account/Sources/Account/AccountDetailHeaderView.swift index b056af26..4503be36 100644 --- a/Packages/Account/Sources/Account/AccountDetailHeaderView.swift +++ b/Packages/Account/Sources/Account/AccountDetailHeaderView.swift @@ -4,6 +4,7 @@ import DesignSystem import Env struct AccountDetailHeaderView: View { + @EnvironmentObject private var theme: Theme @EnvironmentObject private var quickLook: QuickLook @EnvironmentObject private var routeurPath: RouterPath @Environment(\.redactionReasons) private var reasons @@ -121,7 +122,7 @@ struct AccountDetailHeaderView: View { VStack { Text("\(count)") .font(.headline) - .foregroundColor(.brand) + .foregroundColor(theme.tintColor) Text(title) .font(.footnote) .foregroundColor(.gray) diff --git a/Packages/Account/Sources/Account/AccountDetailView.swift b/Packages/Account/Sources/Account/AccountDetailView.swift index 5cae44bf..f00b2262 100644 --- a/Packages/Account/Sources/Account/AccountDetailView.swift +++ b/Packages/Account/Sources/Account/AccountDetailView.swift @@ -8,6 +8,7 @@ import Env public struct AccountDetailView: View { @Environment(\.redactionReasons) private var reasons + @EnvironmentObject private var theme: Theme @EnvironmentObject private var client: Client @EnvironmentObject private var routeurPath: RouterPath @@ -178,7 +179,7 @@ public struct AccountDetailView: View { .foregroundColor(Color.green.opacity(0.80)) } Text(field.value.asSafeAttributedString) - .foregroundColor(.brand) + .foregroundColor(theme.tintColor) } .font(.body) } diff --git a/Packages/Account/Sources/Account/AccountDetailViewModel.swift b/Packages/Account/Sources/Account/AccountDetailViewModel.swift index 3e64e024..437f6fc7 100644 --- a/Packages/Account/Sources/Account/AccountDetailViewModel.swift +++ b/Packages/Account/Sources/Account/AccountDetailViewModel.swift @@ -164,7 +164,8 @@ class AccountDetailViewModel: ObservableObject, StatusesFetcher { case .statuses: tabState = .statuses(statusesState: .display(statuses: statuses, nextPageState: .hasNextPage)) case .favourites: - tabState = .statuses(statusesState: .display(statuses: favourites, nextPageState: .hasNextPage)) + tabState = .statuses(statusesState: .display(statuses: favourites, + nextPageState: favouritesNextPage != nil ? .hasNextPage : .none)) case .followedTags: tabState = .followedTags(tags: followedTags) } diff --git a/Packages/Account/Sources/Account/AccountsLIst/AccountsListViewModel.swift b/Packages/Account/Sources/Account/AccountsLIst/AccountsListViewModel.swift index a658ada0..1926fd22 100644 --- a/Packages/Account/Sources/Account/AccountsLIst/AccountsListViewModel.swift +++ b/Packages/Account/Sources/Account/AccountsLIst/AccountsListViewModel.swift @@ -72,7 +72,7 @@ class AccountsListViewModel: ObservableObject { Accounts.relationships(ids: accounts.map{ $0.id })) state = .display(accounts: accounts, relationships: relationships, - nextPageState: .hasNextPage) + nextPageState: link?.maxId != nil ? .hasNextPage : .none) } catch { } } @@ -104,7 +104,7 @@ class AccountsListViewModel: ObservableObject { self.nextPageId = link?.maxId state = .display(accounts: accounts, relationships: relationships, - nextPageState: .hasNextPage) + nextPageState: link?.maxId != nil ? .hasNextPage : .none) } catch { print(error) } diff --git a/Packages/Explore/Sources/Explore/ExploreView.swift b/Packages/Explore/Sources/Explore/ExploreView.swift index 5b3a7393..d586d846 100644 --- a/Packages/Explore/Sources/Explore/ExploreView.swift +++ b/Packages/Explore/Sources/Explore/ExploreView.swift @@ -8,6 +8,7 @@ import Shimmer import Account public struct ExploreView: View { + @EnvironmentObject private var theme: Theme @EnvironmentObject private var client: Client @EnvironmentObject private var routeurPath: RouterPath @@ -68,7 +69,7 @@ public struct ExploreView: View { .navigationBarTitleDisplayMode(.inline) } label: { Text("See more") - .foregroundColor(.brand) + .foregroundColor(theme.tintColor) } } } @@ -92,7 +93,7 @@ public struct ExploreView: View { .navigationBarTitleDisplayMode(.inline) } label: { Text("See more") - .foregroundColor(.brand) + .foregroundColor(theme.tintColor) } } } @@ -117,7 +118,7 @@ public struct ExploreView: View { .navigationBarTitleDisplayMode(.inline) } label: { Text("See more") - .foregroundColor(.brand) + .foregroundColor(theme.tintColor) } } } @@ -141,7 +142,7 @@ public struct ExploreView: View { .navigationBarTitleDisplayMode(.inline) } label: { Text("See more") - .foregroundColor(.brand) + .foregroundColor(theme.tintColor) } } } diff --git a/Packages/Notifications/Sources/Notifications/NotificationRowView.swift b/Packages/Notifications/Sources/Notifications/NotificationRowView.swift index f8e46415..03da8ae0 100644 --- a/Packages/Notifications/Sources/Notifications/NotificationRowView.swift +++ b/Packages/Notifications/Sources/Notifications/NotificationRowView.swift @@ -5,6 +5,7 @@ import Status import Env struct NotificationRowView: View { + @EnvironmentObject private var theme: Theme @EnvironmentObject private var routeurPath: RouterPath @Environment(\.redactionReasons) private var reasons @@ -33,7 +34,7 @@ struct NotificationRowView: View { ZStack(alignment: .center) { Circle() .strokeBorder(Color.white, lineWidth: 1) - .background(Circle().foregroundColor(Color.brand)) + .background(Circle().foregroundColor(theme.tintColor)) .frame(width: 24, height: 24) Image(systemName: type.iconName()) diff --git a/Packages/Status/Sources/Status/Row/StatusActionsView.swift b/Packages/Status/Sources/Status/Row/StatusActionsView.swift index 5af47f3f..0332c0f5 100644 --- a/Packages/Status/Sources/Status/Row/StatusActionsView.swift +++ b/Packages/Status/Sources/Status/Row/StatusActionsView.swift @@ -2,11 +2,14 @@ import SwiftUI import Models import Env import Network +import DesignSystem struct StatusActionsView: View { @EnvironmentObject private var routeurPath: RouterPath @ObservedObject var viewModel: StatusRowViewModel + let generator = UINotificationFeedbackGenerator() + @MainActor enum Actions: CaseIterable { case respond, boost, favourite, share @@ -36,6 +39,17 @@ struct StatusActionsView: View { return nil } } + + func tintColor(viewModel: StatusRowViewModel) -> Color? { + switch self { + case .respond, .share: + return nil + case .favourite: + return viewModel.isFavourited ? .yellow : nil + case .boost: + return viewModel.isReblogged ? .brand : nil + } + } } var body: some View { @@ -54,6 +68,7 @@ struct StatusActionsView: View { } label: { HStack(spacing: 2) { Image(systemName: action.iconName(viewModel: viewModel)) + .foregroundColor(action.tintColor(viewModel: viewModel)) if let count = action.count(viewModel: viewModel) { Text("\(count)") .font(.footnote) @@ -110,6 +125,7 @@ struct StatusActionsView: View { private func handleAction(action: Actions) { Task { + generator.notificationOccurred(.success) switch action { case .respond: routeurPath.navigate(to: .statusDetail(id: viewModel.status.reblog?.id ?? viewModel.status.id)) diff --git a/Packages/Status/Sources/Status/Row/StatusRowView.swift b/Packages/Status/Sources/Status/Row/StatusRowView.swift index c311b22e..7e570251 100644 --- a/Packages/Status/Sources/Status/Row/StatusRowView.swift +++ b/Packages/Status/Sources/Status/Row/StatusRowView.swift @@ -6,6 +6,7 @@ import Network public struct StatusRowView: View { @Environment(\.redactionReasons) private var reasons + @EnvironmentObject private var theme: Theme @EnvironmentObject private var client: Client @EnvironmentObject private var routeurPath: RouterPath @StateObject var viewModel: StatusRowViewModel @@ -24,7 +25,7 @@ public struct StatusRowView: View { if !viewModel.isEmbed { StatusActionsView(viewModel: viewModel) .padding(.vertical, 8) - .tint(viewModel.isFocused ? .brand : .gray) + .tint(viewModel.isFocused ? theme.tintColor : .gray) } } .onAppear {