Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
hhhello0507 committed Jun 11, 2024
2 parents 370345f + f4553f2 commit 7124f5e
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ struct RealTextFieldStyle: TextFieldStyle {

configuration
.autocorrectionDisabled()
.keyboardType(.asciiCapable)
.textInputAutocapitalization(.never)
.frame(maxWidth: .infinity)
.frame(height: 52)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import SwiftUI
struct ParentJoinFirstView: View {

@StateObject var vm = ParentJoinViewModel()

@Environment(\.dismiss) private var dismiss
@FocusState private var codeFocused: Bool

var body: some View {
ZStack {
Expand All @@ -28,6 +28,7 @@ struct ParentJoinFirstView: View {
}

SeparatedTextField(text: $vm.childCode, length: 6)
.focused($codeFocused)
.padding(.horizontal, 20)

HStack {
Expand Down Expand Up @@ -85,5 +86,8 @@ struct ParentJoinFirstView: View {
Alert(title: Text(vm.dialogMessage),
dismissButton: .default(Text("닫기")))
}
.onAppear {
codeFocused = true
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@ import SwiftUI
struct ParentJoinSecondView: View {

@EnvironmentObject var vm: ParentJoinViewModel

@Environment(\.dismiss) private var dismiss
@FocusState private var emailFocused: Bool
@FocusState private var pwFocused: Bool
@FocusState private var pwCheckFocused: Bool

let childName: String?

Expand All @@ -34,10 +36,20 @@ struct ParentJoinSecondView: View {
}

AlimoTextField("이메일", text: $vm.email)
.focused($emailFocused)
.keyboardType(.emailAddress)
.onSubmit {
pwFocused = true
}

AlimoTextField("비밀번호", text: $vm.pw, type: .password)
.focused($pwFocused)
.onSubmit {
pwCheckFocused = true
}

AlimoTextField("비밀번호 재입력", text: $vm.pwCheck, type: .password)
.focused($pwCheckFocused)

HStack {
Group {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ struct ParentJoinThirdView: View {
AlimoTextField("인증 코드",
text: $vm.code,
type: .none(hasXMark: false))
.keyboardType(.asciiCapable)
.foregroundStyle(.red)
HStack {
Spacer()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,12 @@ import SwiftUI
struct ParentLoginFirstView: View {

@ObservedObject var vm = ParentLoginViewModel()

@EnvironmentObject var tm: TokenManager

@Environment(\.dismiss) private var dismiss
@FocusState private var emailFocused: Bool
@FocusState private var pwFocused: Bool

var body: some View {


let isCompleted = vm.email != "" && vm.pw != ""
let isCorrectPw = Regex.validatePassword(vm.pw)
let isOk = isCompleted && isCorrectPw
Expand All @@ -33,9 +31,16 @@ struct ParentLoginFirstView: View {
Spacer()
}

AlimoTextField("아이디를 입력하세요", text: $vm.email)
AlimoTextField("이메일을 입력하세요", text: $vm.email)
.focused($emailFocused)
.keyboardType(.emailAddress)
.onSubmit {
emailFocused = false
pwFocused = true
}

AlimoTextField("비밀번호를 입력하세요", text: $vm.pw, type: .password)
.focused($pwFocused)

HStack {
if !isCorrectPw && !vm.pw.isEmpty {
Expand Down Expand Up @@ -95,5 +100,8 @@ struct ParentLoginFirstView: View {
Alert(title: Text("아이디 또는 비밀번호가 잘못되었습니다"),
dismissButton: .default(Text("닫기")))
}
.onAppear {
emailFocused = true
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ import SwiftUI
struct StudentLoginFirstView: View {

@ObservedObject var vm = StudentLoginViewModel()

@EnvironmentObject var tm: TokenManager

@Environment(\.dismiss) private var dismiss
@FocusState private var idFocused: Bool
@FocusState private var pwFocused: Bool

var body: some View {
VStack(spacing: 8) {
Expand All @@ -25,7 +25,13 @@ struct StudentLoginFirstView: View {
.padding(.bottom, 10)
.toLeading()
AlimoTextField("아이디를 입력하세요", text: $vm.id)
.focused($idFocused)
.onSubmit {
idFocused = false
pwFocused = true
}
AlimoTextField("비밀번호를 입력하세요", text: $vm.pw, type: .password)
.focused($pwFocused)
Spacer()

let isComplete = vm.id != "" && vm.pw != ""
Expand Down Expand Up @@ -54,5 +60,8 @@ struct StudentLoginFirstView: View {
message: Text("아이디 비밀번호를 다시 확인해 주세요"),
dismissButton: .default(Text("확인")))
}
.onAppear {
idFocused = true
}
}
}

0 comments on commit 7124f5e

Please sign in to comment.