Skip to content

Commit

Permalink
Remove Default Data
Browse files Browse the repository at this point in the history
  • Loading branch information
Rahkeen committed Jan 8, 2025
1 parent ff1bec2 commit 9c4a21d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
6 changes: 3 additions & 3 deletions ios/HackerNews/Screens/LoginScreen.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand All @@ -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")
}
Expand Down
14 changes: 9 additions & 5 deletions ios/HackerNews/Screens/SettingsScreen.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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())
}

0 comments on commit 9c4a21d

Please sign in to comment.