summaryrefslogtreecommitdiff
path: root/Sora/Views/PlatformSpecificToolbarItem.swift
diff options
context:
space:
mode:
authorFuwn <[email protected]>2025-03-15 20:37:05 -0700
committerFuwn <[email protected]>2025-03-15 20:37:05 -0700
commit8eae995c5bf475b2e40a807dbdf8927dbd993222 (patch)
tree9d89f0e2c3f5f856429312cebd1cde9bb107cc55 /Sora/Views/PlatformSpecificToolbarItem.swift
parentfeat: Development commit (diff)
downloadsora-testing-8eae995c5bf475b2e40a807dbdf8927dbd993222.tar.xz
sora-testing-8eae995c5bf475b2e40a807dbdf8927dbd993222.zip
feat: Development commit
Diffstat (limited to 'Sora/Views/PlatformSpecificToolbarItem.swift')
-rw-r--r--Sora/Views/PlatformSpecificToolbarItem.swift21
1 files changed, 21 insertions, 0 deletions
diff --git a/Sora/Views/PlatformSpecificToolbarItem.swift b/Sora/Views/PlatformSpecificToolbarItem.swift
new file mode 100644
index 0000000..7c2fb86
--- /dev/null
+++ b/Sora/Views/PlatformSpecificToolbarItem.swift
@@ -0,0 +1,21 @@
+import SwiftUI
+
+struct PlatformSpecificToolbarItem<Content: View>: ToolbarContent {
+ let content: () -> Content
+
+ init(@ViewBuilder content: @escaping () -> Content) {
+ self.content = content
+ }
+
+ var body: some ToolbarContent {
+ #if os(macOS)
+ ToolbarItem {
+ content()
+ }
+ #else
+ ToolbarItem(placement: .bottomBar) {
+ content()
+ }
+ #endif
+ }
+}