mattermost-mobile/ios/MattermostShare/Views/ContentViews/ChannelListView/ChannelListView.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

41 lines
962 B
Swift

//
// ChannelListView.swift
// MattermostShare
//
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
//
import SwiftUI
struct ChannelListView: View {
@EnvironmentObject var shareViewModel: ShareViewModel
var body: some View {
VStack (spacing: 0) {
SearchBarView()
if shareViewModel.search.isEmpty {
HStack {
Text("RECENT")
.font(Font.custom("OpenSans-SemiBold", size: 12))
.foregroundColor(Color.theme.centerChannelColor.opacity(0.64))
Spacer()
}
.padding(.top, 20)
}
List(shareViewModel.allChannels) { channel in
ChannelItemView(
channel: channel
)
}
.listStyle(.plain)
.onDisappear {
if !shareViewModel.search.isEmpty {
shareViewModel.search = ""
}
}
}
.padding(.top, 20)
.padding(.horizontal, 20)
}
}