카카오, 애플 로그인 버튼 추가

This commit is contained in:
Yu Sung
2026-01-26 21:00:17 +09:00
parent d0a17739a1
commit 7e37fc6f57

View File

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