Skip to content

Commit

Permalink
💄 :: [#87] ConfirmationDialog / ConfirmationDialog UI 작업
Browse files Browse the repository at this point in the history
  • Loading branch information
baekteun committed Jul 23, 2023
1 parent f58935d commit d939c29
Show file tree
Hide file tree
Showing 6 changed files with 72 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import Inject
import UIKit
@testable import ConfirmationDialogFeature

@main
final class AppDelegate: UIResponder, UIApplicationDelegate {
Expand All @@ -9,8 +11,14 @@ final class AppDelegate: UIResponder, UIApplicationDelegate {
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil
) -> Bool {
window = UIWindow(frame: UIScreen.main.bounds)
let viewController = UIViewController()
viewController.view.backgroundColor = .yellow
let store = ConfirmationDialogStore()
let viewController = Inject.ViewControllerHost(
ConfirmationDialogViewController(
title: "제목",
description: "내용내용",
store: store
)
)
window?.rootViewController = viewController
window?.makeKeyAndVisible()

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import UIKit

public protocol ConfirmationDialogFactory {
func makeViewController() -> UIViewController
func makeViewController(title: String, description: String) -> UIViewController
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
import UIKit

final class ConfirmationDialogFactoryImpl: ConfirmationDialogFactory {
func makeViewController() -> UIViewController {
func makeViewController(title: String, description: String) -> UIViewController {
let store = ConfirmationDialogStore()
return ConfirmationDialogViewController(store: store)
return ConfirmationDialogViewController(
title: title,
description: description,
store: store
)
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,58 @@
import BaseFeature
import DesignSystem
import Localization
import MSGLayout
import UIKit

final class ConfirmationDialogViewController: BaseModalViewController<ConfirmationDialogStore> {

private enum Metric {
static let horizontalPadding: CGFloat = 40
static let spacing: CGFloat = 8
}
private let titleLabel = DotoriLabel(font: .subtitle1)
private let descriptionLabel = DotoriLabel(textColor: .neutral(.n20), font: .body2)
.set(\.numberOfLines, 2)
private let cancelButton = DotoriButton(text: L10n.Global.cancelButtonTitle)
private let confirmButton = DotoriOutlineButton(text: L10n.Global.confirmButtonTitle)

init(
title: String,
description: String,
store: ConfirmationDialogStore
) {
super.init(store: store)
titleLabel.text = title
descriptionLabel.text = description
}

required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}

override func setLayout() {
MSGLayout.buildLayout {
contentView.layout
.center(.toSuperview())
.horizontal(.toSuperview(), .equal(Metric.horizontalPadding))
}

MSGLayout.stackedLayout(self.contentView) {
VStackView(spacing: Metric.spacing) {
titleLabel

descriptionLabel

HStackView(spacing: Metric.spacing) {
cancelButton

confirmButton
}
.distribution(.fillEqually)
}
.margin(.all(24))
.set(\.backgroundColor, .dotori(.background(.card)))
.set(\.cornerRadius, 16)
}
view.backgroundColor = .gray
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@

"unknown_error" = "An unknown error occurred, please contact us if it persists.";
"cancel_button_title" = "Cancel";
"confirm_button_title" = "Confirm";
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@

"unknown_error" = "알 수 없는 오류가 발생했습니다. 지속될 시 문의해주세요.";
"cancel_button_title" = "취소";
"confirm_button_title" = "확인";

0 comments on commit d939c29

Please sign in to comment.