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 ) }