Skip to content

Commit

Permalink
Merged PR 32629: Hide city-pass header icon when the user has no acti…
Browse files Browse the repository at this point in the history
…ve city-pass

Hide city-pass header icon when the user has no active city-pass
  • Loading branch information
RikSchefferAmsterdam committed Sep 9, 2024
2 parents d0f537b + bc0af3e commit 7a9ea15
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/modules/city-pass/components/HeaderComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,14 @@ import {IconButton} from '@/components/ui/buttons/IconButton'
import {Icon} from '@/components/ui/media/Icon'
import {Placement} from '@/components/ui/types'
import {useDispatch} from '@/hooks/redux/useDispatch'
import {useGetSecureItem} from '@/hooks/secureStorage/useGetSecureItem'
import {useGetSecureCityPasses} from '@/modules/city-pass/hooks/useGetSecureCityPasses'
import {showCityPasses} from '@/modules/city-pass/slice'
import {SecureItemKey} from '@/utils/secureStorage'

export const HeaderComponent = () => {
const dispatch = useDispatch()
const {item: secureCityPasses, isLoading} = useGetSecureItem(
SecureItemKey.cityPasses,
)
const secureCityPasses = useGetSecureCityPasses()

if (!secureCityPasses || isLoading) {
if (!secureCityPasses?.length) {
return null
}

Expand Down

0 comments on commit 7a9ea15

Please sign in to comment.