카카오, 애플 로그인 버튼 추가
This commit is contained in:
@@ -21,100 +21,130 @@ struct LoginView: View {
|
||||
|
||||
var body: some View {
|
||||
BaseView(isLoading: $viewModel.isLoading) {
|
||||
VStack(spacing: 0) {
|
||||
DetailNavigationBar(title: "로그인")
|
||||
ZStack {
|
||||
Color.clear
|
||||
.contentShape(Rectangle())
|
||||
.onTapGesture {
|
||||
hideKeyboard()
|
||||
focusedField = nil
|
||||
}
|
||||
|
||||
Spacer()
|
||||
|
||||
TextField("이메일", text: $viewModel.email)
|
||||
.submitLabel(.next)
|
||||
.focused($focusedField, equals: .email)
|
||||
.autocapitalization(.none)
|
||||
.disableAutocorrection(true)
|
||||
.appFont(size: 15, weight: .medium)
|
||||
.foregroundColor(.grayee)
|
||||
.keyboardType(.emailAddress)
|
||||
VStack(spacing: 0) {
|
||||
DetailNavigationBar(title: "로그인")
|
||||
|
||||
Spacer()
|
||||
|
||||
TextField("이메일", text: $viewModel.email)
|
||||
.submitLabel(.next)
|
||||
.focused($focusedField, equals: .email)
|
||||
.autocapitalization(.none)
|
||||
.disableAutocorrection(true)
|
||||
.appFont(size: 15, weight: .medium)
|
||||
.foregroundColor(.grayee)
|
||||
.keyboardType(.emailAddress)
|
||||
.padding(.vertical, 18)
|
||||
.padding(.horizontal, 13.3)
|
||||
.frame(height: 56)
|
||||
.background(RoundedRectangle(cornerRadius: 6.7).fill(Color.gray33.opacity(0.7)))
|
||||
.padding(.horizontal, 13.3)
|
||||
.onSubmit {
|
||||
self.focusedField = .password
|
||||
}
|
||||
.onTapGesture {
|
||||
self.focusedField = .email
|
||||
}
|
||||
|
||||
HStack {
|
||||
Group {
|
||||
if isPasswordVisible {
|
||||
TextField("비밀번호", text: $viewModel.password)
|
||||
} else {
|
||||
SecureField("비밀번호", text: $viewModel.password)
|
||||
}
|
||||
}
|
||||
.submitLabel(.done)
|
||||
.focused($focusedField, equals: .password)
|
||||
.autocapitalization(.none)
|
||||
.disableAutocorrection(true)
|
||||
.appFont(size: 15, weight: .medium)
|
||||
.foregroundColor(.grayee)
|
||||
|
||||
Spacer()
|
||||
|
||||
Image(systemName: isPasswordVisible ? "eye.slash.fill" : "eye.fill")
|
||||
.foregroundColor(.grayee)
|
||||
.onTapGesture {
|
||||
isPasswordVisible.toggle()
|
||||
}
|
||||
}
|
||||
.padding(.vertical, 18)
|
||||
.padding(.horizontal, 13.3)
|
||||
.frame(height: 56)
|
||||
.background(RoundedRectangle(cornerRadius: 6.7).fill(Color.gray33.opacity(0.7)))
|
||||
.padding(.horizontal, 13.3)
|
||||
.onSubmit {
|
||||
.padding(.top, 16)
|
||||
.onTapGesture {
|
||||
self.focusedField = .password
|
||||
}
|
||||
.onTapGesture {
|
||||
self.focusedField = .email
|
||||
}
|
||||
|
||||
HStack {
|
||||
Group {
|
||||
if isPasswordVisible {
|
||||
TextField("비밀번호", text: $viewModel.password)
|
||||
} else {
|
||||
SecureField("비밀번호", text: $viewModel.password)
|
||||
|
||||
Button(
|
||||
action: {
|
||||
hideKeyboard()
|
||||
viewModel.login()
|
||||
}
|
||||
) {
|
||||
Text("로그인")
|
||||
.appFont(size: 15, weight: .bold)
|
||||
.frame(width: screenSize().width - 26.6, height: 46.7)
|
||||
.foregroundColor(.white)
|
||||
.background(Color.button)
|
||||
.cornerRadius(6.7)
|
||||
}
|
||||
.submitLabel(.done)
|
||||
.focused($focusedField, equals: .password)
|
||||
.autocapitalization(.none)
|
||||
.disableAutocorrection(true)
|
||||
.appFont(size: 15, weight: .medium)
|
||||
.foregroundColor(.grayee)
|
||||
.padding(.top, 40)
|
||||
|
||||
Spacer()
|
||||
|
||||
Image(systemName: isPasswordVisible ? "eye.slash.fill" : "eye.fill")
|
||||
.foregroundColor(.grayee)
|
||||
Text("비밀번호를 잊으셨나요?")
|
||||
.appFont(size: 13.3, weight: .medium)
|
||||
.foregroundColor(Color.graybb)
|
||||
.padding(.vertical, 10)
|
||||
.onTapGesture {
|
||||
isPasswordVisible.toggle()
|
||||
hideKeyboard()
|
||||
AppState.shared.setAppStep(step: .findPassword)
|
||||
}
|
||||
}
|
||||
.padding(.vertical, 18)
|
||||
.padding(.horizontal, 13.3)
|
||||
.frame(height: 56)
|
||||
.background(RoundedRectangle(cornerRadius: 6.7).fill(Color.gray33.opacity(0.7)))
|
||||
.padding(.horizontal, 13.3)
|
||||
.padding(.top, 16)
|
||||
.onTapGesture {
|
||||
self.focusedField = .password
|
||||
}
|
||||
|
||||
Button(
|
||||
action: {
|
||||
hideKeyboard()
|
||||
viewModel.login()
|
||||
}
|
||||
) {
|
||||
Text("로그인")
|
||||
.appFont(size: 15, weight: .bold)
|
||||
.frame(width: screenSize().width - 26.6, height: 46.7)
|
||||
.foregroundColor(.white)
|
||||
.background(Color.button)
|
||||
.cornerRadius(6.7)
|
||||
}
|
||||
.padding(.top, 40)
|
||||
|
||||
Text("비밀번호를 잊으셨나요?")
|
||||
.appFont(size: 13.3, weight: .medium)
|
||||
.foregroundColor(Color.graybb)
|
||||
.padding(.vertical, 10)
|
||||
.onTapGesture {
|
||||
hideKeyboard()
|
||||
AppState.shared.setAppStep(step: .findPassword)
|
||||
}
|
||||
.padding(.top, 30)
|
||||
|
||||
Text("보이스온 회원이 아닌가요? 지금 가입하세요.")
|
||||
.appFont(size: 13.3, weight: .medium)
|
||||
.foregroundColor(Color.graybb)
|
||||
.padding(.vertical, 10)
|
||||
.onTapGesture {
|
||||
hideKeyboard()
|
||||
AppState.shared.setAppStep(step: .signUp)
|
||||
.padding(.top, 30)
|
||||
|
||||
Text("보이스온 회원이 아닌가요? 지금 가입하세요.")
|
||||
.appFont(size: 13.3, weight: .medium)
|
||||
.foregroundColor(Color.graybb)
|
||||
.padding(.vertical, 10)
|
||||
.onTapGesture {
|
||||
hideKeyboard()
|
||||
AppState.shared.setAppStep(step: .signUp)
|
||||
}
|
||||
.padding(.top, 20)
|
||||
|
||||
HStack(spacing: 13.3) {
|
||||
Image("ic_login_email")
|
||||
.onTapGesture {
|
||||
hideKeyboard()
|
||||
AppState.shared.setAppStep(step: .signUp)
|
||||
}
|
||||
|
||||
Image("ic_login_kakao")
|
||||
.onTapGesture {
|
||||
hideKeyboard()
|
||||
AppState.shared.setAppStep(step: .signUp)
|
||||
}
|
||||
|
||||
Image("ic_login_apple")
|
||||
.onTapGesture {
|
||||
hideKeyboard()
|
||||
AppState.shared.setAppStep(step: .signUp)
|
||||
}
|
||||
}
|
||||
.padding(.top, 20)
|
||||
|
||||
Spacer()
|
||||
|
||||
Spacer()
|
||||
}
|
||||
}
|
||||
.onAppear {
|
||||
self.focusedField = .email
|
||||
|
||||
Reference in New Issue
Block a user