Skip to content

Commit

Permalink
[feat] #187 신고하기 경고 시트 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
ShapeKim98 committed Mar 1, 2025
1 parent 78684f5 commit aa6c3cd
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 7 deletions.
3 changes: 3 additions & 0 deletions Projects/App/Sources/MainTab/MainTabPath.swift
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ public extension MainTabFeature {
category: category
)))
return .none

case .recommend(.delegate(.컨텐츠_신고_API_반영)):
return .send(.inner(.링크팝업_활성화(.report(title: "신고가 완료되었습니다"))))

/// - 포킷 `추가` 버튼 눌렀을 때
case .delegate(.포킷추가하기),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public struct RecommendFeature {
var interests: [BaseInterest] { domain.interests }
var showKeywordSheet: Bool = false
var selectedInterestList = Set<BaseInterest>()
var linkPopup: PokitLinkPopup.PopupType?
var reportContent: BaseContentItem?
}

/// - Action
Expand All @@ -71,6 +71,7 @@ public struct RecommendFeature {
case 추가하기_버튼_눌렀을때(BaseContentItem)
case 공유하기_버튼_눌렀을때(BaseContentItem)
case 신고하기_버튼_눌렀을때(BaseContentItem)
case 신고하기_확인_버튼_눌렀을때(BaseContentItem)
case 전체보기_버튼_눌렀을때(ScrollViewProxy)
case 관심사_버튼_눌렀을때(BaseInterest, ScrollViewProxy)
case 관심사_편집_버튼_눌렀을때
Expand All @@ -79,6 +80,7 @@ public struct RecommendFeature {
case 검색_버튼_눌렀을때
case 알림_버튼_눌렀을때
case 추천_컨텐츠_눌렀을때(String)
case 경고시트_dismiss
}

public enum InnerAction: Equatable {
Expand All @@ -103,6 +105,7 @@ public struct RecommendFeature {
case 추가하기_버튼_눌렀을때(Int)
case 검색_버튼_눌렀을때
case 알림_버튼_눌렀을때
case 컨텐츠_신고_API_반영
}
}

Expand Down Expand Up @@ -159,8 +162,12 @@ private extension RecommendFeature {
case let .공유하기_버튼_눌렀을때(content):
state.shareContent = content
return .none
case let .신고하기_버튼_눌렀을때(content):
case let .신고하기_확인_버튼_눌렀을때(content):
state.reportContent = nil
return shared(.async(.컨텐츠_신고_API(content.id)), state: &state)
case let .신고하기_버튼_눌렀을때(content):
state.reportContent = content
return .none
case let .전체보기_버튼_눌렀을때(proxy):
guard state.selectedInterest != nil else { return .none }

Expand Down Expand Up @@ -204,6 +211,9 @@ private extension RecommendFeature {
await send(.async(.유저_관심사_조회_API))
await send(.async(.추천_조회_API))
}
case .경고시트_dismiss:
state.reportContent = nil
return .none
}
}

Expand Down Expand Up @@ -233,9 +243,8 @@ private extension RecommendFeature {
state.showKeywordSheet = true
return .none
case let .컨텐츠_신고_API_반영(contentId):
state.linkPopup = .report(title: "신고가 완료되었습니다")
state.domain.contentList.data?.removeAll(where: { $0.id == contentId })
return .none
return .send(.delegate(.컨텐츠_신고_API_반영))
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@ public extension RecommendView {
list
}
.ignoresSafeArea(edges: .bottom)
.overlay(if: store.linkPopup != nil, alignment: .bottom) {
PokitLinkPopup(type: $store.linkPopup)
}
.sheet(item: $store.shareContent) { content in
if let shareURL = URL(string: content.data) {
PokitShareSheet(
Expand All @@ -52,6 +49,15 @@ public extension RecommendView {
action: { send(.키워드_선택_버튼_눌렀을때) }
)
}
.sheet(item: $store.reportContent) { content in
PokitAlert(
"링크를 신고하시겠습니까?",
message: "명확한 사유가 있는 경우 신고해주시기 바랍니다. \nex)음란성/선정성 이미지, 영상, 텍스트 등의 콘텐츠\n욕설, 비속어, 모욕, 저속한 단어 등",
confirmText: "확인",
action: { send(.신고하기_확인_버튼_눌렀을때(content)) },
cancelAction: { send(.경고시트_dismiss) }
)
}
}
}
}
Expand Down

0 comments on commit aa6c3cd

Please sign in to comment.