Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ extension DependencyValues {
set { self[HomeFetchWebPagesUseCaseKey.self] = newValue }
}

var networkConnectivityUseCase: ObserveNetworkConnectivityUseCase {
var homeNetworkConnectivityUseCase: ObserveNetworkConnectivityUseCase {
get { self[HomeNetworkConnectivityUseCaseKey.self] }
set { self[HomeNetworkConnectivityUseCaseKey.self] = newValue }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ struct HomeFeature {
@Dependency(\.homeUndoDeleteWebPageUseCase) var undoDeleteWebPageUseCase
@Dependency(\.homeFetchTodosUseCase) var fetchTodosUseCase
@Dependency(\.homeFetchWebPagesUseCase) var fetchWebPagesUseCase
@Dependency(\.networkConnectivityUseCase) var networkConnectivityUseCase
@Dependency(\.homeNetworkConnectivityUseCase) var networkConnectivityUseCase
@Dependency(\.trackAnalyticsEventUseCase) var trackAnalyticsEventUseCase
@Dependency(\.continuousClock) var clock

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public final class HomeViewCoordinator {
$0.homeFetchWebPagesUseCase = container.resolve(FetchWebPagesUseCase.self)
$0.fetchReferenceItemsUseCase = container.resolve(FetchReferenceItemsUseCase.self)
$0.upsertTodoUseCase = container.resolve(UpsertTodoUseCase.self)
$0.networkConnectivityUseCase = container.resolve(ObserveNetworkConnectivityUseCase.self)
$0.homeNetworkConnectivityUseCase = container.resolve(ObserveNetworkConnectivityUseCase.self)
$0.trackAnalyticsEventUseCase = container.resolve(TrackAnalyticsEventUseCase.self)
}
self.store.send(.view(.startObserving))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ struct HomeStoreTestAdapter {
$0.homeUndoDeleteWebPageUseCase = undoDeleteWebPageUseCase
$0.homeFetchTodosUseCase = fetchTodosUseCase
$0.homeFetchWebPagesUseCase = fetchWebPagesUseCase
$0.networkConnectivityUseCase = networkConnectivityUseCase
$0.homeNetworkConnectivityUseCase = networkConnectivityUseCase
$0.trackAnalyticsEventUseCase = trackAnalyticsEventUseCase
$0.continuousClock = clock
configureDependencies?(&$0)
Expand Down
1 change: 1 addition & 0 deletions Application/Presentation/ProfileTab/Sources/.swiftlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
parent_config: ../../../../.swiftlint.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// HeatmapView.swift
// Presentation
// ProfileTab
//
// Created by 최윤진 on 3/2/26.
//
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// ProfileFeature+Dependencies.swift
// Presentation
// ProfileTab
//
// Created by opfic on 6/15/26.
//
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// ProfileFeature+State.swift
// Presentation
// ProfileTab
//
// Created by opfic on 6/15/26.
//
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// ProfileFeature.swift
// Presentation
// ProfileTab
//
// Created by opfic on 6/15/26.
//
Expand Down Expand Up @@ -73,7 +73,7 @@ struct ProfileFeature {
@Dependency(\.profileFetchImageDataUseCase) var fetchProfileImageDataUseCase
@Dependency(\.profileFetchTodosUseCase) var fetchTodosUseCase
@Dependency(\.profileUpsertStatusMessageUseCase) var upsertStatusMessageUseCase
@Dependency(\.networkConnectivityUseCase) var networkConnectivityUseCase
@Dependency(\.profileNetworkConnectivityUseCase) var networkConnectivityUseCase
@Dependency(\.profileFetchHeatmapActivityTypesUseCase) var fetchHeatmapActivityTypesUseCase
@Dependency(\.profileUpdateHeatmapActivityTypesUseCase) var updateHeatmapActivityTypesUseCase

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// ProfileHeatmapBuilder.swift
// Presentation
// ProfileTab
//
// Created by opfic on 6/15/26.
//
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
//
// ProfileRegularDetailView.swift
// ProfileTab
//
// Created by opfic on 7/6/26.
//

import SwiftUI
import PresentationShared

public struct ProfileRegularDetailView: View {
let coordinator: ProfileViewCoordinator

public init(coordinator: ProfileViewCoordinator) {
self.coordinator = coordinator
}

public var body: some View {
NavigationStack(path: navigationPath) {
Group {
if let route = coordinator.router.root {
ProfileDestinationView(
route: route,
coordinator: coordinator,
identifiesActivityDetail: true
)
} else {
ContentUnavailableView(
String(localized: "profile_select_detail"),
systemImage: "person.crop.circle"
)
}
}
.navigationDestination(for: ProfileRoute.self) { route in
ProfileDestinationView(
route: route,
coordinator: coordinator,
identifiesActivityDetail: true
)
}
}
.background(Color(.systemGroupedBackground).ignoresSafeArea())
}

private var navigationPath: Binding<[ProfileRoute]> {
Binding(
get: { coordinator.router.detailPath },
set: { coordinator.router.detailPath = $0 }
)
}
}

struct ProfileDestinationView: View {
let route: ProfileRoute
let coordinator: ProfileViewCoordinator
let identifiesActivityDetail: Bool

init(
route: ProfileRoute,
coordinator: ProfileViewCoordinator,
identifiesActivityDetail: Bool = false
) {
self.route = route
self.coordinator = coordinator
self.identifiesActivityDetail = identifiesActivityDetail
}

var body: some View {
switch route {
case .settings:
SettingsView(store: coordinator.settingsStore)
.environment(coordinator.router)
case .activity(let todoId):
activityDetailView(todoId: todoId)
case .theme:
@Bindable var settingsStore = coordinator.settingsStore
ThemeView(theme: $settingsStore.theme)
case .pushNotification:
PushNotificationSettingsView(store: coordinator.makePushNotificationSettingsStore())
case .account:
AccountView(store: coordinator.makeAccountStore())
}
}

@ViewBuilder
private func activityDetailView(todoId: String) -> some View {
if identifiesActivityDetail {
TodoDetailView(store: coordinator.makeTodoDetailStore(todoId: todoId))
.id(todoId)
} else {
TodoDetailView(store: coordinator.makeTodoDetailStore(todoId: todoId))
}
}
}
Comment thread
opficdev marked this conversation as resolved.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// ProfileView.swift
// Presentation
// ProfileTab
//
// Created by opfic on 5/7/25.
//
Expand All @@ -11,13 +11,13 @@ import Core
import Domain
import PresentationShared

struct ProfileView: View {
public struct ProfileView: View {
@Bindable var store: StoreOf<ProfileFeature>
@FocusState private var focused: Bool
let coordinator: ProfileViewCoordinator
let isCompactLayout: Bool

init(
public init(
coordinator: ProfileViewCoordinator,
isCompactLayout: Bool
) {
Expand All @@ -26,13 +26,13 @@ struct ProfileView: View {
self.isCompactLayout = isCompactLayout
}

var body: some View {
public var body: some View {
Group {
if isCompactLayout {
NavigationStack(path: navigationPath) {
profileContentView
.navigationDestination(for: ProfileRoute.self) { route in
profileDestinationView(route)
ProfileDestinationView(route: route, coordinator: coordinator)
}
}
} else {
Expand Down Expand Up @@ -242,24 +242,6 @@ struct ProfileView: View {
}
}

@ViewBuilder
private func profileDestinationView(_ route: ProfileRoute) -> some View {
switch route {
case .settings:
SettingsView(store: coordinator.settingsStore)
.environment(coordinator.router)
case .activity(let todoId):
TodoDetailView(store: coordinator.makeTodoDetailStore(todoId: todoId))
case .theme:
@Bindable var settingsStore = coordinator.settingsStore
ThemeView(theme: $settingsStore.theme)
case .pushNotification:
PushNotificationSettingsView(store: coordinator.makePushNotificationSettingsStore())
case .account:
AccountView(store: coordinator.makeAccountStore())
}
}

private var quarterPickerSheet: some View {
NavigationStack {
VStack(alignment: .leading, spacing: 20) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// ProfileViewCoordinator.swift
// Presentation
// ProfileTab
//
// Created by opfic on 5/21/26.
//
Expand All @@ -12,13 +12,13 @@ import PresentationShared

@MainActor
@Observable
final class ProfileViewCoordinator {
public final class ProfileViewCoordinator {
let store: StoreOf<ProfileFeature>
let settingsStore: StoreOf<SettingsFeature>
var router = NavigationRouter<ProfileRoute>()
private let container: DIContainer

init(container: DIContainer) {
public init(container: DIContainer) {
self.container = container
self.store = Store(initialState: ProfileFeature.State()) {
ProfileFeature()
Expand All @@ -27,7 +27,7 @@ final class ProfileViewCoordinator {
$0.profileFetchImageDataUseCase = container.resolve(FetchProfileImageDataUseCase.self)
$0.profileFetchTodosUseCase = container.resolve(FetchTodosUseCase.self)
$0.profileUpsertStatusMessageUseCase = container.resolve(UpsertStatusMessageUseCase.self)
$0.networkConnectivityUseCase = container.resolve(ObserveNetworkConnectivityUseCase.self)
$0.profileNetworkConnectivityUseCase = container.resolve(ObserveNetworkConnectivityUseCase.self)
$0.profileFetchHeatmapActivityTypesUseCase = container.resolve(FetchHeatmapActivityTypesUseCase.self)
$0.profileUpdateHeatmapActivityTypesUseCase = container.resolve(UpdateHeatmapActivityTypesUseCase.self)
}
Expand All @@ -36,8 +36,8 @@ final class ProfileViewCoordinator {
} withDependencies: {
$0.deleteAuthUseCase = container.resolve(DeleteAuthUseCase.self)
$0.signOutUseCase = container.resolve(SignOutUseCase.self)
$0.networkConnectivityUseCase = container.resolve(ObserveNetworkConnectivityUseCase.self)
$0.systemThemeUseCase = container.resolve(ObserveSystemThemeUseCase.self)
$0.profileNetworkConnectivityUseCase = container.resolve(ObserveNetworkConnectivityUseCase.self)
$0.profileSystemThemeUseCase = container.resolve(ObserveSystemThemeUseCase.self)
$0.updateSystemThemeUseCase = container.resolve(UpdateSystemThemeUseCase.self)
$0.fetchWebPageImageDirSizeUseCase = container.resolve(FetchWebPageImageDirSizeUseCase.self)
$0.clearWebPageImageDirectoryUseCase = container.resolve(ClearWebPageImageDirectoryUseCase.self)
Expand All @@ -46,7 +46,7 @@ final class ProfileViewCoordinator {
self.settingsStore.send(.startObserving)
}

func fetchData() {
public func fetchData() {
store.send(.fetchData)
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// AccountFeature.swift
// Presentation
// ProfileTab
//
// Created by opfic on 6/11/26.
//
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// AccountView.swift
// Presentation
// ProfileTab
//
// Created by opfic on 5/14/25.
//
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// PushNotificationSettingsFeature.swift
// Presentation
// ProfileTab
//
// Created by opfic on 6/12/26.
//
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// PushNotificationSettingsView.swift
// Presentation
// ProfileTab
//
// Created by opfic on 5/14/25.
//
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// SettingsFeature.swift
// Presentation
// ProfileTab
//
// Created by opfic on 6/12/26.
//
Expand Down Expand Up @@ -79,8 +79,8 @@ struct SettingsFeature {

@Dependency(\.deleteAuthUseCase) var deleteAuthUseCase
@Dependency(\.signOutUseCase) var signOutUseCase
@Dependency(\.networkConnectivityUseCase) var networkConnectivityUseCase
@Dependency(\.systemThemeUseCase) var systemThemeUseCase
@Dependency(\.profileNetworkConnectivityUseCase) var networkConnectivityUseCase
@Dependency(\.profileSystemThemeUseCase) var systemThemeUseCase
@Dependency(\.updateSystemThemeUseCase) var updateSystemThemeUseCase
@Dependency(\.fetchWebPageImageDirSizeUseCase) var fetchWebPageImageDirSizeUseCase
@Dependency(\.clearWebPageImageDirectoryUseCase) var clearWebPageImageDirectoryUseCase
Expand Down Expand Up @@ -158,12 +158,12 @@ extension DependencyValues {
set { self[SignOutUseCaseKey.self] = newValue }
}

var networkConnectivityUseCase: ObserveNetworkConnectivityUseCase {
var profileNetworkConnectivityUseCase: ObserveNetworkConnectivityUseCase {
get { self[ObserveNetworkConnectivityUseCaseKey.self] }
set { self[ObserveNetworkConnectivityUseCaseKey.self] = newValue }
}

var systemThemeUseCase: ObserveSystemThemeUseCase {
var profileSystemThemeUseCase: ObserveSystemThemeUseCase {
get { self[ObserveSystemThemeUseCaseKey.self] }
set { self[ObserveSystemThemeUseCaseKey.self] = newValue }
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// SettingsView.swift
// Presentation
// ProfileTab
//
// Created by opfic on 5/6/25.
//
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// ThemeView.swift
// Presentation
// ProfileTab
//
// Created by opfic on 5/6/25.
//
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// ActivityKindItem.swift
// Presentation
// ProfileTab
//
// Created by opfic on 4/4/26.
//
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// HeatmapActivityItem.swift
// Presentation
// ProfileTab
//
// Created by opfic on 3/2/26.
//
Expand Down
Loading
Loading