Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

:: [#314] 구글 준비중 alert #315

Merged
merged 3 commits into from
May 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ public class IntroViewController: BaseViewController<IntroViewModel>, Stepper {

private var introModel: IntroModel?

private let alertView1 = MGAlertOnlyTitleView(title: "구글 로그인은 준비중입니다!").then {
$0.titleLabel?.font = UIFont.Pretendard.labelMedium
$0.titleLabel?.textColor = .black
$0.backgroundColor = DSKitAsset.Colors.gray100.color
}

private var introImageView = MGProfileView(
profileImage: MGProfileImage(
type: .custom,
Expand Down Expand Up @@ -106,7 +112,7 @@ public class IntroViewController: BaseViewController<IntroViewModel>, Stepper {

public override func bindViewModel() {
super.bindViewModel()

let input = IntroViewModel.Input(
goolgeButtonTapped: googleButton.rx.tap.asDriver(),
appleButtonTapped: appleButton.rx.tap.asDriver(),
Expand All @@ -123,6 +129,13 @@ public class IntroViewController: BaseViewController<IntroViewModel>, Stepper {
owner.subTitle.changeText(text: owner.introModel?.subTitle)
})
.disposed(by: disposeBag)

output.showGoogleAlert
.withUnretained(self)
.subscribe(onNext: { owner, _ in
owner.alertView1.present(on: owner.view)
})
.disposed(by: disposeBag)
})
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,11 @@ public class IntroViewModel: AuthViewModelType {

public struct Output {
var introDatas: Observable<IntroModel>
var showGoogleAlert: Observable<Void>
}

private let introModelSubject = PublishSubject<IntroModel>()
private let showGoogleAlertSubject = PublishSubject<Void>()

public init(authUseCase: AuthUseCase) {
self.useCase = authUseCase
Expand All @@ -46,15 +48,17 @@ public class IntroViewModel: AuthViewModelType {

public func transform(_ input: Input, action: (Output) -> Void) -> Output {

let output = Output(introDatas: introModelSubject.asObservable())
let output = Output(introDatas: introModelSubject.asObservable(), showGoogleAlert: showGoogleAlertSubject.asObservable())

action(output)

bindOutput(output: output)

input.goolgeButtonTapped
.drive(onNext: { _ in
print("googleButtonTapp")
.asObservable()
.withUnretained(self)
.subscribe(onNext: { owner, _ in
owner.showGoogleAlertSubject.onNext(())
})
.disposed(by: disposeBag)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ open class MGAuthButton: BaseButton {
$0.contentMode = .scaleAspectFit
}

public let textLabel = MGLabel(font: UIFont.Pretendard.bodyMedium,
public let textLabel = MGLabel(font: UIFont.Pretendard.labelMedium,
isCenter: true,
numberOfLineCount: 1
)
Expand Down Expand Up @@ -53,7 +53,7 @@ private extension MGAuthButton {
func setup(type: AuthLogoType,
spacing: CGFloat?,
radius: Double?) {
self.textLabel.text = type.logoTitle
self.textLabel.changeText(text: type.logoTitle)
self.iconImageView.image = type.imageLogo
self.backgroundColor = type.backgroundColor
self.layer.cornerRadius = radius ?? 8
Expand Down
Loading