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
10 changes: 5 additions & 5 deletions Hambug/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down
11 changes: 10 additions & 1 deletion Home/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -48,7 +49,12 @@ let package = Package(
],
),
// Domain: 의존하지않음
.target(config: .domain),
.target(
config: .domain,
dependencies: [
.product(name: "CommunityDomain", package: "Community")
]
),

// Data: Domain에 의존
.target(
Expand All @@ -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"),
],
),

Expand All @@ -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"),
],
),
]
Expand Down
16 changes: 14 additions & 2 deletions Home/Sources/Presentation/HomeView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import SwiftUI
import HomeDomain
import DesignSystem
import SharedUI
import CommunityDI
import CommunityPresentation

public struct HomeView: View {

Expand Down Expand Up @@ -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 {
Expand All @@ -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)
Expand Down
3 changes: 1 addition & 2 deletions MyPage/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
),
Expand Down
35 changes: 0 additions & 35 deletions MyPage/Sources/Presentation/MyActivitiesView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Binary file removed hambug_logo.png
Binary file not shown.
Loading