diff --git a/IosClientKit/Sources/CoreUI/LoggedOutView.swift b/IosClientKit/Sources/CoreUI/LoggedOutView.swift new file mode 100644 index 0000000..1513ab4 --- /dev/null +++ b/IosClientKit/Sources/CoreUI/LoggedOutView.swift @@ -0,0 +1,20 @@ +import SwiftUI + +/// 未登录占位视图(打卡/计划/我的页复用)。 +public struct LoggedOutView: View { + private let onNavigateToAuth: () -> Void + + public init(onNavigateToAuth: @escaping () -> Void) { + self.onNavigateToAuth = onNavigateToAuth + } + + public var body: some View { + ContentUnavailableView { + Label("未登录", systemImage: "lock") + } description: { + Text("登录后即可查看") + } actions: { + Button("去登录", action: onNavigateToAuth) + } + } +}