mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 16:10:20 +00:00
@@ -14,6 +14,7 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
import Compound
|
||||
import SwiftUI
|
||||
|
||||
enum TimelineReplyViewPlacement {
|
||||
@@ -43,7 +44,7 @@ struct TimelineReplyView: View {
|
||||
ReplyView(sender: sender,
|
||||
plainBody: content.body,
|
||||
formattedBody: nil,
|
||||
icon: .init(kind: .systemIcon("doc.text.fill"), cornerRadii: iconCornerRadii))
|
||||
icon: .init(kind: .iconAsset(Asset.Images.document), cornerRadii: iconCornerRadii))
|
||||
case .image(let content):
|
||||
ReplyView(sender: sender,
|
||||
plainBody: content.body,
|
||||
@@ -66,12 +67,12 @@ struct TimelineReplyView: View {
|
||||
ReplyView(sender: sender,
|
||||
plainBody: L10n.commonVoiceMessage,
|
||||
formattedBody: nil,
|
||||
icon: .init(kind: .icon(Asset.Images.microphone.name), cornerRadii: iconCornerRadii))
|
||||
icon: .init(kind: .icon(\.micOnOutline), cornerRadii: iconCornerRadii))
|
||||
case .location:
|
||||
ReplyView(sender: sender,
|
||||
plainBody: L10n.commonSharedLocation,
|
||||
formattedBody: nil,
|
||||
icon: .init(kind: .icon(Asset.Images.locationMarker.name), cornerRadii: iconCornerRadii))
|
||||
icon: .init(kind: .iconAsset(Asset.Images.addLocation), cornerRadii: iconCornerRadii))
|
||||
}
|
||||
default:
|
||||
LoadingReplyView()
|
||||
@@ -100,7 +101,8 @@ struct TimelineReplyView: View {
|
||||
enum Kind {
|
||||
case mediaSource(MediaSourceProxy)
|
||||
case systemIcon(String)
|
||||
case icon(String)
|
||||
case iconAsset(ImageAsset)
|
||||
case icon(KeyPath<CompoundIcons, Image>)
|
||||
}
|
||||
|
||||
let kind: Kind
|
||||
@@ -191,11 +193,13 @@ struct TimelineReplyView: View {
|
||||
.resizable()
|
||||
.aspectRatio(contentMode: .fit)
|
||||
.padding(8.0)
|
||||
case .icon(let iconName):
|
||||
Image(iconName)
|
||||
case .iconAsset(let asset):
|
||||
Image(asset: asset)
|
||||
.resizable()
|
||||
.aspectRatio(contentMode: .fit)
|
||||
.padding(8.0)
|
||||
case .icon(let keyPath):
|
||||
CompoundIcon(keyPath, size: .small, relativeTo: .body)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,13 +14,14 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
import Compound
|
||||
import SwiftUI
|
||||
|
||||
struct SwipeToReplyView: View {
|
||||
let timelineItem: RoomTimelineItemProtocol
|
||||
|
||||
var body: some View {
|
||||
Image(systemName: "arrowshape.turn.up.left")
|
||||
CompoundIcon(customImage: Asset.Images.reply.swiftUIImage)
|
||||
.foregroundColor(.compound.iconPrimary)
|
||||
.accessibilityHidden(true)
|
||||
}
|
||||
|
||||
+6
-6
@@ -14,7 +14,9 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
import Compound
|
||||
import SwiftUI
|
||||
|
||||
struct TimelineDeliveryStatusView: View {
|
||||
enum Status {
|
||||
case sending
|
||||
@@ -23,20 +25,18 @@ struct TimelineDeliveryStatusView: View {
|
||||
|
||||
let deliveryStatus: Status
|
||||
|
||||
private var systemImageName: String {
|
||||
private var icon: CompoundIcon {
|
||||
switch deliveryStatus {
|
||||
case .sending:
|
||||
return "circle"
|
||||
return CompoundIcon(customImage: Asset.Images.circle.swiftUIImage, size: .xSmall, relativeTo: .compound.bodyMD)
|
||||
case .sent:
|
||||
return "checkmark.circle"
|
||||
return CompoundIcon(\.checkCircle, size: .xSmall, relativeTo: .compound.bodyMD)
|
||||
}
|
||||
}
|
||||
|
||||
var body: some View {
|
||||
Image(systemName: systemImageName)
|
||||
.resizable()
|
||||
icon
|
||||
.foregroundColor(.compound.iconSecondary)
|
||||
.frame(width: 16.0, height: 16.0)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -54,12 +54,12 @@ struct EncryptedRoomTimelineView_Previews: PreviewProvider, TestablePreview {
|
||||
|
||||
static var body: some View {
|
||||
VStack(alignment: .leading, spacing: 20.0) {
|
||||
EncryptedRoomTimelineView(timelineItem: itemWith(text: "Text",
|
||||
EncryptedRoomTimelineView(timelineItem: itemWith(text: L10n.commonWaitingForDecryptionKey,
|
||||
timestamp: "Now",
|
||||
isOutgoing: false,
|
||||
senderId: "Bob"))
|
||||
|
||||
EncryptedRoomTimelineView(timelineItem: itemWith(text: "Some other text",
|
||||
EncryptedRoomTimelineView(timelineItem: itemWith(text: L10n.commonWaitingForDecryptionKey,
|
||||
timestamp: "Later",
|
||||
isOutgoing: true,
|
||||
senderId: "Anne"))
|
||||
|
||||
Reference in New Issue
Block a user