2022-11-22 12:50:56 +00:00
|
|
|
//
|
|
|
|
|
// CIChatFeatureView.swift
|
|
|
|
|
// SimpleX (iOS)
|
|
|
|
|
//
|
|
|
|
|
// Created by Evgeny on 21/11/2022.
|
|
|
|
|
// Copyright © 2022 SimpleX Chat. All rights reserved.
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
import SwiftUI
|
|
|
|
|
import SimpleXChat
|
|
|
|
|
|
|
|
|
|
struct CIChatFeatureView: View {
|
|
|
|
|
var chatItem: ChatItem
|
|
|
|
|
var feature: Feature
|
2022-11-23 11:04:08 +00:00
|
|
|
var iconColor: Color
|
2022-11-22 12:50:56 +00:00
|
|
|
|
|
|
|
|
var body: some View {
|
2022-11-28 20:03:39 +04:00
|
|
|
HStack(alignment: .bottom, spacing: 4) {
|
|
|
|
|
Image(systemName: feature.iconFilled)
|
2022-11-22 12:50:56 +00:00
|
|
|
.foregroundColor(iconColor)
|
|
|
|
|
chatEventText(chatItem)
|
|
|
|
|
}
|
|
|
|
|
.padding(.leading, 6)
|
|
|
|
|
.padding(.bottom, 6)
|
|
|
|
|
.textSelection(.disabled)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct CIChatFeatureView_Previews: PreviewProvider {
|
|
|
|
|
static var previews: some View {
|
|
|
|
|
let enabled = FeatureEnabled(forUser: false, forContact: false)
|
2022-11-29 15:19:20 +00:00
|
|
|
CIChatFeatureView(chatItem: ChatItem.getChatFeatureSample(.fullDelete, enabled), feature: ChatFeature.fullDelete, iconColor: enabled.iconColor)
|
2022-11-22 12:50:56 +00:00
|
|
|
}
|
|
|
|
|
}
|