mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-06-30 18:46:00 +00:00
add leftWidth/rightWidth centering to PlaceInspector
This commit is contained in:
@@ -120,12 +120,15 @@ interface PlaceInspectorProps {
|
|||||||
tripMembers?: TripMember[]
|
tripMembers?: TripMember[]
|
||||||
onSetParticipants: (assignmentId: number, dayId: number, participantIds: number[]) => void
|
onSetParticipants: (assignmentId: number, dayId: number, participantIds: number[]) => void
|
||||||
onUpdatePlace: (placeId: number, data: Partial<Place>) => void
|
onUpdatePlace: (placeId: number, data: Partial<Place>) => void
|
||||||
|
leftWidth?: number
|
||||||
|
rightWidth?: number
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function PlaceInspector({
|
export default function PlaceInspector({
|
||||||
place, categories, days, selectedDayId, selectedAssignmentId, assignments, reservations = [],
|
place, categories, days, selectedDayId, selectedAssignmentId, assignments, reservations = [],
|
||||||
onClose, onEdit, onDelete, onAssignToDay, onRemoveAssignment,
|
onClose, onEdit, onDelete, onAssignToDay, onRemoveAssignment,
|
||||||
files, onFileUpload, tripMembers = [], onSetParticipants, onUpdatePlace,
|
files, onFileUpload, tripMembers = [], onSetParticipants, onUpdatePlace,
|
||||||
|
leftWidth = 0, rightWidth = 0,
|
||||||
}: PlaceInspectorProps) {
|
}: PlaceInspectorProps) {
|
||||||
const { t, locale, language } = useTranslation()
|
const { t, locale, language } = useTranslation()
|
||||||
const timeFormat = useSettingsStore(s => s.settings.time_format) || '24h'
|
const timeFormat = useSettingsStore(s => s.settings.time_format) || '24h'
|
||||||
@@ -196,9 +199,9 @@ export default function PlaceInspector({
|
|||||||
style={{
|
style={{
|
||||||
position: 'absolute',
|
position: 'absolute',
|
||||||
bottom: 20,
|
bottom: 20,
|
||||||
left: '50%',
|
left: `calc(${leftWidth}px + (100% - ${leftWidth}px - ${rightWidth}px) / 2)`,
|
||||||
transform: 'translateX(-50%)',
|
transform: 'translateX(-50%)',
|
||||||
width: 'min(800px, calc(100vw - 32px))',
|
width: `min(800px, calc(100% - ${leftWidth}px - ${rightWidth}px - 32px))`,
|
||||||
zIndex: 50,
|
zIndex: 50,
|
||||||
fontFamily: "-apple-system, BlinkMacSystemFont, 'SF Pro Text', system-ui, sans-serif",
|
fontFamily: "-apple-system, BlinkMacSystemFont, 'SF Pro Text', system-ui, sans-serif",
|
||||||
}}
|
}}
|
||||||
|
|||||||
@@ -590,6 +590,8 @@ export default function TripPlannerPage(): React.ReactElement | null {
|
|||||||
} catch {}
|
} catch {}
|
||||||
}}
|
}}
|
||||||
onUpdatePlace={async (placeId, data) => { try { await tripStore.updatePlace(tripId, placeId, data) } catch (err: unknown) { toast.error(err instanceof Error ? err.message : 'Unknown error') } }}
|
onUpdatePlace={async (placeId, data) => { try { await tripStore.updatePlace(tripId, placeId, data) } catch (err: unknown) { toast.error(err instanceof Error ? err.message : 'Unknown error') } }}
|
||||||
|
leftWidth={leftCollapsed ? 0 : leftWidth}
|
||||||
|
rightWidth={rightCollapsed ? 0 : rightWidth}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user