Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: 네비게이션 아이템 isHidden 수정 #100

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions Projects/Domain/Competition/Interface/Sources/Competition.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Comment on lines 34 to +35
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

형 요거는 내가 그냥 궁금해서 그런데, 새롭게 정의된 isHidden 뷰빌더의 remove 파라미터는 무슨 용도야?!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

자기 자신을 layout에 포함시킬지 아닐지 결정하는 flag 변수입니다~
remove를 false로 두면 hidden 모디파이어를 붙이는데 이렇게 되면 화면에서 사라지지만 레이아웃은 그대로 유지하게 돼요

}

Spacer()
Expand All @@ -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
)
}
Expand Down