From 7cd158d18dee90eaeac40604c11a654bfd79966f Mon Sep 17 00:00:00 2001 From: haeseoklee Date: Fri, 20 Dec 2024 01:04:48 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EB=84=A4=EB=B9=84=EA=B2=8C=EC=9D=B4?= =?UTF-8?q?=EC=85=98=20=EC=95=84=EC=9D=B4=ED=85=9C=20isHidden=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Competition/Interface/Sources/Competition.swift | 12 ++++++++++++ .../Sources/Home/Views/HomeNavigationBarView.swift | 10 +++------- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/Projects/Domain/Competition/Interface/Sources/Competition.swift b/Projects/Domain/Competition/Interface/Sources/Competition.swift index 6f47aa3..66be68b 100644 --- a/Projects/Domain/Competition/Interface/Sources/Competition.swift +++ b/Projects/Domain/Competition/Interface/Sources/Competition.swift @@ -102,6 +102,18 @@ public extension Competition { } } +public extension Competition.Status { + + var isCreated: Bool { + switch self { + case .created: + return true + default: + return false + } + } +} + public extension MissionStatus { func toCompetitionStatus(hasOtherPlayer: Bool) -> Competition.Status { diff --git a/Projects/Feature/Home/Interface/Sources/Home/Views/HomeNavigationBarView.swift b/Projects/Feature/Home/Interface/Sources/Home/Views/HomeNavigationBarView.swift index f71d3e2..897c63c 100644 --- a/Projects/Feature/Home/Interface/Sources/Home/Views/HomeNavigationBarView.swift +++ b/Projects/Feature/Home/Interface/Sources/Home/Views/HomeNavigationBarView.swift @@ -32,10 +32,7 @@ struct HomeNavigationBarView: View { .onTapGesture { store.send(.didTapMissionInfoGuideToolTip) } - .isHidden( - store.isMissionInfoGuideToolTipShowed || store.competition?.status != .created(hasOtherPlayer: true), - remove: true - ) + .isHidden(store.isMissionInfoGuideToolTipShowed, remove: true) } Spacer() @@ -49,18 +46,17 @@ struct HomeNavigationBarView: View { .frame(width: 28, height: 28) .foregroundColor(SharedDesignSystemAsset.Colors.gray1.swiftUIColor) } - .isHidden(store.competition?.board.isDisabled == false || !store.isMeHost, remove: true) + .isHidden(!((store.competition?.status.isCreated) ?? false), remove: true) .overlay { SharedDesignSystemAsset.Images.invitationCodeGuideToolTip.swiftUIImage .resizable() .frame(width: 161, height: 72) .offset(x: -42, y: 50) - .onTapGesture { store.send(.didTapInvitationInfoToolTip) } .isHidden( - store.isInvitationGuideToolTipShowed || store.competition?.status != .created(hasOtherPlayer: false) || !store.isMeHost, + store.isInvitationGuideToolTipShowed || !((store.competition?.status.isCreated) ?? false), remove: true ) }