Skip to content

Commit e5391b7

Browse files
authored
Login screen polish (#321)
1 parent 5470075 commit e5391b7

File tree

2 files changed

+19
-4
lines changed

2 files changed

+19
-4
lines changed

ios/HackerNews/Auth/LoginScreen.swift

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,23 @@ struct LoginScreen: View {
3333
.frame(maxHeight: 16)
3434

3535
TextField("Username", text: $loginState.username)
36-
.textFieldStyle(.roundedBorder)
37-
.autocapitalization(.none)
36+
.textInputAutocapitalization(.none)
37+
.padding()
38+
.background(Color.background)
39+
.clipShape(RoundedRectangle(cornerRadius: 12))
40+
.overlay(
41+
RoundedRectangle(cornerRadius: 12)
42+
.stroke(Color.background.opacity(0.5), lineWidth: 1)
43+
)
3844

3945
SecureField("Password", text: $loginState.password)
40-
.textFieldStyle(.roundedBorder)
46+
.padding()
47+
.background(Color.background)
48+
.clipShape(RoundedRectangle(cornerRadius: 12))
49+
.overlay(
50+
RoundedRectangle(cornerRadius: 12)
51+
.stroke(Color.background.opacity(0.5), lineWidth: 1)
52+
)
4153

4254
Spacer()
4355
.frame(maxHeight: 16)
@@ -55,14 +67,15 @@ struct LoginScreen: View {
5567
Text("Submit")
5668
.font(.ibmPlexMono(.bold, size: 16))
5769
.frame(maxWidth: .infinity)
70+
.frame(height: 40)
5871
}
5972
)
6073
.buttonStyle(.borderedProminent)
6174
.disabled(loginState.username.isEmpty || loginState.password.isEmpty)
6275
}
6376
.frame(maxWidth: .infinity, maxHeight: .infinity)
6477
.padding(32)
65-
.background(Color.background)
78+
.background(.surface)
6679
}
6780
}
6881

ios/HackerNews/HNApp.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ struct Hacker_NewsApp: App {
5959
}
6060
.sheet(isPresented: $appModel.showLoginSheet) {
6161
LoginScreen(model: $appModel)
62+
.presentationDetents([.medium])
63+
.presentationCornerRadius(24)
6264
}
6365
}
6466
}

0 commit comments

Comments
 (0)