Skip to content

Commit

Permalink
Update deprecated NavigationLink
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyfreeman committed May 13, 2024
1 parent 945ba85 commit 4a88ee2
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ struct CategoryView: View {
}
.padding(14)
}

NavigationLink("", isActive: $showInfoView) {
.navigationDestination(isPresented: $showInfoView) {
if let selectedItem {
InfoView(item: selectedItem)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ struct CategoryDeletedView: View {
}
.padding(14)
}

NavigationLink("", isActive: $showDeletedView) {
.navigationDestination(isPresented: $showDeletedView) {
if let selectedItem {
DeletedInfoView(item: selectedItem)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@ struct NFCEditorView: View {
}
.padding(14)
}

NavigationLink("", isActive: $showSaveAs) {
.navigationDestination(isPresented: $showSaveAs) {
SaveAsView(item: $item)
.onDisappear {
dismiss()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,9 @@ struct ArchiveSearchView: View {
.customBackground(.background)
}
}
.background {
NavigationLink("", isActive: $showInfoView) {
if let selectedItem {
InfoView(item: selectedItem)
}
.navigationDestination(isPresented: $showInfoView) {
if let selectedItem {
InfoView(item: selectedItem)
}
}
}
Expand Down
22 changes: 13 additions & 9 deletions Flipper/Packages/UI/Sources/Hub/HubView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,18 @@ struct HubView: View {
NavigationStack {
ScrollView {
VStack(spacing: 14) {
NavigationLink(isActive: $appsState.showApplications) {
AppsView(selectedSegment: $appsState.selectedSegment)
.environmentObject(applications)
Button {
appsState.showApplications = true
} label: {
AppsRowCard()
.environmentObject(applications)
}
.navigationDestination(
isPresented: $appsState.showApplications
) {
AppsView(selectedSegment: $appsState.selectedSegment)
.environmentObject(applications)
}
.onReceive(router.showApps) {
appsState.selectedSegment = .installed
appsState.showApplications = true
Expand All @@ -58,12 +63,6 @@ struct HubView: View {
}
}
.padding(14)

NavigationLink("", isActive: $appsState.showApplication) {
if let applicationAlias = appsState.applicationAlias{
AppView(alias: applicationAlias)
}
}
}
.background(Color.background)
.navigationBarBackground(Color.a1)
Expand Down Expand Up @@ -92,6 +91,11 @@ struct HubView: View {
.fullScreenCover(isPresented: $showDetectReader) {
DetectReaderView()
}
.navigationDestination(isPresented: $appsState.showApplication) {
if let applicationAlias = appsState.applicationAlias{
AppView(alias: applicationAlias)
}
}
}

struct NFCCard: View {
Expand Down

0 comments on commit 4a88ee2

Please sign in to comment.