feat(gift): 선물 발송 폼을 추가한다
This commit is contained in:
@@ -0,0 +1,40 @@
|
|||||||
|
import SwiftUI
|
||||||
|
|
||||||
|
struct GiftAgreementRow: View {
|
||||||
|
let title: String
|
||||||
|
@Binding var isAgreed: Bool
|
||||||
|
|
||||||
|
var body: some View {
|
||||||
|
HStack(alignment: .top, spacing: SodaSpacing.s4) {
|
||||||
|
Button {
|
||||||
|
isAgreed.toggle()
|
||||||
|
} label: {
|
||||||
|
HStack(alignment: .top, spacing: SodaSpacing.s8) {
|
||||||
|
Image(isAgreed ? "btn_select_checked" : "btn_select_normal")
|
||||||
|
.resizable()
|
||||||
|
.frame(width: 20, height: 20)
|
||||||
|
Text(title)
|
||||||
|
.appFont(size: 12, weight: .regular)
|
||||||
|
.foregroundColor(.gray300)
|
||||||
|
.multilineTextAlignment(.leading)
|
||||||
|
.frame(maxWidth: .infinity, alignment: .leading)
|
||||||
|
}
|
||||||
|
.frame(minHeight: 44, alignment: .top)
|
||||||
|
.contentShape(Rectangle())
|
||||||
|
}
|
||||||
|
.buttonStyle(.plain)
|
||||||
|
.accessibilityValue(isAgreed ? "동의함" : "동의 안 함")
|
||||||
|
|
||||||
|
if let url = GiftConstants.termsURL {
|
||||||
|
Link(destination: url) {
|
||||||
|
Text("(필수)")
|
||||||
|
.underline()
|
||||||
|
.appFont(size: 12, weight: .regular)
|
||||||
|
.foregroundColor(.soda400)
|
||||||
|
.frame(minHeight: 44, alignment: .top)
|
||||||
|
}
|
||||||
|
.accessibilityLabel("필수 약관 보기")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
import SwiftUI
|
||||||
|
|
||||||
|
struct GiftSendBannerView: View {
|
||||||
|
var body: some View {
|
||||||
|
VStack(alignment: .leading, spacing: SodaSpacing.s8) {
|
||||||
|
Text("선물 보내기 베타 서비스 안내")
|
||||||
|
.appFont(size: 14, weight: .bold)
|
||||||
|
.foregroundColor(.soda400)
|
||||||
|
Text("베타 기간 동안은 일부 기능만 제공됩니다. 크리에이터에게 마음을 잘 전할 수 있도록 더 넓어진 선물 보내기로 곧 다시 만나요!")
|
||||||
|
.appFont(size: 12, weight: .regular)
|
||||||
|
.foregroundColor(.gray300)
|
||||||
|
.fixedSize(horizontal: false, vertical: true)
|
||||||
|
}
|
||||||
|
.padding(SodaSpacing.s14)
|
||||||
|
.frame(maxWidth: .infinity, alignment: .leading)
|
||||||
|
.background(Color.gray900)
|
||||||
|
.cornerRadius(SodaRadius.r8)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,53 @@
|
|||||||
|
import SwiftUI
|
||||||
|
|
||||||
|
struct GiftSenderFormView: View {
|
||||||
|
@Binding var name: String
|
||||||
|
@Binding var phoneNumber: String
|
||||||
|
@Binding var zipCode: String
|
||||||
|
@Binding var address: String
|
||||||
|
@Binding var addressDetail: String
|
||||||
|
|
||||||
|
var body: some View {
|
||||||
|
VStack(alignment: .leading, spacing: SodaSpacing.s20) {
|
||||||
|
VStack(alignment: .leading, spacing: SodaSpacing.s4) {
|
||||||
|
Text("보내는 사람")
|
||||||
|
.appFont(.heading3)
|
||||||
|
.foregroundColor(.white)
|
||||||
|
Text("발송 확인 외의 용도로 사용하지 않으며, 전달이 완료되면 파기됩니다")
|
||||||
|
.appFont(.caption3)
|
||||||
|
.foregroundColor(.gray500)
|
||||||
|
.fixedSize(horizontal: false, vertical: true)
|
||||||
|
}
|
||||||
|
field("이름", helper: "택배 발송 시 이름과 동일하게 적어주세요") {
|
||||||
|
GiftContactTextField(text: $name, rule: .name)
|
||||||
|
}
|
||||||
|
field("휴대폰 번호", helper: "문제 발생 시 연락이 가능한 번호를 입력해 주세요") {
|
||||||
|
GiftContactTextField(text: $phoneNumber, rule: .phoneNumber)
|
||||||
|
}
|
||||||
|
SodaAddressInputView(zipCode: $zipCode, address: $address, addressDetail: $addressDetail)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private func field<Content: View>(
|
||||||
|
_ title: String,
|
||||||
|
helper: String,
|
||||||
|
@ViewBuilder content: () -> Content
|
||||||
|
) -> some View {
|
||||||
|
VStack(alignment: .leading, spacing: SodaSpacing.s4) {
|
||||||
|
Text(title)
|
||||||
|
.appFont(.body5)
|
||||||
|
.foregroundColor(.grayee)
|
||||||
|
content()
|
||||||
|
.appFont(.body3)
|
||||||
|
.foregroundColor(.white)
|
||||||
|
.padding(SodaSpacing.s14)
|
||||||
|
.background(Color.gray900)
|
||||||
|
.cornerRadius(SodaRadius.r14)
|
||||||
|
.accessibilityLabel(title)
|
||||||
|
Text(helper)
|
||||||
|
.appFont(.caption3)
|
||||||
|
.foregroundColor(.gray500)
|
||||||
|
.fixedSize(horizontal: false, vertical: true)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user