Files
sodalive-ios/SodaLive/Sources/V2/Gift/Tracking/Components/GiftCourierPickerView.swift
T

38 lines
1.4 KiB
Swift

import SwiftUI
struct GiftCourierPickerView: View {
@Binding var selectedCourier: String?
var body: some View {
VStack(alignment: .leading, spacing: SodaSpacing.s12) {
Text("택배사")
.appFont(.body5)
.foregroundColor(.white)
Menu {
ForEach(GiftConstants.courierCompanyNames, id: \.self) { courier in
Button(courier) {
selectedCourier = courier
}
}
} label: {
HStack(spacing: SodaSpacing.s12) {
Text(selectedCourier ?? "택배사 선택")
.fixedSize(horizontal: false, vertical: true)
.frame(maxWidth: .infinity, alignment: .leading)
Image(systemName: "chevron.down")
.accessibilityHidden(true)
}
.appFont(.body3)
.foregroundColor(selectedCourier == nil ? .gray500 : .white)
.padding(SodaSpacing.s14)
.frame(maxWidth: .infinity)
.background(Color.gray900)
.clipShape(RoundedRectangle(cornerRadius: SodaRadius.r14))
}
.accessibilityLabel("택배사")
.accessibilityValue(selectedCourier ?? "택배사 선택")
}
.frame(maxWidth: .infinity, alignment: .leading)
}
}