-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
77 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
Mlem/App/Views/Root/Tabs/Feeds/SubscriptionListNavigationButton.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// | ||
// SubscriptionListNavigationButton.swift | ||
// Mlem | ||
// | ||
// Created by Sjmarf on 19/09/2024. | ||
// | ||
|
||
import SwiftUI | ||
|
||
struct SubscriptionListNavigationButton<Content: View>: View { | ||
@Environment(NavigationLayer.self) var navigation | ||
let destination: NavigationPage | ||
@ViewBuilder var label: () -> Content | ||
|
||
init(_ destination: NavigationPage, @ViewBuilder label: @escaping () -> Content) { | ||
self.destination = destination | ||
self.label = label | ||
} | ||
|
||
var body: some View { | ||
MultiplatformView(phone: { | ||
NavigationLink(destination, label: label) | ||
}, pad: { | ||
Button(action: { | ||
navigation.root = destination | ||
}, label: label) | ||
.buttonStyle(EmptyButtonStyle()) | ||
}) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters