From 7e37fc6f572dd3232feacf2d5b8c015b7fcd7e04 Mon Sep 17 00:00:00 2001 From: Yu Sung Date: Mon, 26 Jan 2026 21:00:17 +0900 Subject: [PATCH] =?UTF-8?q?=EC=B9=B4=EC=B9=B4=EC=98=A4,=20=EC=95=A0?= =?UTF-8?q?=ED=94=8C=20=EB=A1=9C=EA=B7=B8=EC=9D=B8=20=EB=B2=84=ED=8A=BC=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SodaLive/Sources/User/Login/LoginView.swift | 188 ++++++++++++-------- 1 file changed, 109 insertions(+), 79 deletions(-) diff --git a/SodaLive/Sources/User/Login/LoginView.swift b/SodaLive/Sources/User/Login/LoginView.swift index 2d405aa..62014ae 100644 --- a/SodaLive/Sources/User/Login/LoginView.swift +++ b/SodaLive/Sources/User/Login/LoginView.swift @@ -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