Browse Source

Improved code

Signed-off-by: Marino Faggiana <marino@marinofaggiana.com>
Marino Faggiana 2 years ago
parent
commit
d93c55f600
1 changed files with 5 additions and 13 deletions
  1. 5 13
      iOSClient/Main/Create cloud/NCUploadScanDocument.swift

+ 5 - 13
iOSClient/Main/Create cloud/NCUploadScanDocument.swift

@@ -475,7 +475,11 @@ struct UploadScanDocumentView: View {
                                 }
                             }
                         }
-                        .buttonStyle(ButtonUploadScanDocumenStyle(disabled: fileName.isEmpty))
+                        .padding(.horizontal, 40)
+                        .padding(.vertical, 10)
+                        .background(fileName.isEmpty ? Color(UIColor.systemGray4) : Color(NCBrandColor.shared.brand))
+                        .foregroundColor(.white)
+                        .clipShape(Capsule())
                     }
                     // .listRowBackground(Color(UIColor.systemGroupedBackground))
                 }
@@ -500,18 +504,6 @@ struct UploadScanDocumentView: View {
     }
 }
 
-struct ButtonUploadScanDocumenStyle: ButtonStyle {
-    var disabled = false
-    func makeBody(configuration: Configuration) -> some View {
-        configuration.label
-            .padding(.horizontal, 40)
-            .padding(.vertical, 10)
-            .background(disabled ? Color(UIColor.systemGray4) : Color(NCBrandColor.shared.brand))
-            .foregroundColor(.white)
-            .clipShape(Capsule())
-    }
-}
-
 // MARK: - UIViewControllerRepresentable
 
 struct NCSelectRepresentedView: UIViewControllerRepresentable {