mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-24 02:22:44 +02:00
Merge together SwiftUI template model files and update folder structure.
This commit is contained in:
committed by
Stefan Ceriu
parent
be1b771463
commit
60635fc364
+19
-15
@@ -1,23 +1,27 @@
|
||||
/*
|
||||
Copyright 2021 New Vector Ltd
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
//
|
||||
// Copyright 2021 New Vector Ltd
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import UIKit
|
||||
import SwiftUI
|
||||
|
||||
struct TemplateUserProfileCoordinatorParameters {
|
||||
let session: MXSession
|
||||
}
|
||||
|
||||
final class TemplateUserProfileCoordinator: Coordinator {
|
||||
|
||||
// MARK: - Properties
|
||||
|
||||
-21
@@ -1,21 +0,0 @@
|
||||
//
|
||||
// Copyright 2021 New Vector Ltd
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
struct TemplateUserProfileCoordinatorParameters {
|
||||
let session: MXSession
|
||||
}
|
||||
-22
@@ -1,22 +0,0 @@
|
||||
//
|
||||
// Copyright 2021 New Vector Ltd
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
enum TemplateUserProfileStateAction {
|
||||
case viewAction(TemplateUserProfileViewAction)
|
||||
case updatePresence(TemplateUserProfilePresence)
|
||||
}
|
||||
-24
@@ -1,24 +0,0 @@
|
||||
//
|
||||
// Copyright 2021 New Vector Ltd
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
enum TemplateUserProfileViewAction {
|
||||
case incrementCount
|
||||
case decrementCount
|
||||
case cancel
|
||||
case done
|
||||
}
|
||||
-22
@@ -1,22 +0,0 @@
|
||||
//
|
||||
// Copyright 2021 New Vector Ltd
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
enum TemplateUserProfileViewModelResult {
|
||||
case cancel
|
||||
case done
|
||||
}
|
||||
-24
@@ -1,24 +0,0 @@
|
||||
//
|
||||
// Copyright 2021 New Vector Ltd
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
struct TemplateUserProfileViewState: BindableState {
|
||||
let avatar: AvatarInputProtocol?
|
||||
let displayName: String?
|
||||
var presence: TemplateUserProfilePresence
|
||||
var count: Int
|
||||
}
|
||||
+30
-4
@@ -16,13 +16,17 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
// MARK: - Coordinator
|
||||
|
||||
enum TemplateUserProfilePresence {
|
||||
case online
|
||||
case idle
|
||||
case offline
|
||||
}
|
||||
|
||||
extension TemplateUserProfilePresence {
|
||||
extension TemplateUserProfilePresence: Identifiable, CaseIterable {
|
||||
var id: Self { self }
|
||||
|
||||
var title: String {
|
||||
switch self {
|
||||
case .online:
|
||||
@@ -35,8 +39,30 @@ extension TemplateUserProfilePresence {
|
||||
}
|
||||
}
|
||||
|
||||
extension TemplateUserProfilePresence: CaseIterable { }
|
||||
// MARK: View model
|
||||
|
||||
extension TemplateUserProfilePresence: Identifiable {
|
||||
var id: Self { self }
|
||||
enum TemplateUserProfileStateAction {
|
||||
case viewAction(TemplateUserProfileViewAction)
|
||||
case updatePresence(TemplateUserProfilePresence)
|
||||
}
|
||||
|
||||
enum TemplateUserProfileViewModelResult {
|
||||
case cancel
|
||||
case done
|
||||
}
|
||||
|
||||
// MARK: View
|
||||
|
||||
struct TemplateUserProfileViewState: BindableState {
|
||||
let avatar: AvatarInputProtocol?
|
||||
let displayName: String?
|
||||
var presence: TemplateUserProfilePresence
|
||||
var count: Int
|
||||
}
|
||||
|
||||
enum TemplateUserProfileViewAction {
|
||||
case incrementCount
|
||||
case decrementCount
|
||||
case cancel
|
||||
case done
|
||||
}
|
||||
-2
@@ -17,8 +17,6 @@
|
||||
import SwiftUI
|
||||
import Combine
|
||||
|
||||
|
||||
|
||||
@available(iOS 14, *)
|
||||
typealias TemplateUserProfileViewModelType = StateStoreViewModel<TemplateUserProfileViewState,
|
||||
TemplateUserProfileStateAction,
|
||||
Reference in New Issue
Block a user