Skip to content

Commit

Permalink
style(tileselector): not show public code if empty
Browse files Browse the repository at this point in the history
  • Loading branch information
emilielr committed Sep 13, 2024
1 parent 6d3bb56 commit 57662cd
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tavla/src/Shared/components/TravelTag/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { TTransportMode, TTransportSubmode } from 'types/graphql-schema'
import { TransportIcon } from 'components/TransportIcon'
import { isOnlyWhiteSpace } from 'app/(admin)/edit/utils'

const transportModeNames: Record<TTransportMode, string> = {
air: 'Fly',
Expand Down Expand Up @@ -67,12 +68,14 @@ function SmallTravelTag({
{icons && (
<TransportIcon
className={`block h-6 fill-background ${
publicCode ? 'w-6' : 'w-4'
publicCode && !isOnlyWhiteSpace(publicCode)
? 'w-6'
: 'w-4'
}`}
transportMode={transportMode}
/>
)}
{publicCode && (
{publicCode && !isOnlyWhiteSpace(publicCode) && (
<div className="text-[0.65rem] w-full flex justify-center align-center">
{publicCode}
</div>
Expand Down

0 comments on commit 57662cd

Please sign in to comment.