diff --git a/Hambug/ContentView.swift b/Hambug/ContentView.swift index b6dbaa9..b67f396 100644 --- a/Hambug/ContentView.swift +++ b/Hambug/ContentView.swift @@ -12,8 +12,8 @@ import HomeDI import CommunityPresentation import CommunityDI import SharedUI -//import MyPagePresentation -//import MyPageDI +import MyPagePresentation +import MyPageDI struct ContentView: View { @Environment(AppDIContainer.self) var appContainer @@ -26,9 +26,9 @@ struct ContentView: View { CommunityDIContainer(appContainer: appContainer) } -// private var mypageDIContainer: MyPageDIContainer { -// MyPageDIContainer(appContainer: appContainer) -// } + private var mypageDIContainer: MyPageDIContainer { + MyPageDIContainer(appContainer: appContainer) + } @State private var selectedTab: Int = 0 diff --git a/Home/Package.swift b/Home/Package.swift index 8e82dab..98d24b2 100644 --- a/Home/Package.swift +++ b/Home/Package.swift @@ -33,6 +33,7 @@ let package = Package( .package(name: "Common", path: "../Common"), .package(name: "DI", path: "../DI"), .package(name: "Infrastructure", path: "../Infrastructure"), + .package(name: "Community", path: "../Community"), ], targets: [ .target( @@ -48,7 +49,12 @@ let package = Package( ], ), // Domain: 의존하지않음 - .target(config: .domain), + .target( + config: .domain, + dependencies: [ + .product(name: "CommunityDomain", package: "Community") + ] + ), // Data: Domain에 의존 .target( @@ -57,6 +63,8 @@ let package = Package( .target(config: .domain), .product(name: "NetworkInterface", package: "Infrastructure"), .product(name: "Util", package: "Common"), + .product(name: "SharedDomain", package: "Common"), + .product(name: "CommunityDomain", package: "Community"), ], ), @@ -67,6 +75,7 @@ let package = Package( .target(config: .domain), .product(name: "DesignSystem", package: "Common"), .product(name: "SharedUI", package: "Common"), + .product(name: "Community", package: "Community"), ], ), ] diff --git a/Home/Sources/Presentation/HomeView.swift b/Home/Sources/Presentation/HomeView.swift index 3e1a232..82e76e5 100644 --- a/Home/Sources/Presentation/HomeView.swift +++ b/Home/Sources/Presentation/HomeView.swift @@ -9,6 +9,8 @@ import SwiftUI import HomeDomain import DesignSystem import SharedUI +import CommunityDI +import CommunityPresentation public struct HomeView: View { @@ -49,9 +51,11 @@ public struct HomeView: View { struct PopularPostsView: View { private let postItems: [TrendingPost] - + private let communityDIContainer: CommunityDIContainer + init(postItems: [TrendingPost]) { self.postItems = postItems + self.communityDIContainer = .init(appContainer: .shared) } var body: some View { @@ -60,7 +64,15 @@ struct PopularPostsView: View { VStack(spacing: 0) { ForEach(postItems) { post in - PostView(post: post) + NavigationLink( + destination: CommunityDetailView( + viewModel: communityDIContainer.makeDetailViewModel(), + boardId: post.id, + updateFactory: communityDIContainer, + reportFactory: communityDIContainer + )) { + PostView(post: post) + } } } .background(.white) diff --git a/MyPage/Package.swift b/MyPage/Package.swift index e8cf787..5fc7542 100644 --- a/MyPage/Package.swift +++ b/MyPage/Package.swift @@ -75,9 +75,8 @@ let package = Package( .product(name: "LocalizedString", package: "Common"), .product(name: "SharedUI", package: "Common"), .product(name: "DesignSystem", package: "Common"), + .product(name: "Community", package: "Community"), .product(name: "CommunityDomain", package: "Community"), - .product(name: "CommunityPresentation", package: "Community"), - .product(name: "CommunityDI", package: "Community") ], path: Config.presentation.path ), diff --git a/MyPage/Sources/Presentation/MyActivitiesView.swift b/MyPage/Sources/Presentation/MyActivitiesView.swift index 73a5a75..13bd4ad 100644 --- a/MyPage/Sources/Presentation/MyActivitiesView.swift +++ b/MyPage/Sources/Presentation/MyActivitiesView.swift @@ -124,41 +124,6 @@ struct TabButton: View { } } -// MARK: - 게시글 리스트 뷰 -struct MyBoardsListView: View { - let boards: [Board] - let isLoadingMore: Bool - let onLoadMore: (Int) -> Void - - var body: some View { - ScrollView { - LazyVStack(spacing: 0) { - ForEach(Array(boards.enumerated()), id: \.element.id) { index, board in - NavigationLink(destination: Text("Board Detail \(board.id)")) { - MyBoardListCard(board: board) - } - .buttonStyle(PlainButtonStyle()) - .onAppear { onLoadMore(index) } - } - - if isLoadingMore { - HStack { - Spacer() - ProgressView() - Spacer() - } - .padding(.vertical, 16) - } - } - } - .background( - RoundedRectangle(cornerRadius: 8) - .fill(Color.white) - .shadow(color: Color.black.opacity(0.1), radius: 4.5, x: 0, y: 0) - ) - } -} - // MARK: - 게시글 카드 fileprivate struct MyBoardListCard: View { let board: Board diff --git a/hambug_logo.png b/hambug_logo.png deleted file mode 100644 index aa41842..0000000 Binary files a/hambug_logo.png and /dev/null differ