feat(chat-room) 채팅방 API
- 채팅방 입장 API 연동 - 채팅 쿼터가 없을 때 표시할 UI 추가
This commit is contained in:
@@ -8,11 +8,58 @@
|
||||
import SwiftUI
|
||||
|
||||
struct ChatQuotaNoticeItemView: View {
|
||||
|
||||
let remainingTime: String
|
||||
let purchase: () -> Void
|
||||
|
||||
var body: some View {
|
||||
Text(/*@START_MENU_TOKEN@*/"Hello, World!"/*@END_MENU_TOKEN@*/)
|
||||
VStack(spacing: 10) {
|
||||
VStack(spacing: 8) {
|
||||
Image("ic_time")
|
||||
.resizable()
|
||||
.frame(width: 30, height: 30)
|
||||
|
||||
Text(remainingTime)
|
||||
.font(.custom(Font.preBold.rawValue, size: 18))
|
||||
.foregroundColor(.white)
|
||||
|
||||
Text("기다리면 무료 이용이 가능합니다.")
|
||||
.font(.custom(Font.preBold.rawValue, size: 18))
|
||||
.foregroundColor(.white)
|
||||
}
|
||||
.frame(maxWidth: .infinity)
|
||||
.padding(.vertical, 15)
|
||||
.background(Color(hex: "EC8280"))
|
||||
.cornerRadius(10)
|
||||
|
||||
HStack(spacing: 4) {
|
||||
Image("ic_can")
|
||||
|
||||
Text("30")
|
||||
.font(.custom(Font.preBold.rawValue, size: 24))
|
||||
.foregroundColor(Color(hex: "263238"))
|
||||
|
||||
Text("결제하고 바로 대화 시작")
|
||||
.font(.custom(Font.preBold.rawValue, size: 24))
|
||||
.foregroundColor(Color(hex: "263238"))
|
||||
.padding(.leading, 4)
|
||||
}
|
||||
.frame(maxWidth: .infinity)
|
||||
.padding(.vertical, 12)
|
||||
.background(Color(hex: "B5E7FA"))
|
||||
.cornerRadius(30)
|
||||
.overlay {
|
||||
RoundedRectangle(cornerRadius: 30)
|
||||
.stroke(lineWidth: 1)
|
||||
.foregroundColor(Color.button)
|
||||
}
|
||||
.onTapGesture {
|
||||
purchase()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#Preview {
|
||||
ChatQuotaNoticeItemView()
|
||||
ChatQuotaNoticeItemView(remainingTime: "05:59:55") {}
|
||||
}
|
||||
|
||||
@@ -7,5 +7,5 @@
|
||||
|
||||
struct ChatQuotaStatusResponse: Decodable {
|
||||
let totalRemaining: Int
|
||||
let nextRechargeAtEpoch: Int64
|
||||
let nextRechargeAtEpoch: Int64?
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user