feat: 新增应用设置功能及相关视图
- 在MainFeature中集成AppSettingFeature,支持应用设置页面的导航与状态管理。 - 新增AppSettingView以展示用户头像和昵称编辑功能,提升用户体验。 - 更新MainView以支持应用设置页面的展示,增强导航功能。
This commit is contained in:
27
yana/Features/AppSettingFeature.swift
Normal file
27
yana/Features/AppSettingFeature.swift
Normal file
@@ -0,0 +1,27 @@
|
||||
import Foundation
|
||||
import ComposableArchitecture
|
||||
|
||||
struct AppSettingFeature: Reducer {
|
||||
struct State: Equatable {
|
||||
var nickname: String = "hahahaha"
|
||||
var avatarURL: String? = nil
|
||||
}
|
||||
enum Action: Equatable {
|
||||
case onAppear
|
||||
case editNicknameTapped
|
||||
case logoutTapped
|
||||
// 可扩展更多 action
|
||||
}
|
||||
func reduce(into state: inout State, action: Action) -> Effect<Action> {
|
||||
switch action {
|
||||
case .onAppear:
|
||||
return .none
|
||||
case .editNicknameTapped:
|
||||
// 预留编辑昵称逻辑
|
||||
return .none
|
||||
case .logoutTapped:
|
||||
// 预留登出逻辑
|
||||
return .none
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user