Skip to content

Commit

Permalink
[Fix] #244 - mypage 로직 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
jeongdung-eo committed Mar 23, 2024
1 parent a48c85b commit 438c7c3
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 19 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,8 @@ extension InfoCollectionViewCell {
}

func configure(with model: MyPageRowData) {
horizontalStackView.removeArrangedSubview(iconImage)
iconImage.removeFromSuperview()
iconImage.isHidden = true
titleLabel.text = model.title
arrowImage.isHidden = false
arrowImage.isHidden = model.isArrowHidden
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ struct MyPageRowData: Hashable {
var user: String?
var email: String?
var title: String?
var isArrowHidden: Bool = false

static var profile: [MyPageRowData] {
let user = UserDefaults.standard.bool(forKey: DefaultKeys.isAppleLogin) ? KeychainUtil.getAppleUsername() : KeychainUtil.getKakaoNickname()
Expand All @@ -78,6 +79,6 @@ struct MyPageRowData: Hashable {
]

static func version() -> [MyPageRowData] {
return [MyPageRowData(title: I18N.version + " " + (Utils.version ?? "1.0.0"))]
return [MyPageRowData(title: I18N.version + " " + (Utils.version ?? "1.0.0"), isArrowHidden: true)]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,6 @@ extension MyPageViewController {
switch section {
case .support:
cell.configureWithIcon(with: item)
case .info:
cell.configure(with: item)
default:
cell.configure(with: item)
}
Expand All @@ -118,7 +116,7 @@ extension MyPageViewController {
return collectionView.dequeueConfiguredReusableCell(using: profileCellRegistration,
for: indexPath,
item: item)
case .support, .info, .version:
case .support, .info, .version:
return collectionView.dequeueConfiguredReusableCell(using: infoCellRegistration,
for: indexPath,
item: item)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ final class MyPageViewModelImpl: MyPageViewModel {
func transform(input: MyPageViewModelInput) -> MyPageViewModelOutput {

let viewWillAppearSubject = input.viewWillAppearSubject

.map { _ -> MyPageModel in
AmplitudeAnalyticsService.shared.send(event: AnalyticsEvent.MyInfo.viewMyInfo)

Expand All @@ -37,15 +36,15 @@ final class MyPageViewModelImpl: MyPageViewModel {

input.myPageCellTapped
.sink { [weak self] indexPath in
guard let self else { return }
guard let self = self else { return }
guard let section = MyPageModel.Section(rawValue: indexPath.section),
indexPath.item < section.events.count else { return }

guard let coordinator = self.coordinator else { return }
self.sendAnalyticsEvent(section.events[indexPath.item])

switch section {
case .profile:
self.coordinator?.showMyInfoAccountViewController()
coordinator.showMyInfoAccountViewController()
case .support, .info:
let url = section.urls[indexPath.item]
self.openSafariController.send(url.url)
Expand All @@ -61,4 +60,8 @@ final class MyPageViewModelImpl: MyPageViewModel {
private func sendAnalyticsEvent(_ event: AnalyticsEvent.MyInfo) {
AmplitudeAnalyticsService.shared.send(event: event)
}

deinit {
cancelBag.forEach { $0.cancel() }
}
}

0 comments on commit 438c7c3

Please sign in to comment.