메인페이지, 팝업 다이얼로그 - 기본색상 9970ff -> 3bb9f1로 변경
This commit is contained in:
@@ -93,7 +93,7 @@ struct TextMessageDetailView: View {
|
||||
width: (screenSize().width - 40) / 3,
|
||||
height: 48.7
|
||||
)
|
||||
.background(Color(hex: "9970ff"))
|
||||
.background(Color(hex: "3bb9f1"))
|
||||
.cornerRadius(6.7)
|
||||
.onTapGesture {
|
||||
AppState.shared.setAppStep(step: .writeTextMessage(userId: messageItem.senderId, nickname: messageItem.senderNickname))
|
||||
@@ -101,12 +101,12 @@ struct TextMessageDetailView: View {
|
||||
|
||||
Text("보관")
|
||||
.font(.custom(Font.bold.rawValue, size: 14.7))
|
||||
.foregroundColor(Color(hex: "9970ff"))
|
||||
.foregroundColor(Color(hex: "3bb9f1"))
|
||||
.frame(
|
||||
width: (screenSize().width - 40) / 3,
|
||||
height: 48.7
|
||||
)
|
||||
.background(Color(hex: "1f1734"))
|
||||
.background(Color(hex: "13181b"))
|
||||
.cornerRadius(6.7)
|
||||
.onTapGesture {
|
||||
if messageItem.isKept {
|
||||
@@ -120,12 +120,12 @@ struct TextMessageDetailView: View {
|
||||
|
||||
Text("삭제")
|
||||
.font(.custom(Font.bold.rawValue, size: 14.7))
|
||||
.foregroundColor(Color(hex: "9970ff"))
|
||||
.foregroundColor(Color(hex: "3bb9f1"))
|
||||
.frame(
|
||||
width: (screenSize().width - 40) / 3,
|
||||
height: 48.7
|
||||
)
|
||||
.background(Color(hex: "1f1734"))
|
||||
.background(Color(hex: "13181b"))
|
||||
.cornerRadius(6.7)
|
||||
.onTapGesture {
|
||||
viewModel.deleteMessage { back() }
|
||||
@@ -136,12 +136,12 @@ struct TextMessageDetailView: View {
|
||||
} else {
|
||||
Text("삭제")
|
||||
.font(.custom(Font.bold.rawValue, size: 14.7))
|
||||
.foregroundColor(Color(hex: "9970ff"))
|
||||
.foregroundColor(Color(hex: "3bb9f1"))
|
||||
.frame(
|
||||
width: screenSize().width - 26.7,
|
||||
height: 48.7
|
||||
)
|
||||
.background(Color(hex: "1f1734"))
|
||||
.background(Color(hex: "13181b"))
|
||||
.cornerRadius(6.7)
|
||||
.onTapGesture {
|
||||
viewModel.deleteMessage { back() }
|
||||
@@ -159,7 +159,7 @@ struct TextMessageDetailView: View {
|
||||
.padding(.horizontal, 6.7)
|
||||
.frame(width: geo.size.width - 66.7, alignment: .center)
|
||||
.font(.custom(Font.medium.rawValue, size: 12))
|
||||
.background(Color(hex: "9970ff"))
|
||||
.background(Color(hex: "3bb9f1"))
|
||||
.foregroundColor(Color.white)
|
||||
.multilineTextAlignment(.leading)
|
||||
.fixedSize(horizontal: false, vertical: true)
|
||||
|
@@ -0,0 +1,75 @@
|
||||
//
|
||||
// SelectRecipientView.swift
|
||||
// SodaLive
|
||||
//
|
||||
// Created by klaus on 2023/08/10.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
import Kingfisher
|
||||
|
||||
struct SelectRecipientView: View {
|
||||
|
||||
@ObservedObject var viewModel = SelectRecipientViewModel()
|
||||
|
||||
@Binding var isShowing: Bool
|
||||
let selectUser: (GetRoomDetailUser) -> Void
|
||||
|
||||
var body: some View {
|
||||
BaseView {
|
||||
VStack(spacing: 20) {
|
||||
DetailNavigationBar(title: "받는 사람 검색") {
|
||||
isShowing = false
|
||||
}
|
||||
|
||||
TextField("닉네임을 입력해주세요", text: $viewModel.searchNickname)
|
||||
.autocapitalization(.none)
|
||||
.disableAutocorrection(true)
|
||||
.font(.custom(Font.medium.rawValue, size: 13.3))
|
||||
.foregroundColor(Color(hex: "eeeeee"))
|
||||
.keyboardType(.default)
|
||||
.padding(.horizontal, 13.3)
|
||||
.frame(width: screenSize().width - 26.7, height: 50)
|
||||
.background(Color(hex: "232323"))
|
||||
.cornerRadius(10)
|
||||
|
||||
ScrollView(.vertical, showsIndicators: false) {
|
||||
LazyVStack(spacing: 26.7) {
|
||||
ForEach(viewModel.users, id: \.self) { user in
|
||||
HStack(spacing: 13.3) {
|
||||
KFImage(URL(string: user.profileImageUrl))
|
||||
.resizable()
|
||||
.scaledToFill()
|
||||
.frame(width: 46.7, height: 46.7, alignment: .top)
|
||||
.clipped()
|
||||
.cornerRadius(23.3)
|
||||
|
||||
Text(user.nickname)
|
||||
.font(.custom(Font.medium.rawValue, size: 13.3))
|
||||
.foregroundColor(Color(hex: "eeeeee"))
|
||||
|
||||
Spacer()
|
||||
}
|
||||
.contentShape(Rectangle())
|
||||
.onTapGesture {
|
||||
selectUser(user)
|
||||
isShowing = false
|
||||
}
|
||||
}
|
||||
.frame(width: screenSize().width - 26.7)
|
||||
}
|
||||
}
|
||||
.frame(width: screenSize().width)
|
||||
}
|
||||
}
|
||||
.onAppear {
|
||||
viewModel.searchUser()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct SelectRecipientView_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
SelectRecipientView(isShowing: .constant(true)) { _ in }
|
||||
}
|
||||
}
|
@@ -0,0 +1,102 @@
|
||||
//
|
||||
// SelectRecipientViewModel.swift
|
||||
// SodaLive
|
||||
//
|
||||
// Created by klaus on 2023/08/10.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import Combine
|
||||
|
||||
final class SelectRecipientViewModel: ObservableObject {
|
||||
|
||||
private let liveRepository = LiveRepository()
|
||||
private let userRepository = UserRepository()
|
||||
private var subscription = Set<AnyCancellable>()
|
||||
|
||||
@Published var errorMessage = ""
|
||||
@Published var isShowPopup = false
|
||||
@Published var isLoading = false
|
||||
|
||||
@Published var searchNickname = "" {
|
||||
didSet {
|
||||
searchUser()
|
||||
}
|
||||
}
|
||||
|
||||
@Published var users = [GetRoomDetailUser]()
|
||||
|
||||
func searchUser() {
|
||||
if searchNickname.count > 1 {
|
||||
userRepository.searchUser(nickname: searchNickname)
|
||||
.sink { result in
|
||||
switch result {
|
||||
case .finished:
|
||||
DEBUG_LOG("finish")
|
||||
case .failure(let error):
|
||||
ERROR_LOG(error.localizedDescription)
|
||||
}
|
||||
} receiveValue: { response in
|
||||
let responseData = response.data
|
||||
|
||||
do {
|
||||
let jsonDecoder = JSONDecoder()
|
||||
let decoded = try jsonDecoder.decode(ApiResponse<[GetRoomDetailUser]>.self, from: responseData)
|
||||
|
||||
if let data = decoded.data, decoded.success {
|
||||
self.users.removeAll()
|
||||
self.users.append(contentsOf: data)
|
||||
} else {
|
||||
if let message = decoded.message {
|
||||
DEBUG_LOG("message: \(message)")
|
||||
self.errorMessage = message
|
||||
} else {
|
||||
self.errorMessage = "다시 시도해 주세요.\n계속 같은 문제가 발생할 경우 고객센터로 문의 주시기 바랍니다."
|
||||
}
|
||||
|
||||
self.isShowPopup = true
|
||||
}
|
||||
} catch {
|
||||
self.errorMessage = "다시 시도해 주세요.\n계속 같은 문제가 발생할 경우 고객센터로 문의 주시기 바랍니다."
|
||||
self.isShowPopup = true
|
||||
}
|
||||
}
|
||||
.store(in: &subscription)
|
||||
} else {
|
||||
liveRepository.recentVisitRoomUsers()
|
||||
.sink { result in
|
||||
switch result {
|
||||
case .finished:
|
||||
DEBUG_LOG("finish")
|
||||
case .failure(let error):
|
||||
ERROR_LOG(error.localizedDescription)
|
||||
}
|
||||
} receiveValue: { response in
|
||||
self.isLoading = false
|
||||
let responseData = response.data
|
||||
|
||||
do {
|
||||
let jsonDecoder = JSONDecoder()
|
||||
let decoded = try jsonDecoder.decode(ApiResponse<[GetRoomDetailUser]>.self, from: responseData)
|
||||
|
||||
if let data = decoded.data, decoded.success {
|
||||
self.users.removeAll()
|
||||
self.users.append(contentsOf: data)
|
||||
} else {
|
||||
if let message = decoded.message {
|
||||
self.errorMessage = message
|
||||
} else {
|
||||
self.errorMessage = "다시 시도해 주세요.\n계속 같은 문제가 발생할 경우 고객센터로 문의 주시기 바랍니다."
|
||||
}
|
||||
|
||||
self.isShowPopup = true
|
||||
}
|
||||
} catch {
|
||||
self.errorMessage = "다시 시도해 주세요.\n계속 같은 문제가 발생할 경우 고객센터로 문의 주시기 바랍니다."
|
||||
self.isShowPopup = true
|
||||
}
|
||||
}
|
||||
.store(in: &subscription)
|
||||
}
|
||||
}
|
||||
}
|
@@ -84,7 +84,7 @@ struct TextMessageView: View {
|
||||
.resizable()
|
||||
.padding(13.3)
|
||||
.frame(width: 53.3, height: 53.3)
|
||||
.background(Color(hex: "9970ff"))
|
||||
.background(Color(hex: "3bb9f1"))
|
||||
.cornerRadius(26.7)
|
||||
.padding(.bottom, 33.3)
|
||||
.padding(.trailing, 6.7)
|
||||
|
@@ -23,7 +23,7 @@ struct TextMessageWriteView: View {
|
||||
HStack(spacing: 0) {
|
||||
Text("취소")
|
||||
.font(.custom(Font.medium.rawValue, size: 16.7))
|
||||
.foregroundColor(Color(hex: "9970ff").opacity(0))
|
||||
.foregroundColor(Color(hex: "3bb9f1").opacity(0))
|
||||
|
||||
Spacer()
|
||||
|
||||
@@ -35,7 +35,7 @@ struct TextMessageWriteView: View {
|
||||
|
||||
Text("취소")
|
||||
.font(.custom(Font.medium.rawValue, size: 16.7))
|
||||
.foregroundColor(Color(hex: "9970ff"))
|
||||
.foregroundColor(Color(hex: "3bb9f1"))
|
||||
.onTapGesture {
|
||||
AppState.shared.back()
|
||||
}
|
||||
@@ -90,7 +90,7 @@ struct TextMessageWriteView: View {
|
||||
.cornerRadius(6.7)
|
||||
.overlay(
|
||||
RoundedRectangle(cornerRadius: 6.7)
|
||||
.stroke(Color(hex: "9970ff"), lineWidth: 1.3)
|
||||
.stroke(Color(hex: "3bb9f1"), lineWidth: 1.3)
|
||||
)
|
||||
.padding(.top, 13.3)
|
||||
|
||||
@@ -100,7 +100,7 @@ struct TextMessageWriteView: View {
|
||||
.font(.custom(Font.bold.rawValue, size: 14.7))
|
||||
.foregroundColor(Color(hex: "eeeeee"))
|
||||
.frame(width: screenSize().width - 26.7, height: 48.7)
|
||||
.background(Color(hex: "9970ff"))
|
||||
.background(Color(hex: "3bb9f1"))
|
||||
.cornerRadius(6.7)
|
||||
.padding(.bottom, 13.3)
|
||||
.onTapGesture {
|
||||
@@ -125,7 +125,7 @@ struct TextMessageWriteView: View {
|
||||
.padding(.horizontal, 6.7)
|
||||
.frame(width: geo.size.width - 66.7, alignment: .center)
|
||||
.font(.custom(Font.medium.rawValue, size: 12))
|
||||
.background(Color(hex: "9970ff"))
|
||||
.background(Color(hex: "3bb9f1"))
|
||||
.foregroundColor(Color.white)
|
||||
.multilineTextAlignment(.leading)
|
||||
.fixedSize(horizontal: false, vertical: true)
|
||||
|
Reference in New Issue
Block a user