mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-04 01:20:12 +00:00
Remove unnecessary marks, they bring little value
This commit is contained in:
committed by
Stefan Ceriu
parent
198127c5d7
commit
9589c689c3
@@ -16,16 +16,10 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
// MARK: - Coordinator
|
||||
|
||||
// MARK: View model
|
||||
|
||||
enum FilePreviewViewModelAction {
|
||||
case cancel
|
||||
}
|
||||
|
||||
// MARK: View
|
||||
|
||||
struct FilePreviewViewState: BindableState {
|
||||
let fileURL: URL
|
||||
let title: String?
|
||||
|
||||
@@ -19,22 +19,12 @@ import SwiftUI
|
||||
typealias FilePreviewViewModelType = StateStoreViewModel<FilePreviewViewState, FilePreviewViewAction>
|
||||
|
||||
class FilePreviewViewModel: FilePreviewViewModelType, FilePreviewViewModelProtocol {
|
||||
// MARK: - Properties
|
||||
|
||||
// MARK: Private
|
||||
|
||||
// MARK: Public
|
||||
|
||||
var callback: ((FilePreviewViewModelAction) -> Void)?
|
||||
|
||||
// MARK: - Setup
|
||||
|
||||
init(fileURL: URL, title: String? = nil) {
|
||||
super.init(initialViewState: FilePreviewViewState(fileURL: fileURL, title: title))
|
||||
}
|
||||
|
||||
// MARK: - Public
|
||||
|
||||
override func process(viewAction: FilePreviewViewAction) async {
|
||||
switch viewAction {
|
||||
case .cancel:
|
||||
|
||||
@@ -19,20 +19,14 @@ import SwiftUI
|
||||
import UIKit
|
||||
|
||||
struct FilePreviewScreen: View {
|
||||
// MARK: Private
|
||||
|
||||
@Environment(\.colorScheme) private var colorScheme
|
||||
|
||||
var counterColor: Color {
|
||||
colorScheme == .light ? .element.secondaryContent : .element.tertiaryContent
|
||||
}
|
||||
|
||||
// MARK: Public
|
||||
|
||||
@ObservedObject var context: FilePreviewViewModel.Context
|
||||
|
||||
// MARK: Views
|
||||
|
||||
var body: some View {
|
||||
PreviewController(fileURL: context.viewState.fileURL, title: context.viewState.title)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user