feat: 更新文档和视图以支持iOS 17及优化用户体验
- 更新Yana项目文档,调整适用版本至iOS 17,确保与最新开发环境兼容。 - 在多个视图中重构代码,优化状态管理和视图逻辑,提升用户体验。 - 添加默认初始化器以简化状态管理,确保各个Feature的状态一致性。 - 更新视图组件,移除不必要的硬编码,增强代码可读性和维护性。 - 修复多个视图中的逻辑错误,确保功能正常运行。
This commit is contained in:
@@ -8,8 +8,8 @@ struct MainView: View {
|
||||
var body: some View {
|
||||
WithPerceptionTracking {
|
||||
InternalMainView(store: store)
|
||||
.onChange(of: store.isLoggedOut) { isLoggedOut in
|
||||
if isLoggedOut {
|
||||
.onChange(of: store.isLoggedOut) {
|
||||
if store.isLoggedOut {
|
||||
onLogout?()
|
||||
}
|
||||
}
|
||||
@@ -32,12 +32,12 @@ struct InternalMainView: View {
|
||||
.navigationDestination(for: MainFeature.Destination.self) { destination in
|
||||
DestinationView(destination: destination, store: self.store)
|
||||
}
|
||||
.onChange(of: path) { newPath in
|
||||
store.send(.navigationPathChanged(newPath))
|
||||
.onChange(of: path) {
|
||||
store.send(.navigationPathChanged(path))
|
||||
}
|
||||
.onChange(of: store.navigationPath) { newPath in
|
||||
if path != newPath {
|
||||
path = newPath
|
||||
.onChange(of: store.navigationPath) {
|
||||
if path != store.navigationPath {
|
||||
path = store.navigationPath
|
||||
}
|
||||
}
|
||||
.onAppear {
|
||||
@@ -91,9 +91,11 @@ struct InternalMainView: View {
|
||||
// 底部导航栏 - 固定在底部
|
||||
VStack {
|
||||
Spacer()
|
||||
BottomTabView(selectedTab: store.binding(
|
||||
get: { Tab(rawValue: $0.selectedTab.rawValue) ?? .feed },
|
||||
send: { MainFeature.Action.selectTab(MainFeature.Tab(rawValue: $0.rawValue) ?? .feed) }
|
||||
BottomTabView(selectedTab: Binding(
|
||||
get: { Tab(rawValue: store.selectedTab.rawValue) ?? .feed },
|
||||
set: { newTab in
|
||||
store.send(.selectTab(MainFeature.Tab(rawValue: newTab.rawValue) ?? .feed))
|
||||
}
|
||||
))
|
||||
}
|
||||
.frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .bottom)
|
||||
|
Reference in New Issue
Block a user