diff --git a/ios/HackerNews/Screens/LoginScreen.swift b/ios/HackerNews/Screens/LoginScreen.swift index 01919566..c9ffa79c 100644 --- a/ios/HackerNews/Screens/LoginScreen.swift +++ b/ios/HackerNews/Screens/LoginScreen.swift @@ -9,8 +9,8 @@ import Foundation import SwiftUI struct LoginState { - var username: String = "heyrikin" - var password: String = "SSJ4barcelona2024" + var username: String = "" + var password: String = "" var status: LoginStatus = .uninitialized } @@ -24,7 +24,7 @@ struct LoginScreen: View { @ObservedObject var model: AppViewModel var body: some View { - VStack(alignment: .center) { + List { TextField(text: $model.loginState.username) { Text("Username") } diff --git a/ios/HackerNews/Screens/SettingsScreen.swift b/ios/HackerNews/Screens/SettingsScreen.swift index f7b9e9fd..e9532056 100644 --- a/ios/HackerNews/Screens/SettingsScreen.swift +++ b/ios/HackerNews/Screens/SettingsScreen.swift @@ -12,17 +12,21 @@ struct SettingsScreen: View { @ObservedObject var model: AppViewModel @State var shouldPresentSheet = false var body: some View { - VStack { - Button("Login") { - shouldPresentSheet.toggle() + List { + HStack { + Text("Login") } - .sheet(isPresented: $shouldPresentSheet) { - LoginScreen(model: model) + .onTapGesture { + shouldPresentSheet.toggle() } } + .sheet(isPresented: $shouldPresentSheet) { + LoginScreen(model: model) + } } } + #Preview { SettingsScreen(model: AppViewModel()) }