Browse Source

coding

Signed-off-by: Marino Faggiana <marino@marinofaggiana.com>
Marino Faggiana 2 năm trước cách đây
mục cha
commit
54699d7044
1 tập tin đã thay đổi với 57 bổ sung58 xóa
  1. 57 58
      iOSClient/Main/Create cloud/NCUploadAssets.swift

+ 57 - 58
iOSClient/Main/Create cloud/NCUploadAssets.swift

@@ -122,79 +122,78 @@ struct UploadAssetsView: View {
     }
 
     var body: some View {
-        ZStack(alignment: .top) {
-            NavigationView {
-                List {
-                    Section(header: Text(NSLocalizedString("_save_path_", comment: ""))) {
-                        HStack {
-                            Label {
-                                if NCUtilityFileSystem.shared.getHomeServer(urlBase: uploadAssets.userBaseUrl.urlBase, userId: uploadAssets.userBaseUrl.userId) == uploadAssets.serverUrl {
-                                    Text("/")
-                                        .frame(maxWidth: .infinity, alignment: .trailing)
-                                } else {
-                                    Text((uploadAssets.serverUrl as NSString).lastPathComponent)
-                                        .frame(maxWidth: .infinity, alignment: .trailing)
-                                }
-                            } icon: {
-                                Image("folder")
-                                    .renderingMode(.template)
-                                    .resizable()
-                                    .scaledToFit()
-                                    .foregroundColor(Color(NCBrandColor.shared.brand))
+        NavigationView {
+            List {
+                Section(header: Text(NSLocalizedString("_save_path_", comment: ""))) {
+                    HStack {
+                        Label {
+                            if NCUtilityFileSystem.shared.getHomeServer(urlBase: uploadAssets.userBaseUrl.urlBase, userId: uploadAssets.userBaseUrl.userId) == uploadAssets.serverUrl {
+                                Text("/")
+                                    .frame(maxWidth: .infinity, alignment: .trailing)
+                            } else {
+                                Text((uploadAssets.serverUrl as NSString).lastPathComponent)
+                                    .frame(maxWidth: .infinity, alignment: .trailing)
                             }
+                        } icon: {
+                            Image("folder")
+                                .renderingMode(.template)
+                                .resizable()
+                                .scaledToFit()
+                                .foregroundColor(Color(NCBrandColor.shared.brand))
                         }
-                        .contentShape(Rectangle())
-                        .onTapGesture {
-                            isPresentedSelect = true
-                        }
-                        .complexModifier { view in
-                            if #available(iOS 16, *) {
-                                view.alignmentGuide(.listRowSeparatorLeading) { _ in
-                                    return 0
-                                }
+                    }
+                    .contentShape(Rectangle())
+                    .onTapGesture {
+                        isPresentedSelect = true
+                    }
+                    .complexModifier { view in
+                        if #available(iOS 16, *) {
+                            view.alignmentGuide(.listRowSeparatorLeading) { _ in
+                                return 0
                             }
                         }
                     }
+                }
 
-                    Section(header: Text(NSLocalizedString("_mode_filename_", comment: ""))) {
+                Section(header: Text(NSLocalizedString("_mode_filename_", comment: ""))) {
 
-                        Toggle(NSLocalizedString("_maintain_original_filename_", comment: ""), isOn: $isMaintainOriginalFilename)
-                            .toggleStyle(SwitchToggleStyle(tint: Color(NCBrandColor.shared.brand)))
-                            .onChange(of: isMaintainOriginalFilename) { newValue in
-                            }
+                    Toggle(NSLocalizedString("_maintain_original_filename_", comment: ""), isOn: $isMaintainOriginalFilename)
+                        .toggleStyle(SwitchToggleStyle(tint: Color(NCBrandColor.shared.brand)))
+                        .onChange(of: isMaintainOriginalFilename) { newValue in
+                        }
 
-                        Toggle(NSLocalizedString("_add_filenametype_", comment: ""), isOn: $isAddFilenametype)
-                            .toggleStyle(SwitchToggleStyle(tint: Color(NCBrandColor.shared.brand)))
-                            .onChange(of: isAddFilenametype) { newValue in
-                            }
-                    }
+                    Toggle(NSLocalizedString("_add_filenametype_", comment: ""), isOn: $isAddFilenametype)
+                        .toggleStyle(SwitchToggleStyle(tint: Color(NCBrandColor.shared.brand)))
+                        .onChange(of: isAddFilenametype) { newValue in
+                        }
+                }
 
-                    Section(header: Text(NSLocalizedString("_filename_", comment: ""))) {
+                Section(header: Text(NSLocalizedString("_filename_", comment: ""))) {
 
-                        HStack {
-                            Text(NSLocalizedString("_filename_", comment: ""))
-                            TextField(NSLocalizedString("_enter_filename_", comment: ""), text: $fileName)
-                                .modifier(TextFieldClearButton(text: $fileName))
-                                .multilineTextAlignment(.trailing)
-                        }
-                        if !uploadAssets.assets.isEmpty {
-                            Text(uploadAssets.previewFileName(fileName: fileName))
-                        }
+                    HStack {
+                        Text(NSLocalizedString("_filename_", comment: ""))
+                        TextField(NSLocalizedString("_enter_filename_", comment: ""), text: $fileName)
+                            .modifier(TextFieldClearButton(text: $fileName))
+                            .multilineTextAlignment(.trailing)
                     }
-                    .complexModifier { view in
-                        if #available(iOS 15, *) {
-                            view.listRowSeparator(.hidden)
-                        }
+                    if !uploadAssets.assets.isEmpty {
+                        Text(uploadAssets.previewFileName(fileName: fileName))
                     }
-
-                    Button(NSLocalizedString("_save_", comment: "")) {
+                }
+                .complexModifier { view in
+                    if #available(iOS 15, *) {
+                        view.listRowSeparator(.hidden)
                     }
-                    .buttonStyle(ButtonUploadScanDocumenStyle(disabled: fileName.isEmpty))
-                    .background(Color(UIColor.systemGroupedBackground))
                 }
-                .navigationTitle(NSLocalizedString("_upload_photos_videos_", comment: ""))
-                .navigationBarTitleDisplayMode(.inline)
+
+                Button(NSLocalizedString("_save_", comment: "")) {
+                }
+                .frame(maxWidth: .infinity)
+                .buttonStyle(ButtonUploadScanDocumenStyle(disabled: fileName.isEmpty))
+                .listRowBackground(Color(UIColor.systemGroupedBackground))
             }
+            .navigationTitle(NSLocalizedString("_upload_photos_videos_", comment: ""))
+            .navigationBarTitleDisplayMode(.inline)
         }
         .sheet(isPresented: $isPresentedSelect) {
             NCSelectViewControllerRepresentable(delegate: uploadAssets)