크리에이터 채널 페이지 추가

This commit is contained in:
Yu Sung
2023-08-11 18:33:48 +09:00
parent a167840162
commit a8338e6fea
69 changed files with 4087 additions and 10 deletions

View File

@@ -0,0 +1,96 @@
//
// CheersReportDialogView.swift
// SodaLive
//
// Created by klaus on 2023/08/11.
//
import SwiftUI
struct CheersReportDialogView: View {
@Binding var isShowing: Bool
let confirmAction: (String) -> Void
@State private var selectedIndex: Int? = nil
let reasons = [
"원치 않는 상업성 콘텐츠 또는 스팸",
"아동 학대",
"증오심 표현 또는 노골적인 폭력",
"테러 조장",
"희롱 또는 괴롭힘",
"자살 또는 자해",
"잘못된 정보"
]
var body: some View {
ZStack {
Color.black
.opacity(0.7)
.ignoresSafeArea()
.onTapGesture { isShowing = false }
VStack(spacing: 13.3) {
Text("응원글 신고")
.font(.custom(Font.medium.rawValue, size: 16.7))
.foregroundColor(Color(hex: "eeeeee"))
VStack(spacing: 13.3) {
ForEach(0..<reasons.count, id: \.self) { index in
let reason = reasons[index]
HStack(spacing: 8) {
Image(selectedIndex == index ? "btn_radio_select_selected" : "btn_radio_select_normal")
.resizable()
.frame(width: 20, height: 20)
Text(reason)
.font(.custom(Font.medium.rawValue, size: 14))
.foregroundColor(Color(hex: "909090"))
Spacer()
}
.onTapGesture {
selectedIndex = index
}
}
}
.padding(.vertical, 3.3)
HStack(spacing: 26.7) {
Spacer()
Text("취소")
.font(.custom(Font.medium.rawValue, size: 13.3))
.foregroundColor(Color(hex: "9970ff"))
.onTapGesture {
isShowing = false
}
Text("신고")
.font(.custom(Font.medium.rawValue, size: 13.3))
.foregroundColor(Color(hex: "9970ff"))
.onTapGesture {
if let selectedIndex = selectedIndex {
isShowing = false
confirmAction(reasons[selectedIndex])
}
}
}
.padding(.top, 13.3)
}
.padding(24)
.frame(width: screenSize().width - 33.3)
.background(Color(hex: "222222"))
.cornerRadius(13.3)
}
}
}
struct CheersReportDialogView_Previews: PreviewProvider {
static var previews: some View {
CheersReportDialogView(
isShowing: .constant(false),
confirmAction: { _ in }
)
}
}

View File

@@ -0,0 +1,47 @@
//
// CheersReportMenuView.swift
// SodaLive
//
// Created by klaus on 2023/08/11.
//
import SwiftUI
struct CheersReportMenuView: View {
@Binding var isShowing: Bool
let onClickReport: () -> Void
var body: some View {
ZStack {
Color.black
.opacity(0.7)
.ignoresSafeArea()
.onTapGesture { isShowing = false }
VStack(spacing: 0) {
Spacer()
VStack(spacing: 13.3) {
HStack(spacing: 0) {
Text("신고하기")
.font(.custom(Font.medium.rawValue, size: 13.3))
.foregroundColor(.white)
Spacer()
}
.padding(.vertical, 8)
.padding(.horizontal, 26.7)
.contentShape(Rectangle())
.onTapGesture {
isShowing = false
onClickReport()
}
}
.padding(24)
.background(Color(hex: "222222"))
.cornerRadius(13.3, corners: [.topLeft, .topRight])
}
}
}
}

View File

@@ -0,0 +1,57 @@
//
// ProfileReportDialogView.swift
// SodaLive
//
// Created by klaus on 2023/08/11.
//
import SwiftUI
struct ProfileReportDialogView: View {
@Binding var isShowing: Bool
let confirmAction: () -> Void
var body: some View {
ZStack {
Color.black
.opacity(0.7)
.ignoresSafeArea()
.onTapGesture { isShowing = false }
VStack(spacing: 13.3) {
Text("프로필 사진 신고")
.font(.custom(Font.medium.rawValue, size: 16.7))
.foregroundColor(Color(hex: "eeeeee"))
Text("신고제도를 남용할 경우, 계정에 제약이 있을 수 있습니다.\n프로필 사진을 신고하시겠습니까?")
.font(.custom(Font.medium.rawValue, size: 13.3))
.foregroundColor(Color(hex: "909090"))
HStack(spacing: 26.7) {
Spacer()
Text("취소")
.font(.custom(Font.medium.rawValue, size: 13.3))
.foregroundColor(Color(hex: "9970ff"))
.onTapGesture {
isShowing = false
}
Text("신고")
.font(.custom(Font.medium.rawValue, size: 13.3))
.foregroundColor(Color(hex: "9970ff"))
.onTapGesture {
isShowing = false
confirmAction()
}
}
.padding(.top, 13.3)
}
.padding(24)
.frame(width: screenSize().width - 33.3)
.background(Color(hex: "222222"))
.cornerRadius(13.3)
}
}
}

View File

@@ -0,0 +1,86 @@
//
// ProfileReportMenuView.swift
// SodaLive
//
// Created by klaus on 2023/08/11.
//
import SwiftUI
struct ProfileReportMenuView: View {
@Binding var isShowing: Bool
let isBlockedUser: Bool
let userBlockAction: () -> Void
let userUnBlockAction: () -> Void
let userReportAction: () -> Void
let profileReportAction: () -> Void
var body: some View {
ZStack {
Color.black
.opacity(0.7)
.ignoresSafeArea()
.onTapGesture { isShowing = false }
VStack(spacing: 0) {
Spacer()
VStack(spacing: 13.3) {
HStack(spacing: 0) {
Text(isBlockedUser ? "사용자 차단해제" : "사용자 차단하기")
.font(.custom(Font.medium.rawValue, size: 13.3))
.foregroundColor(.white)
Spacer()
}
.padding(.vertical, 8)
.padding(.horizontal, 26.7)
.contentShape(Rectangle())
.onTapGesture {
isShowing = false
if isBlockedUser {
userUnBlockAction()
} else {
userBlockAction()
}
}
HStack(spacing: 0) {
Text("사용자 신고하기")
.font(.custom(Font.medium.rawValue, size: 13.3))
.foregroundColor(.white)
Spacer()
}
.padding(.vertical, 8)
.padding(.horizontal, 26.7)
.contentShape(Rectangle())
.onTapGesture {
isShowing = false
userReportAction()
}
HStack(spacing: 0) {
Text("프로필 신고하기")
.font(.custom(Font.medium.rawValue, size: 13.3))
.foregroundColor(.white)
Spacer()
}
.padding(.vertical, 8)
.padding(.horizontal, 26.7)
.contentShape(Rectangle())
.onTapGesture {
isShowing = false
profileReportAction()
}
}
.padding(24)
.background(Color(hex: "222222"))
.cornerRadius(13.3, corners: [.topLeft, .topRight])
}
}
}
}

View File

@@ -0,0 +1,44 @@
//
// ReportApi.swift
// SodaLive
//
// Created by klaus on 2023/08/11.
//
import Foundation
import Moya
enum ReportApi {
case report(request: ReportRequest)
}
extension ReportApi: TargetType {
var baseURL: URL {
return URL(string: BASE_URL)!
}
var path: String {
switch self {
case .report:
return "/report"
}
}
var method: Moya.Method {
switch self {
case .report:
return .post
}
}
var task: Task {
switch self {
case .report(let request):
return .requestJSONEncodable(request)
}
}
var headers: [String : String]? {
return ["Authorization": "Bearer \(UserDefaults.string(forKey: UserDefaultsKey.token))"]
}
}

View File

@@ -0,0 +1,19 @@
//
// ReportRepository.swift
// SodaLive
//
// Created by klaus on 2023/08/11.
//
import Foundation
import CombineMoya
import Combine
import Moya
class ReportRepository {
private let api = MoyaProvider<ReportApi>()
func report(request: ReportRequest) -> AnyPublisher<Response, MoyaError> {
return api.requestPublisher(.report(request: request))
}
}

View File

@@ -0,0 +1,21 @@
//
// ReportRequest.swift
// SodaLive
//
// Created by klaus on 2023/08/11.
//
import Foundation
struct ReportRequest: Encodable {
let type: ReportType
let reason: String
let reportedMemberId: Int?
let cheersId: Int?
let audioContentId: Int?
}
enum ReportType: String, Codable {
case PROFILE, USER, CHEERS, AUDIO_CONTENT
}

View File

@@ -0,0 +1,75 @@
//
// UserBlockConfirmDialogView.swift
// SodaLive
//
// Created by klaus on 2023/08/11.
//
import SwiftUI
struct UserBlockConfirmDialogView: View {
@Binding var isShowing: Bool
let nickname: String
let confirmAction: () -> Void
let notice = """
사용자를 차단하면 사용자는 아래 기능이 제한됩니다.
- 내가 개설한 라이브 입장 불가
- 나에게 메시지 보내기 불가
- 내 채널의 팬Talk 작성불가
"""
var body: some View {
ZStack {
Color.black
.opacity(0.7)
.ignoresSafeArea()
.onTapGesture { isShowing = false }
VStack(spacing: 13.3) {
Text("사용자 차단")
.font(.custom(Font.medium.rawValue, size: 16.7))
.foregroundColor(.white)
Text("\(nickname)님을 차단하시겠습니까?")
.font(.custom(Font.medium.rawValue, size: 13.3))
.foregroundColor(.white)
HStack(spacing: 0) {
Text(notice)
.font(.custom(Font.medium.rawValue, size: 13.3))
.foregroundColor(.white)
Spacer()
}
HStack(spacing: 26.7) {
Spacer()
Text("취소")
.font(.custom(Font.medium.rawValue, size: 13.3))
.foregroundColor(Color(hex: "9970ff"))
.onTapGesture {
isShowing = false
}
Text("차단")
.font(.custom(Font.medium.rawValue, size: 13.3))
.foregroundColor(Color(hex: "9970ff"))
.onTapGesture {
isShowing = false
confirmAction()
}
}
.padding(.top, 13.3)
}
.padding(24)
.frame(width: screenSize().width - 33.3)
.background(Color(hex: "222222"))
.cornerRadius(13.3)
}
}
}

View File

@@ -0,0 +1,88 @@
//
// UserReportDialogView.swift
// SodaLive
//
// Created by klaus on 2023/08/11.
//
import SwiftUI
struct UserReportDialogView: View {
@Binding var isShowing: Bool
let confirmAction: (String) -> Void
@State private var selectedIndex: Int? = nil
let reasons = [
"괴롭힘 및 사이버 폭력",
"개인정보 침해",
"명의 도용",
"폭력적 위협",
"아동 학대",
"보호 대상 집단에 대한 증오심 표현",
"스팸 및 사기",
"나에게 해당하는 문제 없음"
]
var body: some View {
ZStack {
Color.black
.opacity(0.7)
.ignoresSafeArea()
.onTapGesture { isShowing = false }
VStack(spacing: 13.3) {
Text("사용자 신고")
.font(.custom(Font.medium.rawValue, size: 16.7))
.foregroundColor(Color(hex: "eeeeee"))
VStack(spacing: 13.3) {
ForEach(0..<reasons.count, id: \.self) { index in
let reason = reasons[index]
HStack(spacing: 8) {
Image(selectedIndex == index ? "btn_radio_select_selected" : "btn_radio_select_normal")
.resizable()
.frame(width: 20, height: 20)
Text(reason)
.font(.custom(Font.medium.rawValue, size: 14))
.foregroundColor(Color(hex: "909090"))
Spacer()
}
.onTapGesture {
selectedIndex = index
}
}
}
.padding(.vertical, 3.3)
HStack(spacing: 26.7) {
Spacer()
Text("취소")
.font(.custom(Font.medium.rawValue, size: 13.3))
.foregroundColor(Color(hex: "9970ff"))
.onTapGesture {
isShowing = false
}
Text("신고")
.font(.custom(Font.medium.rawValue, size: 13.3))
.foregroundColor(Color(hex: "9970ff"))
.onTapGesture {
if let selectedIndex = selectedIndex {
isShowing = false
confirmAction(reasons[selectedIndex])
}
}
}
.padding(.top, 13.3)
}
.padding(24)
.frame(width: screenSize().width - 33.3)
.background(Color(hex: "222222"))
.cornerRadius(13.3)
}
}
}