your personal website on atproto - mirror blento.app

small fixes

Florian 35838ae2 8db78035

+36 -30
+1 -1
src/lib/cards/BaseCard/BaseEditingCard.svelte
··· 56 56 57 57 const cardDef = $derived(CardDefinitionsByType[item.cardType]); 58 58 59 - const minW = $derived(cardDef.minW ?? (isMobile() ? 4 : 2)); 59 + const minW = $derived(cardDef.minW ?? (isMobile() ? 2 : 2)); 60 60 const minH = $derived(cardDef.minH ?? (isMobile() ? 2 : 2)); 61 61 62 62 const maxW = $derived(cardDef.maxW ?? COLUMNS);
+32 -28
src/lib/cards/MapCard/CreateMapCardModal.svelte
··· 28 28 item.cardData.lon = data.lon; 29 29 item.cardData.name = data.display_name?.split(',')[0] || search; 30 30 item.cardData.type = data.class || 'city'; 31 - item.cardData.zoom = getZoomLevel(data.class); 31 + item.cardData.zoom = Math.max(getZoomLevel(data.class), getZoomLevel(data.type)); 32 32 } else { 33 33 throw new Error('response not ok'); 34 34 } ··· 43 43 </script> 44 44 45 45 <Modal open={true} closeButton={false}> 46 - <Subheading>Enter a city and country</Subheading> 47 - <Input bind:value={search} /> 46 + <form 47 + onsubmit={async () => { 48 + if (await fetchLocation()) oncreate(); 49 + }} 50 + class="flex flex-col gap-2" 51 + > 52 + <Subheading>Enter a address or city</Subheading> 53 + <Input bind:value={search} class="mt-4" /> 48 54 49 - {#if errorMessage} 50 - <Alert type="error" title="Failed to create map card"><span>{errorMessage}</span></Alert> 51 - {/if} 55 + {#if errorMessage} 56 + <Alert type="error" title="Failed to create map card"><span>{errorMessage}</span></Alert> 57 + {/if} 52 58 53 - <p class="text-xs"> 54 - Geocoding by <a 55 - href="https://nominatim.openstreetmap.org/" 56 - class="text-accent-800 dark:text-accent-300" 57 - target="_blank">Nominatim</a 58 - > 59 - / © 60 - <a 61 - href="https://www.openstreetmap.org/copyright" 62 - class="text-accent-800 dark:text-accent-300" 63 - target="_blank">OpenStreetMap contributors</a 64 - > 65 - </p> 59 + <p class="text-xs mt-2"> 60 + Geocoding by <a 61 + href="https://nominatim.openstreetmap.org/" 62 + class="text-accent-800 dark:text-accent-300" 63 + target="_blank">Nominatim</a 64 + > 65 + / © 66 + <a 67 + href="https://www.openstreetmap.org/copyright" 68 + class="text-accent-800 dark:text-accent-300" 69 + target="_blank">OpenStreetMap contributors</a 70 + > 71 + </p> 66 72 67 - <div class="mt-4 flex justify-end gap-2"> 68 - <Button onclick={oncancel} variant="ghost">Cancel</Button> 69 - <Button 70 - disabled={isFetchingLocation} 71 - onclick={async () => { 72 - if (await fetchLocation()) oncreate(); 73 - }}>{isFetchingLocation ? 'Creating...' : 'Create'}</Button 74 - > 75 - </div> 73 + <div class="mt-4 flex justify-end gap-2"> 74 + <Button onclick={oncancel} variant="ghost">Cancel</Button> 75 + <Button type="submit" disabled={isFetchingLocation} 76 + >{isFetchingLocation ? 'Creating...' : 'Create'}</Button 77 + > 78 + </div> 79 + </form> 76 80 </Modal>
+3 -1
src/lib/cards/MapCard/Map.svelte
··· 22 22 }); 23 23 24 24 onMount(() => { 25 - if (!mapContainer || !env.PUBLIC_MAPBOX_TOKEN) return; 25 + if (!mapContainer || !env.PUBLIC_MAPBOX_TOKEN) { 26 + console.log('no map container or no mapbox token'); 27 + } 26 28 27 29 try { 28 30 mapboxgl.accessToken = env.PUBLIC_MAPBOX_TOKEN;