Skip to content

Commit

Permalink
✨ :: [#210] SigninViewController / GAuthSigninButton 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
uuuunseo committed Nov 26, 2023
1 parent ea99ad2 commit 53745e1
Showing 1 changed file with 3 additions and 48 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import Localization
import MSGLayout
import UIKit
import UtilityModule
import GAuthSignin

final class SigninViewController: BaseStoredViewController<SigninStore> {
private let dotoriLogoImageView = UIImageView()
Expand All @@ -17,11 +18,6 @@ final class SigninViewController: BaseStoredViewController<SigninStore> {
.withTintColor(.dotori(.primary(.p10)))
.resize(width: 182, height: 41)
)
private let dotoriSubTitle = DotoriLabel(
"광주소프트웨어마이스터고\n기숙사 관리 시스템, DOTORI",
textColor: .neutral(.n20),
font: .subtitle2
)
private let signinButton = GAuthButton(
auth: .signin,
color: .colored,
Expand All @@ -31,11 +27,7 @@ final class SigninViewController: BaseStoredViewController<SigninStore> {
override func addView() {
view.addSubviews {
dotoriLogoImageView
emailTextField
passwordTextField
renewalPasswordButton
signinButton
signupButton
}
}

Expand All @@ -46,28 +38,11 @@ final class SigninViewController: BaseStoredViewController<SigninStore> {
.top(.to(view.safeAreaLayoutGuide).top, .equal(20))
.height(41)

emailTextField.layout
.centerX(.toSuperview())
.horizontal(.toSuperview(), .equal(20))
.top(.to(dotoriLogoImageView).bottom, .equal(30))

passwordTextField.layout
.centerX(.toSuperview())
.horizontal(.toSuperview(), .equal(20))
.top(.to(emailTextField).bottom, .equal(8))

renewalPasswordButton.layout
.trailing(.to(passwordTextField).trailing)
.top(.to(passwordTextField).bottom, .equal(8))

signinButton.layout
.centerX(.toSuperview())
.horizontal(.toSuperview(), .equal(20))
.top(.to(renewalPasswordButton).bottom, .equal(32))

signupButton.layout
.centerX(.toSuperview())
.top(.to(signinButton).bottom, .equal(16))
.bottom(.toSuperview(), .equal(-60))
.height(50)
}
}

Expand All @@ -80,26 +55,6 @@ final class SigninViewController: BaseStoredViewController<SigninStore> {
}

override func bindAction() {
emailTextField.textPublisher
.map(Store.Action.updateEmail)
.sink(receiveValue: store.send(_:))
.store(in: &subscription)

passwordTextField.textPublisher
.map(Store.Action.updatePassword)
.sink(receiveValue: store.send(_:))
.store(in: &subscription)

signupButton.tapPublisher
.map { Store.Action.signupButtonDidTap }
.sink(receiveValue: store.send(_:))
.store(in: &subscription)

renewalPasswordButton.tapPublisher
.map { Store.Action.renewalPasswordButtonDidTap }
.sink(receiveValue: store.send(_:))
.store(in: &subscription)

signinButton.tapPublisher
.map { Store.Action.signinButtonDidTap }
.sink(receiveValue: store.send(_:))
Expand Down

0 comments on commit 53745e1

Please sign in to comment.