Files
simplex-chat/apps/ios/Shared/Views/Helpers/ComposeFileView.swift
JRoberts 884231369f mobile: files UI (#597)
Co-authored-by: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com>
2022-05-06 21:10:32 +04:00

41 lines
1.1 KiB
Swift

//
// ComposeFileView.swift
// SimpleX (iOS)
//
// Created by JRoberts on 04.05.2022.
// Copyright © 2022 SimpleX Chat. All rights reserved.
//
import SwiftUI
struct ComposeFileView: View {
@Environment(\.colorScheme) var colorScheme
let fileName: String
let cancelFile: (() -> Void)
let cancelEnabled: Bool
var body: some View {
HStack(alignment: .center, spacing: 4) {
Image(systemName: "doc.fill")
.resizable()
.aspectRatio(contentMode: .fit)
.frame(width: 30, height: 30)
.foregroundColor(Color(uiColor: .tertiaryLabel))
.padding(.leading, 4)
Text(fileName)
Spacer()
if cancelEnabled {
Button { cancelFile() } label: {
Image(systemName: "multiply")
}
}
}
.padding(.vertical, 1)
.padding(.trailing, 12)
.frame(height: 50)
.background(colorScheme == .light ? sentColorLight : sentColorDark)
.frame(maxWidth: .infinity)
.padding(.top, 8)
}
}