feat(creator-profile): 커뮤니티 섹션 UI 변경
This commit is contained in:
		@@ -210,60 +210,71 @@ struct UserProfileView: View {
 | 
			
		||||
                                        .padding(.horizontal, 24)
 | 
			
		||||
                                    }
 | 
			
		||||
                                    
 | 
			
		||||
                                    if viewModel.communityPostList.count > 0 {
 | 
			
		||||
                                        ScrollView(.horizontal, showsIndicators: false) {
 | 
			
		||||
                                            LazyHStack(spacing: 13.3) {
 | 
			
		||||
                                                if UserDefaults.int(forKey: .userId) == creatorProfile.creator.creatorId {
 | 
			
		||||
                                                    CreatorCommunityWriteItemView()
 | 
			
		||||
                                                        .onTapGesture {
 | 
			
		||||
                                                            AppState.shared.setAppStep(
 | 
			
		||||
                                                                step: .creatorCommunityWrite(
 | 
			
		||||
                                                                    onSuccess: creatorCommunityWriteSuccess
 | 
			
		||||
                                                                )
 | 
			
		||||
                                                            )
 | 
			
		||||
                                                        }
 | 
			
		||||
                                                }
 | 
			
		||||
                                                
 | 
			
		||||
                                                ForEach(0..<viewModel.communityPostList.count, id: \.self) { index in
 | 
			
		||||
                                                    let item = viewModel.communityPostList[index]
 | 
			
		||||
                                                    CreatorCommunityItemView(item: item)
 | 
			
		||||
                                                        .frame(width: 320)
 | 
			
		||||
                                                        .onTapGesture {
 | 
			
		||||
                                                            AppState.shared
 | 
			
		||||
                                                                .setAppStep(
 | 
			
		||||
                                                                    step: .creatorCommunityAll(creatorId: userId)
 | 
			
		||||
                                                                )
 | 
			
		||||
                                                        }
 | 
			
		||||
                                                        .background(
 | 
			
		||||
                                                            GeometryReader { geo in
 | 
			
		||||
                                                                Color.clear
 | 
			
		||||
                                                                    .preference(key: HeightPreferenceKey.self, value: geo.size.height)
 | 
			
		||||
                                                            }
 | 
			
		||||
                                                        )
 | 
			
		||||
                                                }
 | 
			
		||||
                                                
 | 
			
		||||
                                                CreatorCommunityMoreItemView {
 | 
			
		||||
                                                    AppState.shared
 | 
			
		||||
                                                        .setAppStep(
 | 
			
		||||
                                                            step: .creatorCommunityAll(creatorId: userId)
 | 
			
		||||
                                                        )
 | 
			
		||||
                                                }
 | 
			
		||||
                                            }
 | 
			
		||||
                                            .padding(.horizontal, 13.3)
 | 
			
		||||
                                            .frame(height: maxCommunityPostHeight)
 | 
			
		||||
                                            .onPreferenceChange(HeightPreferenceKey.self) { value in
 | 
			
		||||
                                                if let current = maxCommunityPostHeight {
 | 
			
		||||
                                                    maxCommunityPostHeight = max(current, value)
 | 
			
		||||
                                                } else {
 | 
			
		||||
                                                    maxCommunityPostHeight = value
 | 
			
		||||
                                                }
 | 
			
		||||
                                            }
 | 
			
		||||
                                    VStack(alignment: .leading, spacing: 14) {
 | 
			
		||||
                                        HStack(spacing: 0) {
 | 
			
		||||
                                            Text("커뮤니티")
 | 
			
		||||
                                                .font(.custom(Font.preBold.rawValue, size: 26))
 | 
			
		||||
                                                .foregroundColor(Color.white)
 | 
			
		||||
                                                .padding(.horizontal, 24)
 | 
			
		||||
                                            
 | 
			
		||||
                                            Spacer()
 | 
			
		||||
                                        }
 | 
			
		||||
                                    } else {
 | 
			
		||||
                                        if creatorProfile.creator.creatorId == UserDefaults.int(forKey: .userId) {
 | 
			
		||||
                                            CreatorCommunityNoPostsItemView(
 | 
			
		||||
                                                onSuccess: creatorCommunityWriteSuccess
 | 
			
		||||
                                            )
 | 
			
		||||
                                        if viewModel.communityPostList.count > 0 {
 | 
			
		||||
                                            ScrollView(.horizontal, showsIndicators: false) {
 | 
			
		||||
                                                LazyHStack(spacing: 14) {
 | 
			
		||||
                                                    if UserDefaults.int(forKey: .userId) == creatorProfile.creator.creatorId {
 | 
			
		||||
                                                        CreatorCommunityWriteItemView()
 | 
			
		||||
                                                            .onTapGesture {
 | 
			
		||||
                                                                AppState.shared.setAppStep(
 | 
			
		||||
                                                                    step: .creatorCommunityWrite(
 | 
			
		||||
                                                                        onSuccess: creatorCommunityWriteSuccess
 | 
			
		||||
                                                                    )
 | 
			
		||||
                                                                )
 | 
			
		||||
                                                            }
 | 
			
		||||
                                                    }
 | 
			
		||||
                                                    
 | 
			
		||||
                                                    ForEach(0..<viewModel.communityPostList.count, id: \.self) { index in
 | 
			
		||||
                                                        let item = viewModel.communityPostList[index]
 | 
			
		||||
                                                        CreatorCommunityItemView(item: item)
 | 
			
		||||
                                                            .frame(width: 320)
 | 
			
		||||
                                                            .onTapGesture {
 | 
			
		||||
                                                                AppState.shared
 | 
			
		||||
                                                                    .setAppStep(
 | 
			
		||||
                                                                        step: .creatorCommunityAll(creatorId: userId)
 | 
			
		||||
                                                                    )
 | 
			
		||||
                                                            }
 | 
			
		||||
                                                            .background(
 | 
			
		||||
                                                                GeometryReader { geo in
 | 
			
		||||
                                                                    Color.clear
 | 
			
		||||
                                                                        .preference(key: HeightPreferenceKey.self, value: geo.size.height)
 | 
			
		||||
                                                                }
 | 
			
		||||
                                                            )
 | 
			
		||||
                                                    }
 | 
			
		||||
                                                    
 | 
			
		||||
                                                    CreatorCommunityMoreItemView {
 | 
			
		||||
                                                        AppState.shared
 | 
			
		||||
                                                            .setAppStep(
 | 
			
		||||
                                                                step: .creatorCommunityAll(creatorId: userId)
 | 
			
		||||
                                                            )
 | 
			
		||||
                                                    }
 | 
			
		||||
                                                }
 | 
			
		||||
                                                .padding(.horizontal, 24)
 | 
			
		||||
                                                .frame(height: maxCommunityPostHeight)
 | 
			
		||||
                                                .onPreferenceChange(HeightPreferenceKey.self) { value in
 | 
			
		||||
                                                    if let current = maxCommunityPostHeight {
 | 
			
		||||
                                                        maxCommunityPostHeight = max(current, value)
 | 
			
		||||
                                                    } else {
 | 
			
		||||
                                                        maxCommunityPostHeight = value
 | 
			
		||||
                                                    }
 | 
			
		||||
                                                }
 | 
			
		||||
                                            }
 | 
			
		||||
                                        } else {
 | 
			
		||||
                                            if creatorProfile.creator.creatorId == UserDefaults.int(forKey: .userId) {
 | 
			
		||||
                                                CreatorCommunityNoPostsItemView(
 | 
			
		||||
                                                    onSuccess: creatorCommunityWriteSuccess
 | 
			
		||||
                                                )
 | 
			
		||||
                                                .padding(.horizontal, 24)
 | 
			
		||||
                                            }
 | 
			
		||||
                                        }
 | 
			
		||||
                                    }
 | 
			
		||||
                                    
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user