Skip to content

Commit

Permalink
[Feat] sopt-makers#103 - 탈퇴하기 뷰 UI 구현
Browse files Browse the repository at this point in the history
  • Loading branch information
L-j-h-c committed Jan 11, 2023
1 parent 15f2ccc commit 12d8798
Show file tree
Hide file tree
Showing 5 changed files with 123 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,13 @@ public struct I18N {
public static let nicknameEdit = "닉네임 변경"
public static let nicknameEditSuccess = "닉네임이 변경되었습니다."
}

public struct Withdrawal {
public static let withdrawal = "탈퇴하기"
public static let caution = "탈퇴 시 유의사항"
public static let guide1 = "회원 탈퇴를 신청하시면 해당 이메일은 즉시 탈퇴 처리됩니다."
public static let guide2 = "탈퇴 처리 시 계정 내에서 입력했던 정보 (미션 정보 등)는 영구적으로 삭제되며, 복구가 어렵습니다."
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public protocol ModuleFactoryInterface {
func makeNicknameEditVC() -> NicknameEditVC
func makePrivacyPolicyVC() -> PrivacyPolicyVC
func makeTermsOfServiceVC() -> TermsOfServiceVC
func makeWithdrawalVC() -> WithdrawalVC

// MARK: - Utility

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,8 @@ extension SettingVC {

extension SettingVC: WithdrawButtonDelegate {
func withdrawButtonTapped() {
print("회원 탈퇴")
let withdrawalVC = self.factory.makeWithdrawalVC()
navigationController?.pushViewController(withdrawalVC, animated: true)
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
//
// WithdrawalVC.swift
// Presentation
//
// Created by Junho Lee on 2023/01/12.
// Copyright © 2023 SOPT-Stamp-iOS. All rights reserved.
//

import UIKit
import DSKit

import Core

public class WithdrawalVC: UIViewController {

// MARK: - UI Components

private lazy var naviBar = CustomNavigationBar(self, type: .titleWithLeftButton)
.setTitle(I18N.Setting.Withdrawal.withdrawal)

private let cautionLabel = UILabel().then {
$0.text = I18N.Setting.Withdrawal.caution
$0.textColor = DSKitAsset.Colors.gray900.color
$0.textAlignment = .left
$0.numberOfLines = 3
$0.setTypoStyle(.subtitle1)
$0.setLineSpacing(lineSpacing: 10)
}

private let guideLabel = UILabel().then {
$0.text = I18N.Setting.Withdrawal.guide1
$0.textColor = DSKitAsset.Colors.gray600.color
$0.textAlignment = .left
$0.setTypoStyle(.caption1)
$0.setLineSpacing(lineSpacing: 10)
}

private let secondGuideLabel = UILabel().then {
$0.text = I18N.Setting.Withdrawal.guide2
$0.textColor = DSKitAsset.Colors.gray600.color
$0.textAlignment = .left
$0.numberOfLines = 2
$0.setTypoStyle(.caption1)
$0.setLineSpacing(lineSpacing: 10)
}

private lazy var withdrawalButton = UIButton(type: .system).then {
$0.setTitle(I18N.Setting.Withdrawal.withdrawal, for: .normal)
$0.setTitleColor(UIColor.white, for: .normal)
$0.titleLabel?.setTypoStyle(.h2)
$0.layer.cornerRadius = 9
$0.backgroundColor = DSKitAsset.Colors.purple300.color
}

// MARK: - View Life Cycle

public override func viewDidLoad() {
super.viewDidLoad()
self.setUI()
self.setLayout()
}
}

// MARK: - UI & Layout

extension WithdrawalVC {

private func setUI() {
self.view.backgroundColor = .white
}

private func setLayout() {
self.view.addSubviews(naviBar, cautionLabel, guideLabel, secondGuideLabel, withdrawalButton)

naviBar.snp.makeConstraints { make in
make.leading.top.trailing.equalTo(view.safeAreaLayoutGuide)
}

cautionLabel.snp.makeConstraints { make in
make.top.equalTo(naviBar.snp.bottom).offset(16)
make.leading.equalToSuperview().offset(20)
}

guideLabel.snp.makeConstraints { make in
make.top.equalTo(cautionLabel.snp.bottom).offset(16)
make.leading.trailing.equalToSuperview().inset(20)
}

secondGuideLabel.snp.makeConstraints { make in
make.top.equalTo(guideLabel.snp.bottom).offset(16)
make.leading.trailing.equalToSuperview().inset(20)
}

withdrawalButton.snp.makeConstraints { make in
make.top.equalTo(secondGuideLabel.snp.bottom).offset(32)
make.centerX.equalToSuperview()
make.height.equalTo(56.adjusted)
make.width.equalTo(335.adjusted)
}
}
}

// MARK: - Methods

extension WithdrawalVC {

}

Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,11 @@ extension ModuleFactory {
let termsOfServiceVC = TermsOfServiceVC()
return termsOfServiceVC
}

public func makeWithdrawalVC() -> Presentation.WithdrawalVC {
let withdrawalVC = WithdrawalVC()
return withdrawalVC
}
}

// MARK: - Utility
Expand Down

0 comments on commit 12d8798

Please sign in to comment.