* iOS Share extension * Add Fastlane steps for iOS Share Extension * new multi file layout * Add recent label * Refactor code & identation * ux feedback * downsample images * remove options horizontal padding
36 lines
774 B
Swift
36 lines
774 B
Swift
//
|
|
// RemoveAttachmentView.swift
|
|
// MattermostShare
|
|
//
|
|
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
// See LICENSE.txt for license information.
|
|
//
|
|
|
|
import SwiftUI
|
|
|
|
struct RemoveAttachmentView: View {
|
|
@Binding var attachments: [AttachmentModel]
|
|
var index: Int
|
|
|
|
func removeAtIndex(_ index: Int) {
|
|
attachments.remove(at: index)
|
|
}
|
|
|
|
var body: some View {
|
|
if attachments.count > 1 {
|
|
FontIcon.button(
|
|
.compassIcons(code: .closeCircle),
|
|
action: {
|
|
withAnimation {
|
|
removeAtIndex(index)
|
|
}
|
|
},
|
|
fontsize: 24,
|
|
color: Color.theme.centerChannelColor.opacity(0.56)
|
|
)
|
|
.background(.background)
|
|
.cornerRadius(12)
|
|
.offset(x: 5, y: -7)
|
|
}
|
|
}
|
|
}
|