diff --git a/SodaLive/Sources/V2/Component/Modal/SodaV2ActionModal.swift b/SodaLive/Sources/V2/Component/Modal/SodaV2ActionModal.swift index c8a8cbd5..d9f1b64d 100644 --- a/SodaLive/Sources/V2/Component/Modal/SodaV2ActionModal.swift +++ b/SodaLive/Sources/V2/Component/Modal/SodaV2ActionModal.swift @@ -6,6 +6,7 @@ struct SodaV2ActionModalButton { } struct SodaV2ActionModal: View { + @Environment(\.dynamicTypeSize) private var dynamicTypeSize let title: String let message: String let button1: SodaV2ActionModalButton? @@ -32,32 +33,53 @@ struct SodaV2ActionModal: View { } var body: some View { - ZStack { - Color.black.opacity(0.6) - .ignoresSafeArea() - .onTapGesture(perform: onDimmedTap) + GeometryReader { proxy in + ZStack { + Color.black.opacity(0.6) + .ignoresSafeArea() + .onTapGesture(perform: onDimmedTap) - VStack(spacing: 0) { - Text(title) - .appFont(size: 20, weight: .bold) - .foregroundColor(Color.white) - .multilineTextAlignment(.center) - .frame(width: 340, height: 64) + VStack(spacing: 0) { + ViewThatFits(in: .vertical) { + messageContent + .fixedSize(horizontal: false, vertical: true) - Text(message) - .appFont(size: 16, weight: .regular) - .foregroundColor(Color.white) - .multilineTextAlignment(.center) - .padding(20) - .frame(width: 340) + ScrollView { + messageContent + } + .scrollBounceBehavior(.basedOnSize) + } - buttonArea - .padding(.horizontal, 20) - .padding(.vertical, 14) - .frame(width: 340) + buttonArea + .padding(.horizontal, 20) + .padding(.vertical, 14) + .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) - .cornerRadius(14) + .frame(width: proxy.size.width, height: proxy.size.height) + } + } + + 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) .appFont(size: 18, weight: .medium) .foregroundColor(isPrimary ? primaryTextColor : Color.white) + .multilineTextAlignment(.center) + .fixedSize(horizontal: false, vertical: true) .frame(maxWidth: .infinity) .padding(14) .background(Color.clear)