Started AddAccountDialog
This commit is contained in:
parent
c443cd184b
commit
afc8ce9ee9
|
@ -0,0 +1,9 @@
|
|||
|
||||
"Add" = "Add";
|
||||
|
||||
"Accounts" = "Accounts";
|
||||
"Add account" = "Add account";
|
||||
|
||||
"Bank code" = "Bank code";
|
||||
"Customer ID" = "Online banking login name";
|
||||
"Password" = "Online banking password";
|
|
@ -6,12 +6,11 @@ struct ContentView: View {
|
|||
|
||||
var body: some View {
|
||||
TabView(selection: $selection){
|
||||
Text("First View")
|
||||
.font(.title)
|
||||
AccountsTab()
|
||||
.tabItem {
|
||||
VStack {
|
||||
Image("first")
|
||||
Text("First")
|
||||
Text("Accounts")
|
||||
}
|
||||
}
|
||||
.tag(0)
|
||||
|
|
|
@ -66,5 +66,9 @@
|
|||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
</array>
|
||||
<key>UTImportedTypeDeclarations</key>
|
||||
<array>
|
||||
<dict/>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
|
||||
"Add" = "Hinzufügen";
|
||||
|
||||
"Accounts" = "Konten";
|
||||
"Add account" = "Konto hinzufügen";
|
||||
|
||||
"Bank code" = "Bankleitzahl";
|
||||
"Customer ID" = "Onlinebanking Login Name";
|
||||
"Password" = "Online banking password";
|
|
@ -0,0 +1,13 @@
|
|||
|
||||
import SwiftUI
|
||||
|
||||
|
||||
extension View {
|
||||
|
||||
func hideNavigationBar() -> some View {
|
||||
return self
|
||||
.navigationBarHidden(true)
|
||||
.navigationBarTitle("Title")
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
|
||||
import SwiftUI
|
||||
|
||||
struct AccountsTab: View {
|
||||
var body: some View {
|
||||
NavigationView {
|
||||
NavigationLink(destination: AddAccountDialog()) {
|
||||
Text("Add account")
|
||||
}
|
||||
}
|
||||
.navigationBarHidden(true)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
struct AccountsTab_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
AccountsTab()
|
||||
}
|
||||
}
|
|
@ -0,0 +1,53 @@
|
|||
import SwiftUI
|
||||
|
||||
|
||||
struct AddAccountDialog: View {
|
||||
|
||||
@State private var bankCode = ""
|
||||
@State private var customerId = ""
|
||||
@State private var password = ""
|
||||
|
||||
var body: some View {
|
||||
NavigationView {
|
||||
Form {
|
||||
Section {
|
||||
TextField("Bank code", text: $bankCode)
|
||||
}
|
||||
|
||||
Section {
|
||||
TextField("Customer ID", text: $customerId)
|
||||
|
||||
SecureField("Password", text: $password)
|
||||
}
|
||||
|
||||
Section {
|
||||
HStack {
|
||||
Spacer()
|
||||
Button(action: { self.addAccount() },
|
||||
label: { Text("Add") })
|
||||
.disabled(!self.isRequiredDataEntered())
|
||||
Spacer()
|
||||
}
|
||||
}
|
||||
}
|
||||
.hideNavigationBar()
|
||||
}
|
||||
}
|
||||
|
||||
func isRequiredDataEntered() -> Bool {
|
||||
return bankCode.isEmpty == false
|
||||
&& customerId.isEmpty == false
|
||||
&& password.isEmpty == false
|
||||
}
|
||||
|
||||
func addAccount() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
struct AddAccountDialog_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
AddAccountDialog()
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue