mattermost-mobile/ios/MattermostShare/Views/NavigationButtons/CancelButton.swift
Elias Nahum 3a3123674a
[Gekidou] iOS Share extension (#6432)
* 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
2022-07-27 10:31:45 -04:00

34 lines
736 B
Swift

//
// CancelButton.swift
// MattermostShare
//
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
//
import SwiftUI
struct CancelButton: View {
var attachments: [AttachmentModel]
@State var pressed: Bool = false
func close() {
let userInfo: [String: Any] = [
"attachments": attachments
]
pressed = true
NotificationCenter.default.post(name: Notification.Name("close"), object: nil, userInfo: userInfo)
}
var body: some View {
FontIcon.button(
.compassIcons(code: .close),
action: close,
fontsize: 24,
color: .white
)
.padding(.trailing, 10)
.padding(.vertical, 5)
.disabled(pressed)
}
}