Skip to content

Commit cf4a8a5

Browse files
committed
πŸ’„ [style] κ²Œμ‹œκΈ€μ—μ„œ 계정신고 λ²„νŠΌ μΆ”κ°€
1 parent e48e707 commit cf4a8a5

File tree

7 files changed

+52
-33
lines changed

7 files changed

+52
-33
lines changed

β€ŽFitfty/Projects/Common/Sources/ReportType.swiftβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ import Foundation
1010

1111
public enum ReportType {
1212
case userReport
13-
case postReport
13+
case postUserReport
1414
}

β€ŽFitfty/Projects/Coordinator/Sources/Profile/PostCoordinator.swiftβ€Ž

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ private extension PostCoordinator {
9393

9494
func makeReportViewController(reportedToken: String) -> UIViewController {
9595
let coordinator = ReportCoordinator(
96-
reportType: .postReport,
96+
reportType: .postUserReport,
9797
reportedToken: reportedToken
9898
)
9999
coordinator.parentCoordinator = self
@@ -102,7 +102,7 @@ private extension PostCoordinator {
102102
coordinator.finishDelegate = self
103103
coordinator.parentCoordinator = self
104104
let bottomSheetViewController = BottomSheetViewController(
105-
style: .small,
105+
style: .custom(196),
106106
contentViewController: coordinator.navigationController
107107
)
108108
coordinator.bottomSheetDelegate = bottomSheetViewController

β€ŽFitfty/Projects/Profile/Sources/Post/ViewControllers/MyPostBottomSheetViewController.swiftβ€Ž

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ final public class MyPostBottomSheetViewController: UIViewController {
5656

5757
private func setUp() {
5858
bind()
59+
myPostBottomSheetView.setUpMyPost()
5960
setConstratintsLayout()
6061
setButtonAction()
6162
}
@@ -107,8 +108,8 @@ private extension MyPostBottomSheetViewController {
107108
}
108109

109110
func setButtonAction() {
110-
myPostBottomSheetView.setActionDeleteButton(self, action: #selector(didTapDeleteButton))
111-
myPostBottomSheetView.setActionModifyButton(self, action: #selector(didTapModifyButton))
111+
myPostBottomSheetView.setActionSecondButton(self, action: #selector(didTapDeleteButton))
112+
myPostBottomSheetView.setActionFirstButton(self, action: #selector(didTapModifyButton))
112113
}
113114

114115
}

β€ŽFitfty/Projects/Profile/Sources/Post/Views/MyPostBottomSheetView.swiftβ€Ž

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,16 @@ import Common
1111

1212
final class MyPostBottomSheetView: UIStackView {
1313

14-
private lazy var modifyButton: UIButton = {
14+
private lazy var firstButton: UIButton = {
1515
let button = UIButton()
16-
button.setTitle("κ²Œμ‹œλ¬Ό μˆ˜μ •", for: .normal)
1716
button.setTitleColor(CommonAsset.Colors.gray07.color, for: .normal)
1817
button.titleLabel?.font = FitftyFont.appleSDSemiBold(size: 18).font
1918
button.contentHorizontalAlignment = .left
2019
return button
2120
}()
2221

23-
private lazy var deleteButton: UIButton = {
22+
private lazy var secondButton: UIButton = {
2423
let button = UIButton()
25-
button.setTitle("κ²Œμ‹œλ¬Ό μ‚­μ œ", for: .normal)
2624
button.setTitleColor(CommonAsset.Colors.error.color, for: .normal)
2725
button.titleLabel?.font = FitftyFont.appleSDSemiBold(size: 18).font
2826
button.contentHorizontalAlignment = .left
@@ -48,7 +46,7 @@ final class MyPostBottomSheetView: UIStackView {
4846
self.axis = .vertical
4947
self.distribution = .fill
5048
self.spacing = 24
51-
addArrangedSubviews(modifyButton, seperatorView, deleteButton)
49+
addArrangedSubviews(firstButton, seperatorView, secondButton)
5250
NSLayoutConstraint.activate([
5351
seperatorView.heightAnchor.constraint(equalToConstant: 1)
5452
])
@@ -57,12 +55,24 @@ final class MyPostBottomSheetView: UIStackView {
5755

5856
extension MyPostBottomSheetView {
5957

60-
func setActionModifyButton(_ target: Any?, action: Selector) {
61-
modifyButton.addTarget(target, action: action, for: .touchUpInside)
58+
func setUpMyPost() {
59+
firstButton.setTitle("κ²Œμ‹œκΈ€ μˆ˜μ •", for: .normal)
60+
secondButton.setTitle("κ²Œμ‹œκΈ€ μ‚­μ œ", for: .normal)
6261
}
6362

64-
func setActionDeleteButton( _ target: Any?, action: Selector) {
65-
deleteButton.addTarget(target, action: action, for: .touchUpInside)
63+
func setUpUserPost() {
64+
firstButton.setTitleColor(CommonAsset.Colors.error.color, for: .normal)
65+
firstButton.setTitle("계정 μ‹ κ³ ", for: .normal)
66+
secondButton.setTitle("κ²Œμ‹œκΈ€ μ‹ κ³ ", for: .normal)
67+
}
68+
69+
func setActionFirstButton(_ target: Any?, action: Selector) {
70+
firstButton.addTarget(target, action: action, for: .touchUpInside)
71+
}
72+
73+
func setActionSecondButton( _ target: Any?, action: Selector) {
74+
secondButton.addTarget(target, action: action, for: .touchUpInside)
6675
}
6776

6877
}
78+

Fitfty/Projects/Profile/Sources/Report/ViewControllers/DetailReportType.swift renamed to Fitfty/Projects/Profile/Sources/Report/DetailReportType.swift

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
//
21
// DetailReportType.swift
32
// Profile
43
//
54
// Created by μž„μ˜μ„  on 2023/02/14.
65
// Copyright Β© 2023 Fitfty. All rights reserved.
76
//
8-
97
import Foundation
108

119
enum DetailReportType {
@@ -15,7 +13,7 @@ enum DetailReportType {
1513
case INSULT
1614
case REPEAT
1715
case MISC
18-
16+
1917
var koreanDetailReport: String {
2018
switch self {
2119
case .OBSCENE:
@@ -32,7 +30,7 @@ enum DetailReportType {
3230
return "기타 ([email protected]둜 제보)"
3331
}
3432
}
35-
33+
3634
var englishDetailReport: String {
3735
switch self {
3836
case .OBSCENE:

β€ŽFitfty/Projects/Profile/Sources/Report/ViewControllers/ReportViewController.swiftβ€Ž

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,26 @@ final public class ReportViewController: UIViewController {
1414
let coordinator: ReportCoordinatorInterface
1515
let reportType: ReportType
1616

17-
private lazy var reportButton: UIButton = {
17+
private lazy var userReportButton: UIButton = {
1818
let button = UIButton()
1919
button.setTitleColor(CommonAsset.Colors.error.color, for: .normal)
20+
button.setTitle("계정 μ‹ κ³ ", for: .normal)
2021
button.titleLabel?.font = FitftyFont.appleSDSemiBold(size: 18).font
22+
button.contentHorizontalAlignment = .left
2123
button.addTarget(self, action: #selector(didTapReportButton), for: .touchUpInside)
2224
return button
2325
}()
2426

27+
private let myPostBottomSheetView = MyPostBottomSheetView()
28+
2529
override public func removeFromParent() {
2630
super.removeFromParent()
2731
coordinator.dismiss()
2832
}
2933

3034
public override func viewDidLoad() {
3135
super.viewDidLoad()
32-
setConstraintsLayout()
33-
setTitle()
36+
setUp()
3437
}
3538

3639
public init(coordinator: ReportCoordinatorInterface, reportType: ReportType) {
@@ -43,22 +46,29 @@ final public class ReportViewController: UIViewController {
4346
fatalError("init(coder:) has not been implemented")
4447
}
4548

46-
private func setConstraintsLayout() {
47-
view.addSubviews(reportButton)
48-
NSLayoutConstraint.activate([
49-
reportButton.leadingAnchor.constraint(equalTo: view.leadingAnchor, constant: 20),
50-
reportButton.topAnchor.constraint(equalTo: view.topAnchor, constant: 44)
51-
])
52-
49+
private func setUp() {
50+
setConstraintsLayout()
51+
myPostBottomSheetView.setUpUserPost()
5352
}
5453

55-
private func setTitle() {
54+
private func setConstraintsLayout() {
5655
switch reportType {
5756
case .userReport:
58-
reportButton.setTitle("계정 μ‹ κ³ ", for: .normal)
59-
case .postReport:
60-
reportButton.setTitle("κ²Œμ‹œκΈ€ μ‹ κ³ ", for: .normal)
57+
view.addSubviews(userReportButton)
58+
NSLayoutConstraint.activate([
59+
userReportButton.leadingAnchor.constraint(equalTo: view.leadingAnchor, constant: 20),
60+
userReportButton.topAnchor.constraint(equalTo: view.topAnchor, constant: 44),
61+
userReportButton.trailingAnchor.constraint(equalTo: view.trailingAnchor, constant: -20)
62+
])
63+
case .postUserReport:
64+
view.addSubviews(myPostBottomSheetView)
65+
NSLayoutConstraint.activate([
66+
myPostBottomSheetView.leadingAnchor.constraint(equalTo: view.leadingAnchor, constant: 20),
67+
myPostBottomSheetView.trailingAnchor.constraint(equalTo: view.trailingAnchor, constant: -20),
68+
myPostBottomSheetView.topAnchor.constraint(equalTo: view.topAnchor, constant: 40)
69+
])
6170
}
71+
6272
}
6373

6474
@objc func didTapReportButton(_ sender: Any?) {

β€ŽFitfty/Projects/Profile/Sources/Report/ViewModel/DetailReportViewModel.swiftβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ private extension DetailReportViewModel {
122122
}
123123
do {
124124
switch reportType {
125-
case .postReport:
125+
case .postUserReport:
126126
let request = PostReportRequest(
127127
reportedBoardToken: self.reportedToken,
128128
type: getSelectedReport()

0 commit comments

Comments
Β (0)