@@ -58,6 +58,7 @@ struct FileRowView: View {
58
58
}
59
59
. frame ( width: 64 , height: 64 )
60
60
. clipped ( )
61
+ . cornerRadius ( 8 )
61
62
} else {
62
63
Image ( systemName: getIcon ( ) )
63
64
. font ( . system( size: 50 ) )
@@ -79,6 +80,11 @@ struct FileRowView: View {
79
80
80
81
81
82
HStack ( spacing: 6 ) {
83
+ Label ( file. mime, systemImage: " " )
84
+ . font ( . caption)
85
+ . labelStyle ( CustomLabel ( spacing: 3 ) )
86
+ . lineLimit ( 1 )
87
+
82
88
Label ( " " , systemImage: " lock " )
83
89
. font ( . caption)
84
90
. labelStyle ( CustomLabel ( spacing: 3 ) )
@@ -96,10 +102,7 @@ struct FileRowView: View {
96
102
}
97
103
98
104
HStack ( spacing: 5 ) {
99
- Label ( file. mime, systemImage: getIcon ( ) )
100
- . font ( . caption)
101
- . labelStyle ( CustomLabel ( spacing: 3 ) )
102
- . lineLimit ( 1 )
105
+
103
106
104
107
Label ( file. userUsername, systemImage: " person " )
105
108
. font ( . caption)
@@ -127,15 +130,13 @@ struct FileListView: View {
127
130
128
131
@State private var files : [ DFFile ] = [ ]
129
132
@State private var currentPage = 1
130
- @State private var hasNextPage = false
131
- @State private var isLoading = true
133
+ @State private var hasNextPage : Bool = false
134
+ @State private var isLoading : Bool = true
132
135
@State private var errorMessage : String ? = nil
133
- @State private var showingUploadSheet = false
134
- @State private var showingShortCreator = false
135
- @State private var showingAlbumCreator = false
136
-
137
- @State private var previewFile : Bool = true
138
- @State private var selectedFile : DFFile ? = nil
136
+ @State private var showingUploadSheet : Bool = false
137
+ @State private var showingShortCreator : Bool = false
138
+ @State private var showingAlbumCreator : Bool = false
139
+ @State private var showingPreview : Bool = false
139
140
140
141
@State private var showingDeleteConfirmation = false
141
142
@State private var fileIDsToDelete : [ Int ] = [ ]
@@ -183,6 +184,8 @@ struct FileListView: View {
183
184
}
184
185
}
185
186
}
187
+ . toolbar ( showingPreview ? . hidden : . visible, for: . tabBar)
188
+ . animation ( . easeInOut( duration: 0.3 ) , value: showingPreview)
186
189
. navigationDestination ( for: DFFile . self) { file in
187
190
ZStack {
188
191
if redirectURLs [ file. raw] == nil {
@@ -197,28 +200,33 @@ struct FileListView: View {
197
200
. navigationTitle ( file. name)
198
201
. navigationBarTitleDisplayMode ( . inline)
199
202
. toolbar {
200
- ToolbarItem ( placement: . navigationBarTrailing) {
201
- Button ( action: {
202
- showFileInfo = true
203
- } ) {
204
- Label ( " File Info " , systemImage: " info.circle " )
205
- }
206
- }
207
203
ToolbarItem ( placement: . navigationBarTrailing) {
208
204
Menu {
209
- fileShareMenu ( for: file)
205
+ fileContextMenu ( for: file, isPreviewing : true , isPrivate : file . private , expirationText : $expirationText , passwordText : $passwordText , fileNameText : $fileNameText )
210
206
} label: {
211
- Image ( systemName: " square.and.arrow.up " )
207
+ Image ( systemName: " ellipsis.circle " )
212
208
}
213
209
}
214
- ToolbarItem ( placement: . navigationBarTrailing ) {
210
+ ToolbarItemGroup ( placement: . bottomBar ) {
215
211
Menu {
216
- fileContextMenu ( for: file, isPreviewing : true , isPrivate : file . private , expirationText : $expirationText , passwordText : $passwordText , fileNameText : $fileNameText )
212
+ fileShareMenu ( for: file)
217
213
} label: {
218
- Image ( systemName: " ellipsis.circle " )
214
+ Image ( systemName: " square.and.arrow.up " )
215
+ }
216
+ Spacer ( )
217
+ Button ( action: {
218
+ showFileInfo = true
219
+ } ) {
220
+ Label ( " File Info " , systemImage: " info.circle " )
219
221
}
220
222
}
221
223
}
224
+ . onAppear {
225
+ showingPreview = true
226
+ }
227
+ . onDisappear {
228
+ showingPreview = false
229
+ }
222
230
}
223
231
}
224
232
}
@@ -422,7 +430,7 @@ struct FileListView: View {
422
430
isPreviewing: isPreviewing,
423
431
isPrivate: isPrivate,
424
432
onPreview: {
425
- selectedFile = file
433
+ navigationPath . wrappedValue . append ( file)
426
434
} ,
427
435
onCopyShareLink: {
428
436
UIPasteboard . general. string = file. url
0 commit comments