카카오, 애플 로그인 버튼 추가
This commit is contained in:
@@ -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)
|
Spacer()
|
||||||
.submitLabel(.next)
|
|
||||||
.focused($focusedField, equals: .email)
|
TextField("이메일", text: $viewModel.email)
|
||||||
.autocapitalization(.none)
|
.submitLabel(.next)
|
||||||
.disableAutocorrection(true)
|
.focused($focusedField, equals: .email)
|
||||||
.appFont(size: 15, weight: .medium)
|
.autocapitalization(.none)
|
||||||
.foregroundColor(.grayee)
|
.disableAutocorrection(true)
|
||||||
.keyboardType(.emailAddress)
|
.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
|
|
||||||
}
|
|
||||||
|
|
||||||
HStack {
|
Button(
|
||||||
Group {
|
action: {
|
||||||
if isPasswordVisible {
|
hideKeyboard()
|
||||||
TextField("비밀번호", text: $viewModel.password)
|
viewModel.login()
|
||||||
} 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)
|
|
||||||
.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(
|
Text("보이스온 회원이 아닌가요? 지금 가입하세요.")
|
||||||
action: {
|
.appFont(size: 13.3, weight: .medium)
|
||||||
hideKeyboard()
|
.foregroundColor(Color.graybb)
|
||||||
viewModel.login()
|
.padding(.vertical, 10)
|
||||||
}
|
.onTapGesture {
|
||||||
) {
|
hideKeyboard()
|
||||||
Text("로그인")
|
AppState.shared.setAppStep(step: .signUp)
|
||||||
.appFont(size: 15, weight: .bold)
|
}
|
||||||
.frame(width: screenSize().width - 26.6, height: 46.7)
|
.padding(.top, 20)
|
||||||
.foregroundColor(.white)
|
|
||||||
.background(Color.button)
|
|
||||||
.cornerRadius(6.7)
|
|
||||||
}
|
|
||||||
.padding(.top, 40)
|
|
||||||
|
|
||||||
Text("비밀번호를 잊으셨나요?")
|
HStack(spacing: 13.3) {
|
||||||
.appFont(size: 13.3, weight: .medium)
|
Image("ic_login_email")
|
||||||
.foregroundColor(Color.graybb)
|
.onTapGesture {
|
||||||
.padding(.vertical, 10)
|
hideKeyboard()
|
||||||
.onTapGesture {
|
AppState.shared.setAppStep(step: .signUp)
|
||||||
hideKeyboard()
|
}
|
||||||
AppState.shared.setAppStep(step: .findPassword)
|
|
||||||
}
|
|
||||||
.padding(.top, 30)
|
|
||||||
|
|
||||||
Text("보이스온 회원이 아닌가요? 지금 가입하세요.")
|
Image("ic_login_kakao")
|
||||||
.appFont(size: 13.3, weight: .medium)
|
.onTapGesture {
|
||||||
.foregroundColor(Color.graybb)
|
hideKeyboard()
|
||||||
.padding(.vertical, 10)
|
AppState.shared.setAppStep(step: .signUp)
|
||||||
.onTapGesture {
|
}
|
||||||
hideKeyboard()
|
|
||||||
AppState.shared.setAppStep(step: .signUp)
|
Image("ic_login_apple")
|
||||||
|
.onTapGesture {
|
||||||
|
hideKeyboard()
|
||||||
|
AppState.shared.setAppStep(step: .signUp)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.padding(.top, 20)
|
.padding(.top, 20)
|
||||||
|
|
||||||
Spacer()
|
Spacer()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.onAppear {
|
.onAppear {
|
||||||
self.focusedField = .email
|
self.focusedField = .email
|
||||||
|
|||||||
Reference in New Issue
Block a user