67 lines
1.8 KiB
Swift
67 lines
1.8 KiB
Swift
//
|
|
// AddEntryView.swift
|
|
// gastrack
|
|
//
|
|
// Created by Pradyun Setti on 23/02/2025.
|
|
//
|
|
|
|
import SwiftUI
|
|
|
|
struct AddEntryView: View {
|
|
@State private var t1: String = ""
|
|
@State private var t2: String = ""
|
|
|
|
@State private var Odometer = ""
|
|
@State private var CostPerLitre = ""
|
|
@State private var Litres = ""
|
|
@State private var TotalCost = ""
|
|
@State private var FuelType = ""
|
|
@State private var Location = ""
|
|
|
|
var body: some View {
|
|
NavigationView {
|
|
Form {
|
|
HStack() {
|
|
Text("Last: \(72398)")
|
|
Divider()
|
|
TextField("Odometer", text: $Odometer)
|
|
|
|
}
|
|
|
|
HStack {
|
|
TextField("Cost/L", text: $CostPerLitre)
|
|
Divider()
|
|
TextField("Litres", text: $Litres)
|
|
Divider()
|
|
TextField("Total Cost", text: $TotalCost)
|
|
}
|
|
|
|
TextField("Fuel Type", text: $FuelType)
|
|
TextField("Location", text: $Location)
|
|
}
|
|
.navigationTitle("New Entry")
|
|
.toolbar {
|
|
ToolbarItem(placement: .cancellationAction) {
|
|
Button("Cancel") {}
|
|
}
|
|
ToolbarItem(placement: .confirmationAction) {
|
|
Button("Confirm") {
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
#Preview {
|
|
NavigationView {
|
|
Text("s")
|
|
.sheet(isPresented: Binding(get: {true}, set: {_ in})) {
|
|
AddEntryView()
|
|
.presentationDetents([.medium])
|
|
.presentationCornerRadius(20)
|
|
}
|
|
}
|
|
}
|