Skip to content

Commit

Permalink
[Feat] #231 - 공통 알림 모달 컨텐츠 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
yungu0010 committed Feb 16, 2024
1 parent 682b521 commit 63e9e49
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 42 deletions.
6 changes: 3 additions & 3 deletions iOS-NOTTODO/iOS-NOTTODO/Global/Enum/MyInfoURL.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import Foundation
import SafariServices

enum MyInfoURL {
case guid, faq, notice, question, service, personalInfo, googleForm
case guid, faq, notice, question, service, personalInfo, commonAlarmModal
var url: String {
switch self {
case .guid:
Expand All @@ -25,8 +25,8 @@ enum MyInfoURL {
return "https://teamnottodo.notion.site/81594da775614d23900cdb2475eadb73?pvs=4"
case .personalInfo:
return "https://teamnottodo.notion.site/5af34df7da3649fc941312c5f533c1eb"
case .googleForm:
return "https://forms.gle/gwBJ4hL4bCTjXRTP6"
case .commonAlarmModal:
return "https://open.kakao.com/o/gbrW727f"
}
}

Expand Down
2 changes: 1 addition & 1 deletion iOS-NOTTODO/iOS-NOTTODO/Global/Literals/Strings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ struct I18N {
static let allow = "허용"
static let notiDialogButton = "네, 알겠어요 :)"

static let formButton = "이정도야 쉽지!"
static let commonModalTitle = "지금 바로 참여하기"
static let deprecatedTitle = "더 이상 보지 않기"
static let close = "닫기"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,14 @@ final class CommonNotificationViewController: UIViewController {
private let backgroundView = UIView()
private let titleLabel = UILabel()
private let subTitleLabel = UILabel()
private let highlightView = UIView()
private let icon = UIImageView()
private let deprecatedTitle = UILabel()
private let bottomView = UIView()
private lazy var formButton = UIButton()
private lazy var closeButton = UIButton()
private lazy var deprecatedButton = UIButton()
private let blackButton = UIButton()
private let greenButton = UIButton()
private let closeButton = UIButton()
private let deprecatedButton = UIButton()

// MARK: - View Life Cycle

Expand All @@ -47,14 +49,15 @@ extension CommonNotificationViewController {

backgroundView.do {
$0.backgroundColor = .white
$0.layer.cornerRadius = 15
$0.layer.cornerRadius = 20
}

titleLabel.do {
$0.font = .Pretendard(.bold, size: 18)
$0.textAlignment = .center
$0.text = "1분 서비스 피드백하고 \n기프티콘 받아가세요!"
$0.numberOfLines = 2
$0.font = .Pretendard(.semiBold, size: 22)
$0.textAlignment = .left
$0.text = "오픈채팅으로\n일일 인증 하고\n갓생살자!"
$0.numberOfLines = 0
$0.partHighlightText(targetString: "일일 인증", targetHighlightColor: .green2 ?? .black)
}

subTitleLabel.do {
Expand All @@ -63,32 +66,45 @@ extension CommonNotificationViewController {
$0.text = "매주 추첨을 통해 스타벅스 기프티콘을 드려요"
}

highlightView.do {
$0.backgroundColor = .green2
}

deprecatedTitle.do {
$0.font = .Pretendard(.medium, size: 13)
$0.font = .Pretendard(.semiBold, size: 15)
$0.text = I18N.deprecatedTitle
$0.textColor = .gray3
}

icon.do {
$0.contentMode = .scaleAspectFit
$0.image = .icStarbucks
$0.image = .imgOpenChat
}

bottomView.do {
$0.backgroundColor = .gray5
$0.layer.maskedCorners = [.layerMinXMaxYCorner, .layerMaxXMaxYCorner]
$0.layer.cornerRadius = 15
$0.layer.cornerRadius = 20
}

formButton.do {
blackButton.do {
$0.backgroundColor = .black
$0.setTitle(I18N.formButton, for: .normal)
$0.setTitle(I18N.commonModalTitle, for: .normal)
$0.setTitleColor(.white, for: .normal)
$0.titleLabel?.font = .Pretendard(.medium, size: 13)
$0.layer.cornerRadius = 20
$0.addTarget(self, action: #selector(didFormButtonTap), for: .touchUpInside)
}

greenButton.do {
$0.backgroundColor = .green2
$0.setTitle(I18N.commonModalTitle, for: .normal)
$0.setTitleColor(.ntdBlack, for: .normal)
$0.titleLabel?.font = .Pretendard(.semiBold, size: 20)
$0.layer.cornerRadius = 8
$0.addTarget(self, action: #selector(didFormButtonTap), for: .touchUpInside)
}

deprecatedButton.do {
$0.setImage(.deprecatedCheckBox, for: .normal)
$0.setImage(.deprecatedCheckBoxFill, for: .selected)
Expand All @@ -97,63 +113,59 @@ extension CommonNotificationViewController {

closeButton.do {
$0.setTitle(I18N.close, for: .normal)
$0.setTitleColor(.gray3, for: .normal)
$0.titleLabel?.font = .Pretendard(.medium, size: 13)
$0.setTitleColor(.ntdBlack, for: .normal)
$0.titleLabel?.font = .Pretendard(.semiBold, size: 15)
$0.addTarget(self, action: #selector(didCancelButtonTap), for: .touchUpInside)
}
}

private func setLayout() {

view.addSubview(backgroundView)
backgroundView.addSubviews(titleLabel, subTitleLabel, icon, formButton, bottomView)
backgroundView.addSubviews(titleLabel, highlightView, icon, greenButton, bottomView)
bottomView.addSubviews(deprecatedButton, deprecatedTitle, closeButton)

backgroundView.snp.makeConstraints {
$0.horizontalEdges.equalToSuperview().inset(46)
$0.height.equalTo(408)
$0.width.equalTo(312)
$0.height.equalTo(459)
$0.center.equalToSuperview()
}
titleLabel.snp.makeConstraints {
$0.top.equalToSuperview().inset(28)
$0.centerX.equalToSuperview()
}

subTitleLabel.snp.makeConstraints {
$0.top.equalTo(titleLabel.snp.bottom).offset(6)
$0.centerX.equalToSuperview()
titleLabel.snp.makeConstraints {
$0.top.equalToSuperview().inset(30)
$0.leading.equalToSuperview().inset(32)
}

icon.snp.makeConstraints {
$0.top.equalTo(subTitleLabel.snp.bottom).offset(7)
$0.horizontalEdges.equalToSuperview().inset(16)
$0.height.equalTo(197)
$0.top.equalTo(titleLabel.snp.bottom).offset(4)
$0.horizontalEdges.equalToSuperview().inset(28)
$0.height.equalTo(201)
}

formButton.snp.makeConstraints {
$0.top.equalTo(icon.snp.bottom).offset(4)
$0.horizontalEdges.equalToSuperview().inset(36)
$0.height.equalTo(40)
greenButton.snp.makeConstraints {
$0.top.equalTo(icon.snp.bottom).offset(7)
$0.horizontalEdges.equalToSuperview().inset(32)
$0.height.equalTo(52)
}

bottomView.snp.makeConstraints {
$0.horizontalEdges.bottom.equalToSuperview()
$0.height.equalTo(50)
$0.height.equalTo(58)
}

deprecatedButton.snp.makeConstraints {
$0.centerY.equalToSuperview()
$0.leading.equalToSuperview().inset(10)
$0.leading.equalToSuperview().inset(20)
$0.size.equalTo(20)
}

deprecatedTitle.snp.makeConstraints {
$0.leading.equalTo(deprecatedButton.snp.trailing).offset(4)
$0.leading.equalTo(deprecatedButton.snp.trailing).offset(5)
$0.centerY.equalToSuperview()
}

closeButton.snp.makeConstraints {
$0.trailing.equalToSuperview().inset(15)
$0.trailing.equalToSuperview().inset(33)
$0.centerY.equalToSuperview()
}
}
Expand All @@ -166,7 +178,7 @@ extension CommonNotificationViewController {
@objc
func didFormButtonTap() {

guard let url = URL(string: MyInfoURL.googleForm.url) else { return }
guard let url = URL(string: MyInfoURL.commonAlarmModal.url) else { return }
let safariView: SFSafariViewController = SFSafariViewController(url: url)
safariView.delegate = self
self.present(safariView, animated: true, completion: nil)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ final class NottodoModalViewController: UIViewController {
private var modalView = UIView()
private let withdrawView = WithdrawModalView()
private let quitView = QuitModalView()
private lazy var safariViewController = SFSafariViewController(url: URL(string: MyInfoURL.googleForm.url)!)
private lazy var safariViewController = SFSafariViewController(url: URL(string: MyInfoURL.commonAlarmModal.url)!)

// MARK: - Life Cycle

Expand Down

0 comments on commit 63e9e49

Please sign in to comment.