feat: 新增未登录占位组件 LoggedOutView
This commit is contained in:
20
IosClientKit/Sources/CoreUI/LoggedOutView.swift
Normal file
20
IosClientKit/Sources/CoreUI/LoggedOutView.swift
Normal file
@@ -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)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user