feat: 포인트 내역 UI 추가
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
//
|
||||
// GetPointUseStatusResponse.swift
|
||||
// SodaLive
|
||||
//
|
||||
// Created by klaus on 5/20/25.
|
||||
//
|
||||
|
||||
struct GetPointUseStatusResponse: Decodable, Hashable {
|
||||
let title: String
|
||||
let date: String
|
||||
let point: Int
|
||||
}
|
||||
71
SodaLive/Sources/MyPage/Point/Use/PointUseStatusView.swift
Normal file
71
SodaLive/Sources/MyPage/Point/Use/PointUseStatusView.swift
Normal file
@@ -0,0 +1,71 @@
|
||||
//
|
||||
// PointUseStatusView.swift
|
||||
// SodaLive
|
||||
//
|
||||
// Created by klaus on 5/20/25.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
||||
struct PointUseStatusView: View {
|
||||
|
||||
@StateObject var viewModel = PointStatusViewModel()
|
||||
|
||||
var body: some View {
|
||||
ZStack {
|
||||
VStack(spacing: 13.3) {
|
||||
ForEach(viewModel.useStatusItems, id: \.self) { item in
|
||||
PointUseStatusItemView(item: item)
|
||||
}
|
||||
}
|
||||
.padding(.top, 13.3)
|
||||
|
||||
if viewModel.isLoading {
|
||||
LoadingView()
|
||||
}
|
||||
}
|
||||
.onAppear {
|
||||
viewModel.getPointUseStatus()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct PointUseStatusItemView: View {
|
||||
|
||||
let item: GetPointUseStatusResponse
|
||||
|
||||
var body: some View {
|
||||
HStack(spacing: 0) {
|
||||
VStack(alignment: .leading, spacing: 6.7) {
|
||||
Text(item.title)
|
||||
.font(.custom(Font.medium.rawValue, size: 13.3))
|
||||
.foregroundColor(.grayee)
|
||||
|
||||
Text(item.date)
|
||||
.font(.custom(Font.medium.rawValue, size: 12))
|
||||
.foregroundColor(.gray77)
|
||||
}
|
||||
|
||||
Spacer()
|
||||
|
||||
Text("\(item.point)")
|
||||
.font(.custom(Font.medium.rawValue, size: 13.3))
|
||||
.foregroundColor(.grayee)
|
||||
|
||||
Image("ic_point")
|
||||
.resizable()
|
||||
.frame(width: 26.7, height: 26.7)
|
||||
.padding(.leading, 6.7)
|
||||
}
|
||||
.padding(.horizontal, 13.3)
|
||||
.padding(.vertical, 16)
|
||||
.background(Color.gray11)
|
||||
.cornerRadius(16.7)
|
||||
.padding(.horizontal, 13.3)
|
||||
.frame(maxWidth: .infinity)
|
||||
}
|
||||
}
|
||||
|
||||
#Preview {
|
||||
PointUseStatusView()
|
||||
}
|
||||
Reference in New Issue
Block a user