mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-21 11:36:05 +00:00
fix(mobile): show a place's full name in its details sheet
The details sheet cut the place name to one line, and nothing in the sheet showed the rest; only the edit form did. The sheet is where a place is read in full, so the name now wraps onto as many lines as it needs, as the desktop inspector already does. The address under it wrapped before and still does. Closes #3140
This commit is contained in:
@@ -122,3 +122,15 @@ describe('MPlaceSheet ask the assistant', () => {
|
||||
expect(chatOf(useAssistantStore.getState(), 5).focus).toEqual({ placeIds: [42] })
|
||||
})
|
||||
})
|
||||
|
||||
describe('MPlaceSheet header (#3140)', () => {
|
||||
it('lets a long place name wrap instead of cutting it to one line', () => {
|
||||
const longName = 'Broad Street Christmas Lights & Market'
|
||||
render(<MPlaceSheet planner={planner({ selectedPlace: buildPlace({ id: 7, name: longName, address: 'Broad Street, RG1 2AF, Reading' }) })} shell={shell} />)
|
||||
|
||||
const title = screen.getByText(longName)
|
||||
expect(title).not.toHaveClass('truncate')
|
||||
expect(title).toHaveClass('break-words')
|
||||
expect(screen.getByText('Broad Street, RG1 2AF, Reading').closest('div')).not.toHaveClass('truncate')
|
||||
})
|
||||
})
|
||||
|
||||
@@ -208,12 +208,14 @@ export default function MPlaceSheet({ planner, shell }: MTripSheetsProps) {
|
||||
</PlacePhotoGallery>
|
||||
</div>
|
||||
<div className="min-w-0 flex-1">
|
||||
<div className="flex items-center gap-1.5">
|
||||
<span dir="auto" className="min-w-0 truncate text-[1rem] font-bold leading-snug">{place.name}</span>
|
||||
<div className="flex items-start gap-1.5">
|
||||
{/* The sheet is where a place is read in full, so its name wraps
|
||||
onto as many lines as it needs, as on the desktop (#3140). */}
|
||||
<span dir="auto" className="min-w-0 break-words text-[1rem] font-bold leading-snug [overflow-wrap:anywhere]">{place.name}</span>
|
||||
{/* Accepted out of the traveller's own recordings — the same
|
||||
mark the desktop inspector carries. */}
|
||||
{place.source === 'dawarich' && (
|
||||
<span className="flex-none overflow-hidden rounded-[5px]">
|
||||
<span className="mt-[3px] flex-none overflow-hidden rounded-[5px]">
|
||||
<DawarichIcon size={15} />
|
||||
</span>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user