mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 16:10:20 +00:00
Update compound and remove all of the temporary icons (#2419)
* Update compound and fix breaking changes. * Replace a lot of temporary icon assets with Compound versions. * Replace temporary composer icon assets with Compound versions. * Remove old icon asset from EI. * Use Compound icons where possible for hero images. * Snapshots
This commit is contained in:
@@ -42,8 +42,7 @@ struct AnalyticsPromptScreen: View {
|
||||
|
||||
private var header: some View {
|
||||
VStack(spacing: 8) {
|
||||
HeroImage(image: Image(systemName: "chart.bar"))
|
||||
.symbolVariant(.fill)
|
||||
HeroImage(icon: \.chart)
|
||||
.padding(.bottom, 8)
|
||||
|
||||
Text(L10n.screenAnalyticsPromptTitle(InfoPlistReader.main.bundleDisplayName))
|
||||
|
||||
@@ -66,7 +66,7 @@ struct AppLockScreen: View {
|
||||
|
||||
var header: some View {
|
||||
VStack(spacing: 8) {
|
||||
CompoundIcon(\.lock, size: .medium, relativeTo: .compound.headingMDBold)
|
||||
CompoundIcon(\.lockSolid, size: .medium, relativeTo: .compound.headingMDBold)
|
||||
.padding(.bottom, 8)
|
||||
.accessibilityHidden(true)
|
||||
|
||||
|
||||
+1
-2
@@ -60,8 +60,7 @@ struct AppLockSetupPINScreen: View {
|
||||
|
||||
var header: some View {
|
||||
VStack(spacing: 8) {
|
||||
HeroImage(image: Image(systemSymbol: .lock))
|
||||
.symbolVariant(.fill)
|
||||
HeroImage(icon: \.lockSolid)
|
||||
.padding(.bottom, 8)
|
||||
|
||||
Text(context.viewState.title)
|
||||
|
||||
@@ -52,7 +52,7 @@ struct LoginScreen: View {
|
||||
/// The header containing the title and icon.
|
||||
var header: some View {
|
||||
VStack(spacing: 8) {
|
||||
HeroImage(image: Image(systemName: "lock.fill"))
|
||||
HeroImage(icon: \.lockSolid)
|
||||
.padding(.bottom, 8)
|
||||
|
||||
Text(L10n.screenLoginTitleWithHomeserver(context.viewState.homeserver.address))
|
||||
|
||||
+2
-1
@@ -35,7 +35,8 @@ struct ServerConfirmationScreen: View {
|
||||
/// The main content of the view to be shown in a scroll view.
|
||||
var header: some View {
|
||||
VStack(spacing: 8) {
|
||||
HeroImage(image: Image(systemName: "person.crop.circle.fill"))
|
||||
Image(systemSymbol: .personCropCircleFill)
|
||||
.heroImage()
|
||||
.padding(.bottom, 8)
|
||||
|
||||
Text(context.viewState.title)
|
||||
|
||||
+2
-1
@@ -40,7 +40,8 @@ struct ServerSelectionScreen: View {
|
||||
/// The title, message and icon at the top of the screen.
|
||||
var header: some View {
|
||||
VStack(spacing: 8) {
|
||||
HeroImage(image: Image(asset: Asset.Images.serverSelectionIcon), insets: 19)
|
||||
Image(asset: Asset.Images.serverSelectionIcon)
|
||||
.heroImage(insets: 19)
|
||||
.padding(.bottom, 8)
|
||||
|
||||
Text(L10n.screenChangeServerTitle)
|
||||
|
||||
@@ -109,7 +109,11 @@ struct BugReportScreen: View {
|
||||
.accessibilityIdentifier(A11yIdentifiers.bugReportScreen.screenshot)
|
||||
.overlay(alignment: .topTrailing) {
|
||||
Button { context.send(viewAction: .removeScreenshot) } label: {
|
||||
Image(Asset.Images.closeCircle.name)
|
||||
CompoundIcon(\.close, size: .small, relativeTo: .compound.bodyMD)
|
||||
.foregroundStyle(.compound.iconSecondary)
|
||||
.background {
|
||||
Circle().fill(.compound.bgCanvasDefaultLevel1)
|
||||
}
|
||||
}
|
||||
.offset(x: 10, y: -10)
|
||||
.accessibilityIdentifier(A11yIdentifiers.bugReportScreen.removeScreenshot)
|
||||
|
||||
@@ -14,8 +14,8 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
import Compound
|
||||
import SwiftUI
|
||||
import UIKit
|
||||
import WysiwygComposer
|
||||
|
||||
enum ComposerToolbarVoiceMessageAction {
|
||||
@@ -152,32 +152,32 @@ extension FormatItem: Identifiable {
|
||||
|
||||
extension FormatItem {
|
||||
/// The icon to display in the formatting toolbar.
|
||||
var icon: Image {
|
||||
var icon: KeyPath<CompoundIcons, Image> {
|
||||
switch type {
|
||||
case .bold:
|
||||
return Image(asset: Asset.Images.bold)
|
||||
return \.bold
|
||||
case .italic:
|
||||
return Image(asset: Asset.Images.italic)
|
||||
return \.italic
|
||||
case .underline:
|
||||
return Image(asset: Asset.Images.underline)
|
||||
return \.underline
|
||||
case .strikeThrough:
|
||||
return Image(asset: Asset.Images.strikethrough)
|
||||
return \.strikethrough
|
||||
case .unorderedList:
|
||||
return Image(asset: Asset.Images.bulletList)
|
||||
return \.listBulleted
|
||||
case .orderedList:
|
||||
return Image(asset: Asset.Images.numberedList)
|
||||
return \.listNumbered
|
||||
case .indent:
|
||||
return Image(asset: Asset.Images.indent)
|
||||
return \.indentIncrease
|
||||
case .unindent:
|
||||
return Image(asset: Asset.Images.unindent)
|
||||
return \.indentDecrease
|
||||
case .inlineCode:
|
||||
return Image(asset: Asset.Images.inlineCode)
|
||||
return \.inlineCode
|
||||
case .codeBlock:
|
||||
return Image(asset: Asset.Images.codeBlock)
|
||||
return \.code
|
||||
case .quote:
|
||||
return Image(asset: Asset.Images.quote)
|
||||
return \.quote
|
||||
case .link:
|
||||
return Image(asset: Asset.Images.link)
|
||||
return \.link
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -147,9 +147,9 @@ struct ComposerToolbar: View {
|
||||
Button {
|
||||
context.send(viewAction: .sendMessage)
|
||||
} label: {
|
||||
submitButtonImage
|
||||
.symbolVariant(.fill)
|
||||
.font(.compound.bodyLG)
|
||||
CompoundIcon(context.viewState.composerMode.isEdit ? \.check : \.sendSolid)
|
||||
.scaledPadding(6, relativeTo: .title)
|
||||
.accessibilityLabel(context.viewState.composerMode.isEdit ? L10n.actionConfirm : L10n.actionSend)
|
||||
.foregroundColor(context.viewState.sendButtonDisabled ? .compound.iconDisabled : .white)
|
||||
.background {
|
||||
Circle()
|
||||
@@ -214,26 +214,6 @@ struct ComposerToolbar: View {
|
||||
}
|
||||
}
|
||||
|
||||
private var submitButtonImage: some View {
|
||||
// ZStack with opacity so the button size is consistent.
|
||||
ZStack {
|
||||
CompoundIcon(\.check)
|
||||
.opacity(context.viewState.composerMode.isEdit ? 1 : 0)
|
||||
.accessibilityLabel(L10n.actionConfirm)
|
||||
.accessibilityHidden(!context.viewState.composerMode.isEdit)
|
||||
|
||||
let sendImageOffset: CGFloat = 1
|
||||
Image(asset: Asset.Images.sendMessage)
|
||||
.resizable()
|
||||
.scaledToFit()
|
||||
.scaledFrame(width: 16 + sendImageOffset, height: 16, alignment: .trailing, relativeTo: .title)
|
||||
.scaledPadding(10, relativeTo: .title)
|
||||
.opacity(context.viewState.composerMode.isEdit ? 0 : 1)
|
||||
.accessibilityLabel(L10n.actionSend)
|
||||
.accessibilityHidden(context.viewState.composerMode.isEdit)
|
||||
}
|
||||
}
|
||||
|
||||
private class ItemProviderHelper: WysiwygItemProviderHelper {
|
||||
func isPasteSupported(for itemProvider: NSItemProvider) -> Bool {
|
||||
itemProvider.isSupportedForPasteOrDrop
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
import Compound
|
||||
import SwiftUI
|
||||
|
||||
struct FormattingToolbar: View {
|
||||
@@ -29,10 +30,7 @@ struct FormattingToolbar: View {
|
||||
Button {
|
||||
formatAction(item.type)
|
||||
} label: {
|
||||
item.icon
|
||||
.resizable()
|
||||
.scaledToFit()
|
||||
.scaledFrame(size: 20)
|
||||
CompoundIcon(item.icon, size: .small, relativeTo: .compound.headingLG)
|
||||
.foregroundColor(item.foregroundColor)
|
||||
.padding(8)
|
||||
.background(item.backgroundColor)
|
||||
@@ -69,3 +67,15 @@ private extension FormatItem {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct FormattingToolbar_Previews: PreviewProvider, TestablePreview {
|
||||
static let items = FormatType.allCases.map { FormatItem(type: $0, state: .enabled) }
|
||||
static let disabledItems = FormatType.allCases.map { FormatItem(type: $0, state: .disabled) }
|
||||
|
||||
static var previews: some View {
|
||||
VStack {
|
||||
FormattingToolbar(formatItems: items) { _ in }
|
||||
FormattingToolbar(formatItems: disabledItems) { _ in }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -154,7 +154,7 @@ private struct MessageComposerEditHeader: View {
|
||||
var body: some View {
|
||||
HStack(alignment: .center, spacing: 8) {
|
||||
Label(L10n.commonEditing,
|
||||
iconAsset: Asset.Images.editing,
|
||||
icon: \.editSolid,
|
||||
iconSize: .xSmall,
|
||||
relativeTo: .compound.bodySMSemibold)
|
||||
.labelStyle(MessageComposerHeaderLabelStyle())
|
||||
|
||||
@@ -48,7 +48,7 @@ struct RoomAttachmentPicker: View {
|
||||
Button {
|
||||
context.send(viewAction: .attach(.file))
|
||||
} label: {
|
||||
Label(L10n.screenRoomAttachmentSourceFiles, iconAsset: Asset.Images.attachment)
|
||||
Label(L10n.screenRoomAttachmentSourceFiles, icon: \.attachment)
|
||||
.labelStyle(.menuSheet)
|
||||
}
|
||||
.accessibilityIdentifier(A11yIdentifiers.roomScreen.attachmentPickerDocuments)
|
||||
@@ -56,7 +56,7 @@ struct RoomAttachmentPicker: View {
|
||||
Button {
|
||||
context.send(viewAction: .attach(.camera))
|
||||
} label: {
|
||||
Label(L10n.screenRoomAttachmentSourceCamera, iconAsset: Asset.Images.takePhoto)
|
||||
Label(L10n.screenRoomAttachmentSourceCamera, icon: \.takePhoto)
|
||||
.labelStyle(.menuSheet)
|
||||
}
|
||||
.accessibilityIdentifier(A11yIdentifiers.roomScreen.attachmentPickerCamera)
|
||||
@@ -64,7 +64,7 @@ struct RoomAttachmentPicker: View {
|
||||
Button {
|
||||
context.send(viewAction: .attach(.location))
|
||||
} label: {
|
||||
Label(L10n.screenRoomAttachmentSourceLocation, iconAsset: Asset.Images.addLocation)
|
||||
Label(L10n.screenRoomAttachmentSourceLocation, icon: \.locationPin)
|
||||
.labelStyle(.menuSheet)
|
||||
}
|
||||
.accessibilityIdentifier(A11yIdentifiers.roomScreen.attachmentPickerLocation)
|
||||
@@ -72,7 +72,7 @@ struct RoomAttachmentPicker: View {
|
||||
Button {
|
||||
context.send(viewAction: .attach(.poll))
|
||||
} label: {
|
||||
Label(L10n.screenRoomAttachmentSourcePoll, iconAsset: Asset.Images.polls)
|
||||
Label(L10n.screenRoomAttachmentSourcePoll, icon: \.polls)
|
||||
.labelStyle(.menuSheet)
|
||||
}
|
||||
.accessibilityIdentifier(A11yIdentifiers.roomScreen.attachmentPickerPoll)
|
||||
@@ -81,7 +81,7 @@ struct RoomAttachmentPicker: View {
|
||||
Button {
|
||||
context.send(viewAction: .enableTextFormatting)
|
||||
} label: {
|
||||
Label(L10n.screenRoomAttachmentTextFormatting, iconAsset: Asset.Images.textFormat)
|
||||
Label(L10n.screenRoomAttachmentTextFormatting, icon: \.textFormatting)
|
||||
.labelStyle(.menuSheet)
|
||||
}
|
||||
.accessibilityIdentifier(A11yIdentifiers.roomScreen.attachmentPickerTextFormatting)
|
||||
|
||||
@@ -41,7 +41,7 @@ struct VoiceMessageRecordingButton: View {
|
||||
} label: {
|
||||
switch mode {
|
||||
case .idle:
|
||||
CompoundIcon(\.micOnOutline, size: .medium, relativeTo: .title)
|
||||
CompoundIcon(\.micOn, size: .medium, relativeTo: .title)
|
||||
.foregroundColor(.compound.iconSecondary)
|
||||
.scaledPadding(10, relativeTo: .title)
|
||||
case .recording:
|
||||
|
||||
@@ -84,7 +84,7 @@ struct CreateRoomScreen: View {
|
||||
.scaledFrame(size: 70)
|
||||
.clipShape(Circle())
|
||||
} else {
|
||||
CompoundIcon(asset: Asset.Images.takePhoto, size: .custom(36), relativeTo: .title)
|
||||
CompoundIcon(\.takePhoto, size: .custom(36), relativeTo: .title)
|
||||
.foregroundColor(.compound.iconSecondary)
|
||||
.scaledFrame(size: 70, relativeTo: .title)
|
||||
.background(.compound.bgSubtlePrimary, in: Circle())
|
||||
@@ -146,7 +146,7 @@ struct CreateRoomScreen: View {
|
||||
Section {
|
||||
ListRow(label: .default(title: L10n.screenCreateRoomPrivateOptionTitle,
|
||||
description: L10n.screenCreateRoomPrivateOptionDescription,
|
||||
icon: CompoundIcon(asset: Asset.Images.lock),
|
||||
icon: \.lock,
|
||||
iconAlignment: .top),
|
||||
kind: .selection(isSelected: context.isRoomPrivate) { context.isRoomPrivate = true })
|
||||
ListRow(label: .default(title: L10n.screenCreateRoomPublicOptionTitle,
|
||||
|
||||
@@ -159,7 +159,7 @@ struct HomeScreen: View {
|
||||
Button {
|
||||
context.send(viewAction: .startChat)
|
||||
} label: {
|
||||
CompoundIcon(\.edit)
|
||||
CompoundIcon(\.compose)
|
||||
}
|
||||
.accessibilityLabel(L10n.actionStartChat)
|
||||
.accessibilityIdentifier(A11yIdentifiers.homeScreen.startChat)
|
||||
|
||||
@@ -36,7 +36,7 @@ struct HomeScreenEmptyStateView: View {
|
||||
.padding(.bottom, 12)
|
||||
|
||||
Button { context.send(viewAction: .startChat) } label: {
|
||||
Label(L10n.actionStartChat, icon: \.edit)
|
||||
Label(L10n.actionStartChat, icon: \.compose)
|
||||
.font(.compound.bodyLGSemibold)
|
||||
.foregroundColor(.compound.textOnSolidPrimary)
|
||||
.padding(.vertical, 6)
|
||||
|
||||
@@ -123,7 +123,7 @@ struct HomeScreenRoomCell: View {
|
||||
}
|
||||
|
||||
if room.notificationMode == .mute {
|
||||
CompoundIcon(\.notificationsSolidOff, size: .custom(15), relativeTo: .compound.bodyMD)
|
||||
CompoundIcon(\.notificationsOffSolid, size: .custom(15), relativeTo: .compound.bodyMD)
|
||||
.accessibilityLabel(L10n.a11yNotificationsMuted)
|
||||
.foregroundColor(.compound.iconQuaternary)
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ struct HomeScreenUserMenuButton: View {
|
||||
Button(role: .destructive) {
|
||||
context.send(viewAction: .userMenu(action: .logout))
|
||||
} label: {
|
||||
Label(L10n.screenSignoutPreferenceItem, iconAsset: Asset.Images.signOut)
|
||||
Label(L10n.screenSignoutPreferenceItem, icon: \.signOut)
|
||||
}
|
||||
}
|
||||
} label: {
|
||||
|
||||
@@ -120,7 +120,7 @@ struct StaticLocationScreen: View {
|
||||
Button {
|
||||
context.send(viewAction: .centerToUser)
|
||||
} label: {
|
||||
CompoundIcon(asset: context.viewState.isSharingUserLocation ? Asset.Images.locationNavigatorCentred : Asset.Images.locationNavigator)
|
||||
CompoundIcon(context.viewState.isSharingUserLocation ? \.locationNavigatorCentred : \.locationNavigator)
|
||||
.padding(8)
|
||||
.background(.compound.bgCanvasDefault, in: RoundedRectangle(cornerRadius: 6))
|
||||
}
|
||||
|
||||
@@ -122,9 +122,9 @@ struct RoomDetailsEditScreen: View {
|
||||
}
|
||||
|
||||
private var avatarOverlayIcon: some View {
|
||||
CompoundIcon(asset: Asset.Images.editing, size: .xSmall, relativeTo: .compound.bodyLG)
|
||||
CompoundIcon(\.editSolid, size: .xSmall, relativeTo: .compound.bodyLG)
|
||||
.foregroundColor(.white)
|
||||
.padding(3)
|
||||
.padding(4)
|
||||
.background {
|
||||
Circle()
|
||||
.foregroundColor(.black)
|
||||
|
||||
@@ -108,7 +108,7 @@ struct RoomDetailsScreen: View {
|
||||
toggleMuteButton
|
||||
case .share(let permalink):
|
||||
ShareLink(item: permalink) {
|
||||
CompoundIcon(asset: Asset.Images.shareIos)
|
||||
CompoundIcon(\.shareIos)
|
||||
}
|
||||
.buttonStyle(FormActionButtonStyle(title: L10n.actionShare))
|
||||
}
|
||||
@@ -150,7 +150,7 @@ struct RoomDetailsScreen: View {
|
||||
Section {
|
||||
if context.viewState.dmRecipient == nil {
|
||||
ListRow(label: .default(title: L10n.commonPeople,
|
||||
icon: CompoundIcon(asset: Asset.Images.user)),
|
||||
icon: \.user),
|
||||
details: .title(String(context.viewState.joinedMembersCount)),
|
||||
kind: .navigationLink {
|
||||
context.send(viewAction: .processTapPeople)
|
||||
@@ -159,7 +159,7 @@ struct RoomDetailsScreen: View {
|
||||
|
||||
if context.viewState.canInviteUsers {
|
||||
ListRow(label: .default(title: L10n.screenRoomDetailsInvitePeopleTitle,
|
||||
icon: CompoundIcon(asset: Asset.Images.userAdd)),
|
||||
icon: \.userAdd),
|
||||
kind: .navigationLink {
|
||||
context.send(viewAction: .processTapInvite)
|
||||
})
|
||||
@@ -167,7 +167,7 @@ struct RoomDetailsScreen: View {
|
||||
}
|
||||
}
|
||||
ListRow(label: .default(title: L10n.screenPollsHistoryTitle,
|
||||
icon: CompoundIcon(asset: Asset.Images.polls)),
|
||||
icon: \.polls),
|
||||
kind: .navigationLink {
|
||||
context.send(viewAction: .processTapPolls)
|
||||
})
|
||||
@@ -211,7 +211,7 @@ struct RoomDetailsScreen: View {
|
||||
Section {
|
||||
ListRow(label: .default(title: L10n.screenRoomDetailsEncryptionEnabledTitle,
|
||||
description: L10n.screenRoomDetailsEncryptionEnabledSubtitle,
|
||||
icon: CompoundIcon(asset: Asset.Images.lock),
|
||||
icon: \.lock,
|
||||
iconAlignment: .top),
|
||||
kind: .label)
|
||||
} header: {
|
||||
@@ -237,7 +237,7 @@ struct RoomDetailsScreen: View {
|
||||
private func ignoreUserSection(user: RoomMemberDetails) -> some View {
|
||||
Section {
|
||||
ListRow(label: .default(title: user.isIgnored ? L10n.screenDmDetailsUnblockUser : L10n.screenDmDetailsBlockUser,
|
||||
icon: CompoundIcon(asset: Asset.Images.block),
|
||||
icon: \.block,
|
||||
role: user.isIgnored ? nil : .destructive),
|
||||
details: .isWaiting(context.viewState.isProcessingIgnoreRequest),
|
||||
kind: .button {
|
||||
|
||||
@@ -51,7 +51,7 @@ struct RoomMemberDetailsScreen: View {
|
||||
if let permalink = context.viewState.details.permalink {
|
||||
HStack(spacing: 32) {
|
||||
ShareLink(item: permalink) {
|
||||
CompoundIcon(asset: Asset.Images.shareIos)
|
||||
CompoundIcon(\.shareIos)
|
||||
}
|
||||
.buttonStyle(FormActionButtonStyle(title: L10n.actionShare))
|
||||
}
|
||||
@@ -74,7 +74,7 @@ struct RoomMemberDetailsScreen: View {
|
||||
private var blockUserSection: some View {
|
||||
Section {
|
||||
ListRow(label: .default(title: blockUserButtonTitle,
|
||||
icon: CompoundIcon(asset: Asset.Images.block),
|
||||
icon: \.block,
|
||||
role: context.viewState.details.isIgnored ? nil : .destructive),
|
||||
details: .isWaiting(context.viewState.isProcessingIgnoreRequest),
|
||||
kind: .button {
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
import Compound
|
||||
import SwiftUI
|
||||
|
||||
enum PollViewAction {
|
||||
@@ -43,11 +44,9 @@ struct PollView: View {
|
||||
|
||||
private var questionView: some View {
|
||||
HStack(alignment: .top, spacing: 12) {
|
||||
let asset = poll.hasEnded ? Asset.Images.pollsEnd : Asset.Images.polls
|
||||
|
||||
Image(asset.name)
|
||||
.resizable()
|
||||
.scaledFrame(size: 22)
|
||||
CompoundIcon(poll.hasEnded ? \.pollsEnd : \.polls,
|
||||
size: .custom(22),
|
||||
relativeTo: .compound.bodyLGSemibold)
|
||||
.accessibilityHidden(true)
|
||||
|
||||
Text(poll.question)
|
||||
|
||||
@@ -46,7 +46,7 @@ struct TimelineReplyView: View {
|
||||
ReplyView(sender: sender,
|
||||
plainBody: content.body,
|
||||
formattedBody: nil,
|
||||
icon: .init(kind: .iconAsset(Asset.Images.document), cornerRadii: iconCornerRadii))
|
||||
icon: .init(kind: .icon(\.document), cornerRadii: iconCornerRadii))
|
||||
case .image(let content):
|
||||
ReplyView(sender: sender,
|
||||
plainBody: content.body,
|
||||
@@ -69,18 +69,18 @@ struct TimelineReplyView: View {
|
||||
ReplyView(sender: sender,
|
||||
plainBody: L10n.commonVoiceMessage,
|
||||
formattedBody: nil,
|
||||
icon: .init(kind: .icon(\.micOnOutline), cornerRadii: iconCornerRadii))
|
||||
icon: .init(kind: .icon(\.micOn), cornerRadii: iconCornerRadii))
|
||||
case .location:
|
||||
ReplyView(sender: sender,
|
||||
plainBody: L10n.commonSharedLocation,
|
||||
formattedBody: nil,
|
||||
icon: .init(kind: .iconAsset(Asset.Images.addLocation), cornerRadii: iconCornerRadii))
|
||||
icon: .init(kind: .icon(\.locationPin), cornerRadii: iconCornerRadii))
|
||||
}
|
||||
case .poll(let question):
|
||||
ReplyView(sender: sender,
|
||||
plainBody: question,
|
||||
formattedBody: nil,
|
||||
icon: .init(kind: .iconAsset(Asset.Images.polls), cornerRadii: iconCornerRadii))
|
||||
icon: .init(kind: .icon(\.polls), cornerRadii: iconCornerRadii))
|
||||
}
|
||||
default:
|
||||
LoadingReplyView()
|
||||
|
||||
@@ -21,7 +21,7 @@ struct SwipeToReplyView: View {
|
||||
let timelineItem: RoomTimelineItemProtocol
|
||||
|
||||
var body: some View {
|
||||
CompoundIcon(asset: Asset.Images.reply)
|
||||
CompoundIcon(\.reply)
|
||||
.foregroundColor(.compound.iconPrimary)
|
||||
.accessibilityHidden(true)
|
||||
}
|
||||
|
||||
+1
-1
@@ -28,7 +28,7 @@ struct TimelineDeliveryStatusView: View {
|
||||
private var icon: CompoundIcon {
|
||||
switch deliveryStatus {
|
||||
case .sending:
|
||||
return CompoundIcon(asset: Asset.Images.circle, size: .xSmall, relativeTo: .compound.bodyMD)
|
||||
return CompoundIcon(\.circle, size: .xSmall, relativeTo: .compound.bodyMD)
|
||||
case .sent:
|
||||
return CompoundIcon(\.checkCircle, size: .xSmall, relativeTo: .compound.bodyMD)
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
import Compound
|
||||
import SwiftUI
|
||||
|
||||
@MainActor
|
||||
@@ -191,9 +192,7 @@ struct TimelineReactionButton: View {
|
||||
struct TimelineReactionAddMoreButtonLabel: View {
|
||||
var body: some View {
|
||||
TimelineReactionButtonLabel {
|
||||
Image(asset: Asset.Images.addReaction)
|
||||
.resizable()
|
||||
.scaledFrame(size: 16)
|
||||
CompoundIcon(\.reactionAdd, size: .xSmall, relativeTo: .compound.bodySM)
|
||||
.padding(.vertical, 8)
|
||||
.padding(.horizontal, 12)
|
||||
.foregroundColor(.compound.iconSecondary)
|
||||
|
||||
@@ -21,7 +21,7 @@ struct EncryptedRoomTimelineView: View {
|
||||
|
||||
var body: some View {
|
||||
TimelineStyler(timelineItem: timelineItem) {
|
||||
Label(timelineItem.body, iconAsset: Asset.Images.decryptionError, iconSize: .small, relativeTo: .compound.bodyLG)
|
||||
Label(timelineItem.body, icon: \.time, iconSize: .small, relativeTo: .compound.bodyLG)
|
||||
.labelStyle(RoomTimelineViewLabelStyle())
|
||||
.font(.compound.bodyLG)
|
||||
}
|
||||
|
||||
@@ -101,27 +101,27 @@ enum TimelineItemMenuAction: Identifiable, Hashable {
|
||||
var label: some View {
|
||||
switch self {
|
||||
case .copy:
|
||||
Label(L10n.actionCopy, iconAsset: Asset.Images.copy)
|
||||
Label(L10n.actionCopy, icon: \.copy)
|
||||
case .edit:
|
||||
Label(L10n.actionEdit, iconAsset: Asset.Images.editOutline)
|
||||
Label(L10n.actionEdit, icon: \.edit)
|
||||
case .copyPermalink:
|
||||
Label(L10n.actionCopyLinkToMessage, icon: \.link)
|
||||
case .reply(let isThread):
|
||||
Label(isThread ? L10n.actionReplyInThread : L10n.actionReply, iconAsset: Asset.Images.reply)
|
||||
Label(isThread ? L10n.actionReplyInThread : L10n.actionReply, icon: \.reply)
|
||||
case .forward:
|
||||
Label(L10n.actionForward, iconAsset: Asset.Images.forward)
|
||||
Label(L10n.actionForward, icon: \.forward)
|
||||
case .redact:
|
||||
Label(L10n.actionRemove, icon: \.delete)
|
||||
case .viewSource:
|
||||
Label(L10n.actionViewSource, iconAsset: Asset.Images.viewSource)
|
||||
Label(L10n.actionViewSource, icon: \.code)
|
||||
case .retryDecryption:
|
||||
Label(L10n.actionRetryDecryption, systemImage: "arrow.down.message")
|
||||
case .report:
|
||||
Label(L10n.actionReportContent, icon: \.chatProblem)
|
||||
case .react:
|
||||
Label(L10n.actionReact, iconAsset: Asset.Images.addReaction)
|
||||
Label(L10n.actionReact, icon: \.reactionAdd)
|
||||
case .endPoll:
|
||||
Label(L10n.actionEndPoll, iconAsset: Asset.Images.pollsEnd)
|
||||
Label(L10n.actionEndPoll, icon: \.pollsEnd)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -225,10 +225,7 @@ struct TimelineItemMenu: View {
|
||||
context.send(viewAction: .displayEmojiPicker(itemID: item.id))
|
||||
}
|
||||
} label: {
|
||||
Image(asset: Asset.Images.addReaction)
|
||||
.resizable()
|
||||
.scaledFrame(size: 24)
|
||||
.frame(maxHeight: .infinity, alignment: .center)
|
||||
CompoundIcon(\.reactionAdd, size: .medium, relativeTo: .compound.headingLG)
|
||||
.foregroundColor(.compound.iconSecondary)
|
||||
.padding(10)
|
||||
}
|
||||
|
||||
+1
-1
@@ -40,7 +40,7 @@ struct SecureBackupKeyBackupScreen: View {
|
||||
|
||||
private var disableBackupSection: some View {
|
||||
VStack(spacing: 16) {
|
||||
HeroImage(image: Image(asset: Asset.Images.secureBackupOff))
|
||||
HeroImage(icon: \.keyOffSolid)
|
||||
|
||||
Text(L10n.screenKeyBackupDisableTitle)
|
||||
.foregroundColor(.compound.textPrimary)
|
||||
|
||||
+1
-1
@@ -39,7 +39,7 @@ struct SecureBackupLogoutConfirmationScreen: View {
|
||||
|
||||
@ViewBuilder
|
||||
private var header: some View {
|
||||
HeroImage(image: Image(asset: Asset.Images.secureBackupOff))
|
||||
HeroImage(icon: \.keyOffSolid)
|
||||
}
|
||||
|
||||
@ViewBuilder
|
||||
|
||||
+2
-2
@@ -106,7 +106,7 @@ struct SecureBackupRecoveryKeyScreen: View {
|
||||
|
||||
private var header: some View {
|
||||
VStack(spacing: 16) {
|
||||
HeroImage(image: Image(asset: Asset.Images.secureBackupOn))
|
||||
HeroImage(icon: \.keySolid)
|
||||
|
||||
Text(context.viewState.title)
|
||||
.foregroundColor(.compound.textPrimary)
|
||||
@@ -143,7 +143,7 @@ struct SecureBackupRecoveryKeyScreen: View {
|
||||
Button {
|
||||
context.send(viewAction: .copyKey)
|
||||
} label: {
|
||||
Image(asset: Asset.Images.copy)
|
||||
CompoundIcon(\.copy)
|
||||
}
|
||||
.tint(.compound.iconSecondary)
|
||||
.accessibilityLabel(L10n.actionCopy)
|
||||
|
||||
+2
-1
@@ -71,7 +71,8 @@ struct SessionVerificationScreen: View {
|
||||
@ViewBuilder
|
||||
private var screenHeader: some View {
|
||||
VStack(spacing: 0) {
|
||||
HeroImage(image: Image(systemName: headerImageName))
|
||||
Image(systemName: headerImageName)
|
||||
.heroImage()
|
||||
.padding(.bottom, 16)
|
||||
|
||||
Text(context.viewState.title ?? "")
|
||||
|
||||
@@ -87,7 +87,7 @@ struct SettingsScreen: View {
|
||||
kind: .button { context.send(viewAction: .sessionVerification) })
|
||||
} else {
|
||||
ListRow(label: .default(title: L10n.commonChatBackup,
|
||||
icon: Image(asset: Asset.Images.secureBackupIcon)),
|
||||
icon: \.key),
|
||||
details: context.viewState.showSecureBackupBadge ? .icon(secureBackupBadge) : nil,
|
||||
kind: .navigationLink { context.send(viewAction: .secureBackup) })
|
||||
.accessibilityIdentifier(A11yIdentifiers.settingsScreen.secureBackup)
|
||||
@@ -115,14 +115,14 @@ struct SettingsScreen: View {
|
||||
.accessibilityIdentifier(A11yIdentifiers.settingsScreen.notifications)
|
||||
|
||||
ListRow(label: .default(title: L10n.commonAnalytics,
|
||||
icon: \.polls),
|
||||
icon: \.chart),
|
||||
kind: .navigationLink {
|
||||
context.send(viewAction: .analytics)
|
||||
})
|
||||
.accessibilityIdentifier(A11yIdentifiers.settingsScreen.analytics)
|
||||
|
||||
ListRow(label: .default(title: L10n.commonScreenLock,
|
||||
icon: CompoundIcon(asset: Asset.Images.lock)),
|
||||
icon: \.lock),
|
||||
kind: .navigationLink {
|
||||
context.send(viewAction: .appLock)
|
||||
})
|
||||
@@ -147,7 +147,7 @@ struct SettingsScreen: View {
|
||||
private var manageSessionsSection: some View {
|
||||
Section {
|
||||
ListRow(label: .default(title: L10n.actionManageDevices,
|
||||
icon: CompoundIcon(asset: Asset.Images.devices)),
|
||||
icon: \.devices),
|
||||
kind: .button {
|
||||
context.send(viewAction: .accountSessionsList)
|
||||
})
|
||||
@@ -165,7 +165,7 @@ struct SettingsScreen: View {
|
||||
|
||||
if context.viewState.showDeveloperOptions {
|
||||
ListRow(label: .default(title: L10n.commonDeveloperOptions,
|
||||
icon: CompoundIcon(asset: Asset.Images.codeBlock)),
|
||||
icon: \.code),
|
||||
kind: .navigationLink {
|
||||
context.send(viewAction: .developerOptions)
|
||||
})
|
||||
@@ -177,7 +177,7 @@ struct SettingsScreen: View {
|
||||
private var signOutSection: some View {
|
||||
Section {
|
||||
ListRow(label: .action(title: L10n.screenSignoutPreferenceItem,
|
||||
icon: CompoundIcon(asset: Asset.Images.signOut),
|
||||
icon: \.signOut,
|
||||
role: .destructive),
|
||||
kind: .button {
|
||||
context.send(viewAction: .logout)
|
||||
|
||||
+1
-1
@@ -89,7 +89,7 @@ struct UserDetailsEditScreen: View {
|
||||
}
|
||||
|
||||
private var avatarOverlayIcon: some View {
|
||||
CompoundIcon(asset: Asset.Images.editing, size: .xSmall, relativeTo: .compound.bodyLG)
|
||||
CompoundIcon(\.editSolid, size: .xSmall, relativeTo: .compound.bodyLG)
|
||||
.foregroundColor(.white)
|
||||
.padding(4)
|
||||
.background {
|
||||
|
||||
@@ -76,7 +76,7 @@ struct StartChatScreen: View {
|
||||
ListRow(kind: .custom {
|
||||
MatrixUserShareLink(userID: context.viewState.userID) {
|
||||
ListRowLabel.default(title: L10n.actionInvitePeopleToApp(InfoPlistReader.main.bundleDisplayName),
|
||||
icon: CompoundIcon(asset: Asset.Images.shareIos))
|
||||
icon: \.shareIos)
|
||||
}
|
||||
})
|
||||
.accessibilityIdentifier(A11yIdentifiers.startChatScreen.inviteFriends)
|
||||
|
||||
Reference in New Issue
Block a user