diff --git a/Projects/Feature/Chat/Sources/Comment/View/CommentView.swift b/Projects/Feature/Chat/Sources/Comment/View/CommentView.swift index d7d168af..a0e2c1d0 100644 --- a/Projects/Feature/Chat/Sources/Comment/View/CommentView.swift +++ b/Projects/Feature/Chat/Sources/Comment/View/CommentView.swift @@ -495,6 +495,7 @@ private extension CommentView { focus: $isCommentFocused, placeholder: "내용을 입력하세요", isSendEnabled: store.isSendEnabled, + isSubmitting: store.isSubmitting, isCompact: true, onSend: { isCommentFocused = false diff --git a/Projects/UI/PickeSharedUI/Sources/Input/PickeCommentInputBar.swift b/Projects/UI/PickeSharedUI/Sources/Input/PickeCommentInputBar.swift index 8379a531..12c8df7b 100644 --- a/Projects/UI/PickeSharedUI/Sources/Input/PickeCommentInputBar.swift +++ b/Projects/UI/PickeSharedUI/Sources/Input/PickeCommentInputBar.swift @@ -14,6 +14,7 @@ public struct PickeCommentInputBar: View { @Binding private var text: String private let placeholder: String private let isSendEnabled: Bool + private let isSubmitting: Bool private let isCompact: Bool private let onSend: () -> Void private var focus: FocusState.Binding @@ -23,6 +24,7 @@ public struct PickeCommentInputBar: View { focus: FocusState.Binding, placeholder: String, isSendEnabled: Bool, + isSubmitting: Bool = false, isCompact: Bool = false, onSend: @escaping () -> Void ) { @@ -30,6 +32,7 @@ public struct PickeCommentInputBar: View { self.focus = focus self.placeholder = placeholder self.isSendEnabled = isSendEnabled + self.isSubmitting = isSubmitting self.isCompact = isCompact self.onSend = onSend } @@ -76,11 +79,11 @@ private extension PickeCommentInputBar { .foregroundStyle(.iconGrayInverse) .frame(width: 40, height: 40) .background( - isSendEnabled ? .buttonIconBackgroundDefault : .buttonIconBackgroundDisabled, + isSubmitting ? .buttonIconBackgroundDisabled : .buttonIconBackgroundDefault, in: Circle() ) } - .buttonStyle(.plain) + .buttonStyle(CompactSendButtonStyle()) .disabled(!isSendEnabled) .accessibilityLabel("보내기") } @@ -127,3 +130,10 @@ private extension PickeCommentInputBar { .disabled(!isSendEnabled) } } + +private struct CompactSendButtonStyle: ButtonStyle { + func makeBody(configuration: Configuration) -> some View { + configuration.label + .opacity(configuration.isPressed ? 0.7 : 1) + } +}