Skip to content

Commit c7b07be

Browse files
authored
Give bag names full width on mobile in Add mode cards (#1)
On narrow screens the bag name was sharing a row with the disclosure triangle, color dot, switch-bag icon, and packed count, leaving so little horizontal space that names wrapped character-by-character. Keep icons and count on the top row, and render the bag name on its own full-width row below on mobile. Desktop layout is unchanged.
1 parent b8e4a76 commit c7b07be

1 file changed

Lines changed: 12 additions & 6 deletions

File tree

src/components/trips/AddModeBagCards.tsx

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -179,12 +179,12 @@ function DroppableBagCard(props: BagCardProps) {
179179
}}
180180
>
181181
{/* Header */}
182-
<div class="flex items-start justify-between gap-1 md:items-center md:gap-2">
183-
<div class="flex min-w-0 flex-1 items-start gap-1 md:items-center md:gap-2">
182+
<div class="flex items-center justify-between gap-1 md:gap-2">
183+
<div class="flex min-w-0 flex-1 items-center gap-1 md:gap-2">
184184
{/* Disclosure triangle */}
185185
<button
186186
type="button"
187-
class="flex h-4 w-4 flex-shrink-0 items-center justify-center pt-0.5 text-gray-400 hover:text-gray-600 md:h-5 md:w-5 md:pt-0"
187+
class="flex h-4 w-4 flex-shrink-0 items-center justify-center text-gray-400 hover:text-gray-600 md:h-5 md:w-5"
188188
onClick={(e) => {
189189
e.stopPropagation();
190190
props.onToggleExpand();
@@ -202,13 +202,14 @@ function DroppableBagCard(props: BagCardProps) {
202202
<span class="flex-shrink-0 text-sm md:text-lg">📦</span>
203203
) : props.bag ? (
204204
<div
205-
class="mt-1 h-2.5 w-2.5 flex-shrink-0 rounded-full md:mt-0 md:h-4 md:w-4"
205+
class="h-2.5 w-2.5 flex-shrink-0 rounded-full md:h-4 md:w-4"
206206
style={{ 'background-color': bagColor() }}
207207
/>
208208
) : (
209209
<span class="flex-shrink-0 text-sm md:text-lg">📋</span>
210210
)}
211-
<span class="min-w-0 flex-1 text-sm leading-tight font-semibold break-words text-gray-900 md:truncate md:text-base md:leading-normal">
211+
{/* Desktop: bag name inline with icons */}
212+
<span class="hidden min-w-0 flex-1 truncate text-base leading-normal font-semibold text-gray-900 md:inline">
212213
{bagName()}
213214
</span>
214215
<Show when={props.bag && !props.isContainer}>
@@ -233,11 +234,16 @@ function DroppableBagCard(props: BagCardProps) {
233234
</Show>
234235
</Show>
235236
</div>
236-
<span class="flex-shrink-0 pt-0.5 text-[10px] text-gray-500 md:pt-0 md:text-sm">
237+
<span class="flex-shrink-0 text-[10px] text-gray-500 md:text-sm">
237238
{packedItems()}/{totalItems()}
238239
</span>
239240
</div>
240241

242+
{/* Mobile: bag name on its own full-width row below the icons */}
243+
<div class="mt-0.5 text-sm leading-tight font-semibold break-words text-gray-900 md:hidden">
244+
{bagName()}
245+
</div>
246+
241247
{/* Category Summary - hidden on mobile */}
242248
<Show when={categorySummary().length > 0}>
243249
<div class="mt-1 hidden flex-wrap gap-x-3 gap-y-1 text-sm text-gray-600 md:flex">

0 commit comments

Comments
 (0)