IceCubesApp/IceCubesApp/App/Tabs/AccountTab.swift

27 lines
714 B
Swift
Raw Normal View History

2022-12-20 15:08:09 +00:00
import SwiftUI
2022-12-22 09:53:36 +00:00
import Env
2022-12-20 15:08:09 +00:00
import Network
import Account
import Models
import Shimmer
struct AccountTab: View {
2022-12-22 10:19:56 +00:00
@EnvironmentObject private var currentAccount: CurrentAccount
2022-12-20 15:08:09 +00:00
@StateObject private var routeurPath = RouterPath()
var body: some View {
NavigationStack(path: $routeurPath.path) {
2022-12-22 10:19:56 +00:00
if let account = currentAccount.account {
AccountDetailView(account: account, isCurrentUser: true)
2022-12-20 15:08:09 +00:00
.withAppRouteur()
.withSheetDestinations(sheetDestinations: $routeurPath.presentedSheet)
} else {
AccountDetailView(account: .placeholder())
.redacted(reason: .placeholder)
.shimmering()
}
}
.environmentObject(routeurPath)
}
}