Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
ming1016 committed Oct 12, 2024
1 parent 1f6b233 commit 9ab7fde
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 4 deletions.
10 changes: 9 additions & 1 deletion SwiftPamphletApp/Guide/Bookmark/View/BookmarkListView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,15 @@ struct BookmarkListView: View {
var body: some View {
List {
ForEach(bms) { bm in
NavigationLink(destination: GuideDetailView(t: bm.name, icon: bm.icon, plName: bm.pamphletName, limit: $limit, trigger: $trigger)) {
NavigationLink(
destination: GuideDetailView(
t: bm.name,
icon: bm.icon,
plName: bm.pamphletName,
limit: $limit,
trigger: $trigger
)
) {
HStack {
if bm.icon.isEmpty == false {
Image(systemName: bm.icon)
Expand Down
20 changes: 17 additions & 3 deletions SwiftPamphletApp/Guide/View/GuideListView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,15 @@ struct GuideListView: View {
}
NavigationStack {
SPOutlineListView(d: listModel.filtered(), c: \.sub) { i in
NavigationLink(destination: GuideDetailView(t: i.t, icon: i.icon, plName: "ap", limit: $limit, trigger: $trigger)) {
NavigationLink(
destination: GuideDetailView(
t: i.t,
icon: i.icon,
plName: "ap",
limit: $limit,
trigger: $trigger
)
) {
HStack(spacing:3) {
if i.icon.isEmpty == false {
Image(systemName: i.icon)
Expand All @@ -49,7 +57,10 @@ struct GuideListView: View {
.contentShape(Rectangle())
}
}
.searchable(text: $listModel.searchText, prompt: "搜索 Apple 技术手册")
.searchable(
text: $listModel.searchText,
prompt: "搜索 Apple 技术手册"
)
.listStyle(.sidebar)
.onChange(of: trigger, { oldValue, newValue in
updateApBookmarks()
Expand All @@ -63,7 +74,10 @@ struct GuideListView: View {
.overlay {
if listModel.filtered().isEmpty {
ContentUnavailableView {
Label("无结果", systemImage: "rectangle.and.text.magnifyingglass")
Label(
"无结果",
systemImage: "rectangle.and.text.magnifyingglass"
)
} description: {
Text("请再次输入")
}
Expand Down

0 comments on commit 9ab7fde

Please sign in to comment.