6 changed files with 50 additions and 66 deletions
@ -1,50 +0,0 @@ |
|||||
import type React from 'react'; |
|
||||
|
|
||||
import { AnimatePresence, AnimateSharedLayout, m } from 'framer-motion'; |
|
||||
import { FiArrowDown } from 'react-icons/fi'; |
|
||||
|
|
||||
import { IconButton } from '@meshtastic/components'; |
|
||||
|
|
||||
export interface SidebarPrimaryProps { |
|
||||
title: string; |
|
||||
open: boolean; |
|
||||
close: () => void; |
|
||||
children: React.ReactNode; |
|
||||
} |
|
||||
|
|
||||
export const SidebarPrimary = ({ |
|
||||
title, |
|
||||
open, |
|
||||
close, |
|
||||
children, |
|
||||
}: SidebarPrimaryProps): JSX.Element => { |
|
||||
return ( |
|
||||
<AnimatePresence> |
|
||||
{open && ( |
|
||||
<m.div |
|
||||
className="absolute flex h-full w-full flex-col bg-gray-100 dark:bg-primaryDark" |
|
||||
animate={{ translateY: 0 }} |
|
||||
initial={{ translateY: '100%' }} |
|
||||
exit={{ translateY: '100%' }} |
|
||||
transition={{ type: 'just' }} |
|
||||
> |
|
||||
<AnimateSharedLayout> |
|
||||
<div className="flex gap-2 p-2"> |
|
||||
<IconButton |
|
||||
onClick={(): void => { |
|
||||
close(); |
|
||||
}} |
|
||||
icon={<FiArrowDown />} |
|
||||
/> |
|
||||
<div className="my-auto text-lg font-medium dark:text-white"> |
|
||||
{title} |
|
||||
</div> |
|
||||
</div> |
|
||||
|
|
||||
<div className="flex-grow overflow-y-auto">{children}</div> |
|
||||
</AnimateSharedLayout> |
|
||||
</m.div> |
|
||||
)} |
|
||||
</AnimatePresence> |
|
||||
); |
|
||||
}; |
|
||||
@ -1,28 +1,48 @@ |
|||||
|
import type { Style } from 'mapbox-gl'; |
||||
|
|
||||
export interface MapStyle { |
export interface MapStyle { |
||||
title: string; |
title: string; |
||||
url: string; |
data: Style | string; |
||||
} |
} |
||||
|
|
||||
export const MapStyles = { |
export const MapStyles = { |
||||
Streets: { |
Streets: { |
||||
title: 'Streets', |
title: 'Streets', |
||||
url: 'mapbox://styles/mapbox/streets-v11?optimize=true', |
data: 'mapbox://styles/mapbox/streets-v11?optimize=true', |
||||
} as MapStyle, |
} as MapStyle, |
||||
Outdoors: { |
Outdoors: { |
||||
title: 'Outdoors', |
title: 'Outdoors', |
||||
url: 'mapbox://styles/mapbox/outdoors-v11?optimize=true', |
data: 'mapbox://styles/mapbox/outdoors-v11?optimize=true', |
||||
} as MapStyle, |
} as MapStyle, |
||||
|
|
||||
Light: { |
Light: { |
||||
title: 'Light', |
title: 'Light', |
||||
url: 'mapbox://styles/mapbox/light-v10?optimize=true', |
data: 'mapbox://styles/mapbox/light-v10?optimize=true', |
||||
} as MapStyle, |
} as MapStyle, |
||||
Dark: { |
Dark: { |
||||
title: 'Dark', |
title: 'Dark', |
||||
url: 'mapbox://styles/sachaw/ckwzwm92e1oep14pjunjqlqbo?optimize=true', |
data: 'mapbox://styles/sachaw/ckwzwm92e1oep14pjunjqlqbo?optimize=true', |
||||
} as MapStyle, |
} as MapStyle, |
||||
Satellite: { |
Satellite: { |
||||
title: 'Satellite', |
title: 'Satellite', |
||||
url: 'mapbox://styles/mapbox/satellite-v9?optimize=true', |
|
||||
|
data: { |
||||
|
version: 8, |
||||
|
layers: [ |
||||
|
{ |
||||
|
id: 'esri', |
||||
|
type: 'raster', |
||||
|
source: 'esri', |
||||
|
}, |
||||
|
], |
||||
|
sources: { |
||||
|
esri: { |
||||
|
type: 'raster', |
||||
|
tiles: [ |
||||
|
'https://clarity.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}', |
||||
|
], |
||||
|
}, |
||||
|
}, |
||||
|
}, |
||||
} as MapStyle, |
} as MapStyle, |
||||
}; |
}; |
||||
|
|||||
Loading…
Reference in new issue