From 228e7d0be53190c68626c6d2347484266cea291b Mon Sep 17 00:00:00 2001 From: Yu Sung Date: Wed, 14 Oct 2026 00:33:43 +0900 Subject: [PATCH] =?UTF-8?q?fix(modal):=20=ED=81=B0=20=EA=B8=80=EC=9E=90?= =?UTF-8?q?=EC=97=90=EC=84=9C=EB=8F=84=20=EA=B2=BD=EA=B3=A0=EC=99=80=20?= =?UTF-8?q?=EB=B2=84=ED=8A=BC=EB=AA=85=EC=9D=84=20=EB=B3=B4=EC=A1=B4?= =?UTF-8?q?=ED=95=9C=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Component/Modal/SodaV2ActionModal.swift | 68 +++++++++++++------ 1 file changed, 46 insertions(+), 22 deletions(-) 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)