@@ -10,12 +10,17 @@ import DesignSystem
1010import CommunityDomain
1111import MyPageDomain
1212import SharedUI
13+ import CommunityDI
14+ import CommunityPresentation
1315
1416public struct MyActivitiesView : View {
1517 @State private var viewModel : MyActivitiesViewModel
1618
19+ private let communityDIContainer : CommunityDIContainer
20+
1721 public init ( viewModel: MyActivitiesViewModel ) {
1822 self . _viewModel = State ( initialValue: viewModel)
23+ self . communityDIContainer = . init( appContainer: . shared)
1924 }
2025
2126 public var body : some View {
@@ -62,19 +67,18 @@ public struct MyActivitiesView: View {
6267 @ViewBuilder
6368 private var contentView : some View {
6469 if viewModel. selectedTab == . posts {
65- MyBoardsListView (
70+ CommunityListView (
6671 boards: viewModel. myBoards,
67- isLoadingMore: viewModel. isLoadingMoreBoards,
68- onLoadMore: { index in
69- if index >= viewModel. myBoards. count - 3 {
70- Task { await viewModel. loadMoreBoards ( ) }
71- }
72- }
72+ detailFactory: communityDIContainer,
73+ updateFactory: communityDIContainer,
74+ reportFactory: communityDIContainer,
75+ viewModel: communityDIContainer. makeCommunityViewModel ( )
7376 )
7477 . padding ( . horizontal, 20 )
7578 . padding ( . vertical, 12 )
7679 } else {
7780 MyCommentsListView (
81+ communityDIContainer: communityDIContainer,
7882 comments: viewModel. myComments,
7983 isLoadingMore: viewModel. isLoadingMoreComments,
8084 onLoadMore: { index in
@@ -219,15 +223,22 @@ fileprivate struct MyBoardListCard: View {
219223
220224// MARK: - 댓글 리스트 뷰
221225struct MyCommentsListView : View {
226+ let communityDIContainer : CommunityDIContainer
222227 let comments : [ MyCommentActivity ]
223228 let isLoadingMore : Bool
224229 let onLoadMore : ( Int ) -> Void
225-
230+
226231 var body : some View {
227232 ScrollView {
228233 LazyVStack ( spacing: 0 ) {
229234 ForEach ( Array ( comments. enumerated ( ) ) , id: \. element. id) { index, comment in
230- NavigationLink ( destination: Text ( " Board Detail \( comment. boardId) " ) ) {
235+ NavigationLink (
236+ destination: CommunityDetailView (
237+ viewModel: communityDIContainer. makeDetailViewModel ( ) ,
238+ boardId: Int ( comment. boardId) ,
239+ updateFactory: communityDIContainer,
240+ reportFactory: communityDIContainer
241+ ) ) {
231242 MyCommentActivityCard ( comment: comment)
232243 }
233244 . buttonStyle ( PlainButtonStyle ( ) )
@@ -243,12 +254,12 @@ struct MyCommentsListView: View {
243254 . padding ( . vertical, 16 )
244255 }
245256 }
257+ . cornerRadius ( 8 )
258+ . shadow ( color: Color . black. opacity ( 0.05 ) , radius: 2 , x: 0 , y: 1 )
246259 }
247- . background (
248- RoundedRectangle ( cornerRadius: 8 )
249- . fill ( Color . white)
250- . shadow ( color: Color . black. opacity ( 0.1 ) , radius: 4.5 , x: 0 , y: 0 )
251- )
260+ . scrollIndicators ( . hidden)
261+ . cornerRadius ( 8 )
262+ . shadow ( color: Color . black. opacity ( 0.05 ) , radius: 2 , x: 0 , y: 1 )
252263 }
253264}
254265
@@ -273,9 +284,10 @@ fileprivate struct MyCommentActivityCard: View {
273284 }
274285
275286 HStack ( spacing: 4 ) {
276- Image ( " community_commnet " , bundle: . main)
277- . foregroundColor ( Color . textG600)
278- . font ( . system( size: 12 ) )
287+ Image ( " community_comment " , bundle: . main)
288+ . resizable ( )
289+ . foregroundColor ( . white)
290+ . frame ( width: 12 , height: 12 )
279291
280292 Text ( comment. content)
281293 . pretendard ( . caption( . base) )
@@ -284,8 +296,7 @@ fileprivate struct MyCommentActivityCard: View {
284296 . truncationMode ( . tail)
285297 }
286298 }
287- . padding ( . horizontal, 16 )
288- . padding ( . vertical, 16 )
299+ . padding ( 16 )
289300 . background ( Color . white)
290301 }
291302}
0 commit comments