mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-10-23 07:26:30 +00:00
8fd46c4c18
Small requests from the discussions, each built end to end: planner and map (cycling mode, date first headings, clear a day, stay times per day, off-route stops, map lock, compact unplanned markers, pending stays, cable car, transit quick picks), places (location filter, category from OSM, open in maps, geo: link, image from an attachment, enrichment on file import, places near a pin, place name language, Amap first in China), lists and costs (packed counter, inherited sharing, Markdown to-dos, payment notes, bookings CSV, my plan PDF), sharing (unplanned places, travel only, without photos), journey (photo zoom, drafts, photo order, trip suggestion, day jump), atlas (region counter, region bucket list, places per country), vacay half company holidays, studio copy and paste plus the book's own layouts, and RESTORE_FROM_BACKUP for a first start restore.
22 lines
760 B
TypeScript
22 lines
760 B
TypeScript
import { Lock, Unlock } from 'lucide-react'
|
|
import { useTranslation } from '../../i18n'
|
|
import { MapTogglePill } from './MapTogglePill'
|
|
|
|
/**
|
|
* Locks the map view (#2010): picking days and places then leaves the camera where it is.
|
|
* Sits on top of the base-layer switcher, the other control about the view itself.
|
|
*/
|
|
export function MapLockPill({ locked, onToggle }: { locked: boolean; onToggle: () => void }) {
|
|
const { t } = useTranslation()
|
|
return (
|
|
<MapTogglePill
|
|
active={locked}
|
|
onToggle={onToggle}
|
|
label={locked ? t('map.lock.unlock') : t('map.lock.lock')}
|
|
testId="map-lock-pill"
|
|
tooltipPlacement="right"
|
|
icon={locked ? <Lock size={16} strokeWidth={2} /> : <Unlock size={16} strokeWidth={2} />}
|
|
/>
|
|
)
|
|
}
|