another.im-ios/ConversationsClassic/View/Screens/Sharing/SharingPickerScreen.swift
2024-08-07 11:19:53 +02:00

48 lines
1.3 KiB
Swift

import SwiftUI
struct AttachmentPickerScreen: View {
@EnvironmentObject var store: AppStore
@State private var selectedTab: SharingTab = .media
var body: some View {
ZStack {
// Background color
Color.Material.Background.light
.ignoresSafeArea()
// Content
VStack(spacing: 0) {
// Header
SharedNavigationBar(
centerText: .init(text: L10n.Attachment.Prompt.main),
rightButton: .init(
image: Image(systemName: "xmark"),
action: {
store.dispatch(.sharingAction(.showSharing(false)))
}
)
)
// Pickers
switch selectedTab {
case .media:
SharingMediaPickerView()
case .files:
SharingFilesPickerView()
case .location:
SharingLocationPickerView()
case .contacts:
SharingContactsPickerView()
}
// Tab bar
SharingTabBar(selectedTab: $selectedTab)
}
}
}
}