Skip to content

Commit a5bce40

Browse files
authored
Update composer design: RTL send icon, attachment picker prompts, and poll icon consistency (#1397)
* Add RTL support for send icon * Update AttachmentPickerPromptView Design * Update poll icons to SF Symbol one * Update channel list item attachment preview icon size * Update snapshot tests * Update changelog
1 parent d657a54 commit a5bce40

59 files changed

Lines changed: 14 additions & 11 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CHANGELOG.md

Lines changed: 3 additions & 0 deletions

Sources/StreamChatSwiftUI/ChatChannel/ChannelInfo/PinnedMessagesView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ struct PinnedMessageView<Factory: ViewFactory>: View {
163163
if let iconImage = previewAttachmentIconImage {
164164
Image(uiImage: iconImage)
165165
.customizable()
166-
.frame(maxHeight: 12)
166+
.frame(width: tokens.iconSizeSm, height: tokens.iconSizeSm)
167167
.accessibilityHidden(true)
168168
}
169169
}

Sources/StreamChatSwiftUI/ChatChannelList/ChatChannelListItem.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ public struct ChatChannelListItem<Factory: ViewFactory>: View {
215215
if let iconImage = previewAttachmentIconImage {
216216
Image(uiImage: iconImage)
217217
.customizable()
218-
.frame(height: 14)
218+
.frame(width: tokens.iconSizeSm, height: tokens.iconSizeSm)
219219
.accessibilityHidden(true)
220220
}
221221
}

Sources/StreamChatSwiftUI/ChatComposer/AttachmentPicker/AttachmentPickerPromptView.swift

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ public struct AttachmentPickerPromptView: View {
2828
}
2929

3030
public var body: some View {
31-
VStack(spacing: tokens.spacingXs) {
32-
VStack(spacing: tokens.spacingXs) {
31+
VStack(spacing: tokens.spacingMd) {
32+
VStack(spacing: tokens.spacingSm) {
3333
image
3434
.customizable()
3535
.frame(width: 32, height: 32)
@@ -41,23 +41,20 @@ public struct AttachmentPickerPromptView: View {
4141
.foregroundColor(Color(colors.textTertiary))
4242
.frame(width: 200)
4343
}
44-
.frame(maxWidth: .infinity, maxHeight: .infinity)
4544

4645
StreamTextButton(
4746
role: .secondary,
4847
style: .outline,
49-
size: .large,
48+
size: .medium,
5049
action: onTap
5150
) {
5251
Text(buttonText)
5352
.font(fonts.bodyBold)
54-
.frame(maxWidth: .infinity)
5553
}
56-
.frame(maxWidth: .infinity, minHeight: 48, maxHeight: 48, alignment: .center)
5754
}
5855
.frame(maxWidth: .infinity, maxHeight: .infinity)
5956
.padding(.horizontal, tokens.spacing2xl)
60-
.padding(.bottom, tokens.spacing3xl)
57+
.padding(.bottom, 60)
6158
.background(Color(colors.backgroundCoreElevation1))
6259
.accessibilityElement(children: .contain)
6360
.accessibilityIdentifier("AttachmentPickerPromptView")

Sources/StreamChatSwiftUI/ChatComposer/AttachmentPicker/AttachmentTypePickerView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public struct AttachmentTypePickerView: View {
5353

5454
if canSendPoll {
5555
AttachmentTypePickerButton(
56-
icon: images.attachmentPickerPolls,
56+
icon: images.attachmentPollIcon,
5757
pickerType: .polls,
5858
isSelected: selected == .polls,
5959
onTap: onTap

Sources/StreamChatSwiftUI/ChatComposer/Buttons/SendMessageButton.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ import SwiftUI
66

77
/// The button for sending messages.
88
public struct SendMessageButton: View {
9+
@Environment(\.layoutDirection) private var layoutDirection
10+
911
@Injected(\.images) private var images
1012
@Injected(\.tokens) private var tokens
1113

@@ -27,6 +29,7 @@ public struct SendMessageButton: View {
2729
Image(uiImage: images.composerSend)
2830
.renderingMode(.template)
2931
.frame(width: tokens.iconSizeMd, height: tokens.iconSizeMd)
32+
.scaleEffect(x: layoutDirection == .rightToLeft ? -1 : 1, y: 1)
3033
}
3134
.disabled(!enabled)
3235
.accessibilityLabel(Text(L10n.Composer.Placeholder.message))

Sources/StreamChatSwiftUI/ChatMessageList/ReferenceMessageView/AttachmentPreviews/MessageAttachmentPreviewIconView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public struct DefaultMessageAttachmentPreviewIconProvider: MessageAttachmentPrev
5050
public func image(for icon: MessageAttachmentPreviewIcon) -> UIImage {
5151
switch icon {
5252
case .poll:
53-
return images.attachmentPickerPolls
53+
return images.attachmentPollIcon
5454
case .voiceRecording:
5555
return images.attachmentVoiceIcon
5656
case .photo:

0 commit comments

Comments
 (0)