From 12d8798ae428300f042a866c432784cec8666edd Mon Sep 17 00:00:00 2001 From: L-j-h-c Date: Thu, 12 Jan 2023 03:39:17 +0900 Subject: [PATCH] =?UTF-8?q?[Feat]=20#103=20-=20=ED=83=88=ED=87=B4=ED=95=98?= =?UTF-8?q?=EA=B8=B0=20=EB=B7=B0=20UI=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Sources/Literals/StringLiterals.swift | 7 ++ .../Sources/ModuleFactoryInterface.swift | 1 + .../Sources/SettingScene/VC/SettingVC.swift | 3 +- .../SettingScene/VC/WithdrawalVC.swift | 108 ++++++++++++++++++ .../Sources/ModuleFactory/ModuleFactory.swift | 5 + 5 files changed, 123 insertions(+), 1 deletion(-) create mode 100644 SOPT-Stamp-iOS/Projects/Presentation/Sources/SettingScene/VC/WithdrawalVC.swift diff --git a/SOPT-Stamp-iOS/Projects/Core/Sources/Literals/StringLiterals.swift b/SOPT-Stamp-iOS/Projects/Core/Sources/Literals/StringLiterals.swift index b0d8bb1e6..633ae546c 100644 --- a/SOPT-Stamp-iOS/Projects/Core/Sources/Literals/StringLiterals.swift +++ b/SOPT-Stamp-iOS/Projects/Core/Sources/Literals/StringLiterals.swift @@ -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 = "탈퇴 처리 시 계정 내에서 입력했던 정보 (미션 정보 등)는 영구적으로 삭제되며, 복구가 어렵습니다." + } } } diff --git a/SOPT-Stamp-iOS/Projects/Presentation/Sources/ModuleFactoryInterface.swift b/SOPT-Stamp-iOS/Projects/Presentation/Sources/ModuleFactoryInterface.swift index 5aacbe549..6aceb6f58 100644 --- a/SOPT-Stamp-iOS/Projects/Presentation/Sources/ModuleFactoryInterface.swift +++ b/SOPT-Stamp-iOS/Projects/Presentation/Sources/ModuleFactoryInterface.swift @@ -35,6 +35,7 @@ public protocol ModuleFactoryInterface { func makeNicknameEditVC() -> NicknameEditVC func makePrivacyPolicyVC() -> PrivacyPolicyVC func makeTermsOfServiceVC() -> TermsOfServiceVC + func makeWithdrawalVC() -> WithdrawalVC // MARK: - Utility diff --git a/SOPT-Stamp-iOS/Projects/Presentation/Sources/SettingScene/VC/SettingVC.swift b/SOPT-Stamp-iOS/Projects/Presentation/Sources/SettingScene/VC/SettingVC.swift index d0f551032..c58dd7909 100644 --- a/SOPT-Stamp-iOS/Projects/Presentation/Sources/SettingScene/VC/SettingVC.swift +++ b/SOPT-Stamp-iOS/Projects/Presentation/Sources/SettingScene/VC/SettingVC.swift @@ -150,7 +150,8 @@ extension SettingVC { extension SettingVC: WithdrawButtonDelegate { func withdrawButtonTapped() { - print("회원 탈퇴") + let withdrawalVC = self.factory.makeWithdrawalVC() + navigationController?.pushViewController(withdrawalVC, animated: true) } } diff --git a/SOPT-Stamp-iOS/Projects/Presentation/Sources/SettingScene/VC/WithdrawalVC.swift b/SOPT-Stamp-iOS/Projects/Presentation/Sources/SettingScene/VC/WithdrawalVC.swift new file mode 100644 index 000000000..07efac6be --- /dev/null +++ b/SOPT-Stamp-iOS/Projects/Presentation/Sources/SettingScene/VC/WithdrawalVC.swift @@ -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 { + +} + diff --git a/SOPT-Stamp-iOS/Projects/SOPT-Stamp-iOS/Sources/ModuleFactory/ModuleFactory.swift b/SOPT-Stamp-iOS/Projects/SOPT-Stamp-iOS/Sources/ModuleFactory/ModuleFactory.swift index 2890254ee..26a2fb752 100644 --- a/SOPT-Stamp-iOS/Projects/SOPT-Stamp-iOS/Sources/ModuleFactory/ModuleFactory.swift +++ b/SOPT-Stamp-iOS/Projects/SOPT-Stamp-iOS/Sources/ModuleFactory/ModuleFactory.swift @@ -169,6 +169,11 @@ extension ModuleFactory { let termsOfServiceVC = TermsOfServiceVC() return termsOfServiceVC } + + public func makeWithdrawalVC() -> Presentation.WithdrawalVC { + let withdrawalVC = WithdrawalVC() + return withdrawalVC + } } // MARK: - Utility