mirror of
https://github.com/leonboe1/QuickDrop.git
synced 2026-11-11 19:11:10 +00:00
iOS: Fix share extension showed app introduction, share extension add cancel button, add browse button to settings
This commit is contained in:
1 parent
006f389891
commit
9d71ed35b7
4 files changed
+152
-14
No files matched your search
@@ -13,8 +13,15 @@ struct ContentView: View {
|
||||
var body: some View {
|
||||
AppRootView(isPlus: .constant(true), phoneView: {
|
||||
DeviceListView()
|
||||
.environment(\.sheetActive, isShareExtension())
|
||||
}, settingsView: {
|
||||
EmptyView()
|
||||
CustomSection {
|
||||
LUIButton {
|
||||
SaveFilesManager.shared.openDownloadedFilesFolder()
|
||||
} label: {
|
||||
NavigationLinkLabel(imageName: "folder.fill", text: "BrowseDownloadedFiles")
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -31,7 +38,7 @@ struct DeviceListView: View {
|
||||
|
||||
var body: some View {
|
||||
|
||||
NavigationSubView(header: "QuickDrop ") {
|
||||
NavigationSubView(header: "QuickDrop ", navigationBarLayout: isShareExtension() ? .SmallOnlyAlways : .Default) {
|
||||
|
||||
VStack(alignment: .leading, spacing: 8) {
|
||||
|
||||
@@ -117,7 +124,14 @@ struct DeviceListView: View {
|
||||
}
|
||||
.padding(.vertical, 16)
|
||||
}
|
||||
.navigationBarItems(trailing: LUISettingsButton())
|
||||
.navigationBarItems(trailing: ZStack {
|
||||
if isShareExtension() {
|
||||
XButton(action: { NearbyConnectionManager.shared.attachments?.closeView?() })
|
||||
}
|
||||
else {
|
||||
LUISettingsButton()
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -176,6 +190,15 @@ struct DeviceButton: View {
|
||||
}
|
||||
|
||||
|
||||
func isShareExtension() -> Bool {
|
||||
#if EXTENSION
|
||||
return true
|
||||
#else
|
||||
return false
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
//extension DeviceListView {
|
||||
// static var preview: DeviceListView {
|
||||
// let model = SendModel()
|
||||
|
||||
Reference in new issue
Block a user