fix(modal): 큰 글자에서도 경고와 버튼명을 보존한다
This commit is contained in:
@@ -6,6 +6,7 @@ struct SodaV2ActionModalButton {
|
|||||||
}
|
}
|
||||||
|
|
||||||
struct SodaV2ActionModal: View {
|
struct SodaV2ActionModal: View {
|
||||||
|
@Environment(\.dynamicTypeSize) private var dynamicTypeSize
|
||||||
let title: String
|
let title: String
|
||||||
let message: String
|
let message: String
|
||||||
let button1: SodaV2ActionModalButton?
|
let button1: SodaV2ActionModalButton?
|
||||||
@@ -32,32 +33,53 @@ struct SodaV2ActionModal: View {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
ZStack {
|
GeometryReader { proxy in
|
||||||
Color.black.opacity(0.6)
|
ZStack {
|
||||||
.ignoresSafeArea()
|
Color.black.opacity(0.6)
|
||||||
.onTapGesture(perform: onDimmedTap)
|
.ignoresSafeArea()
|
||||||
|
.onTapGesture(perform: onDimmedTap)
|
||||||
|
|
||||||
VStack(spacing: 0) {
|
VStack(spacing: 0) {
|
||||||
Text(title)
|
ViewThatFits(in: .vertical) {
|
||||||
.appFont(size: 20, weight: .bold)
|
messageContent
|
||||||
.foregroundColor(Color.white)
|
.fixedSize(horizontal: false, vertical: true)
|
||||||
.multilineTextAlignment(.center)
|
|
||||||
.frame(width: 340, height: 64)
|
|
||||||
|
|
||||||
Text(message)
|
ScrollView {
|
||||||
.appFont(size: 16, weight: .regular)
|
messageContent
|
||||||
.foregroundColor(Color.white)
|
}
|
||||||
.multilineTextAlignment(.center)
|
.scrollBounceBehavior(.basedOnSize)
|
||||||
.padding(20)
|
}
|
||||||
.frame(width: 340)
|
|
||||||
|
|
||||||
buttonArea
|
buttonArea
|
||||||
.padding(.horizontal, 20)
|
.padding(.horizontal, 20)
|
||||||
.padding(.vertical, 14)
|
.padding(.vertical, 14)
|
||||||
.frame(width: 340)
|
.fixedSize(horizontal: false, vertical: true)
|
||||||
|
}
|
||||||
|
.frame(width: min(dynamicTypeSize.isAccessibilitySize ? proxy.size.width : 340, proxy.size.width - 32))
|
||||||
|
.background(Color.gray900)
|
||||||
|
.cornerRadius(14)
|
||||||
|
.padding(16)
|
||||||
}
|
}
|
||||||
.background(Color.gray900)
|
.frame(width: proxy.size.width, height: proxy.size.height)
|
||||||
.cornerRadius(14)
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private var messageContent: some View {
|
||||||
|
VStack(spacing: 0) {
|
||||||
|
Text(title)
|
||||||
|
.appFont(size: 20, weight: .bold)
|
||||||
|
.foregroundColor(Color.white)
|
||||||
|
.multilineTextAlignment(.center)
|
||||||
|
.fixedSize(horizontal: false, vertical: true)
|
||||||
|
.frame(maxWidth: .infinity, minHeight: 64)
|
||||||
|
|
||||||
|
Text(message)
|
||||||
|
.appFont(size: 16, weight: .regular)
|
||||||
|
.foregroundColor(Color.white)
|
||||||
|
.multilineTextAlignment(.center)
|
||||||
|
.fixedSize(horizontal: false, vertical: true)
|
||||||
|
.padding(20)
|
||||||
|
.frame(maxWidth: .infinity)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -81,6 +103,8 @@ struct SodaV2ActionModal: View {
|
|||||||
Text(title)
|
Text(title)
|
||||||
.appFont(size: 18, weight: .medium)
|
.appFont(size: 18, weight: .medium)
|
||||||
.foregroundColor(isPrimary ? primaryTextColor : Color.white)
|
.foregroundColor(isPrimary ? primaryTextColor : Color.white)
|
||||||
|
.multilineTextAlignment(.center)
|
||||||
|
.fixedSize(horizontal: false, vertical: true)
|
||||||
.frame(maxWidth: .infinity)
|
.frame(maxWidth: .infinity)
|
||||||
.padding(14)
|
.padding(14)
|
||||||
.background(Color.clear)
|
.background(Color.clear)
|
||||||
|
|||||||
Reference in New Issue
Block a user