your personal website on atproto - mirror blento.app

Merge pull request #41 from flo-bit/profile-stuff-2

fix stuff

authored by Florian and committed by GitHub 7295f600 be093765

+32 -35
+1 -1
src/lib/website/Account.svelte
··· 14 14 </script> 15 15 16 16 {#if user.isLoggedIn && user.profile} 17 - <div class="fixed bottom-4 right-4 z-20"> 17 + <div class="fixed right-4 bottom-4 z-20"> 18 18 <Popover sideOffset={8} bind:open={settingsPopoverOpen} class="bg-base-100 dark:bg-base-900"> 19 19 {#snippet child({ props })} 20 20 <button {...props}>
+9 -9
src/lib/website/EditableProfile.svelte
··· 62 62 : '@5xl/wrapper:max-w-4xl @5xl/wrapper:px-12' 63 63 ]} 64 64 > 65 - <div class={['absolute left-2 flex gap-2', profilePosition === 'side' ? 'top-12' : 'top-4']}> 66 - <!-- Position toggle button (desktop only) --> 67 - {#if !isMobile()} 68 - <Button size="sm" type="button" onclick={toggleProfilePosition} variant="ghost"> 69 - {profilePosition === 'side' ? 'Move to top' : 'Move to side'} 70 - </Button> 71 - {/if} 72 - 65 + <div class={['absolute left-2 z-20 flex gap-2', profilePosition === 'side' ? 'top-12' : 'top-4']}> 73 66 <Button 74 67 size="sm" 75 68 onclick={() => { ··· 81 74 > 82 75 hide profile 83 76 </Button> 77 + 78 + <!-- Position toggle button (desktop only) --> 79 + {#if !isMobile()} 80 + <Button size="sm" type="button" onclick={toggleProfilePosition} variant="ghost"> 81 + {profilePosition === 'side' ? 'Move to top' : 'Move to side'} 82 + </Button> 83 + {/if} 84 84 </div> 85 85 86 86 <div ··· 171 171 172 172 <div class={['h-10.5 w-1', profilePosition === 'side' && '@5xl/wrapper:hidden']}></div> 173 173 174 - <MadeWithBlento class="hidden @5xl/wrapper:block {profilePosition === 'side' && '@5xl/wrapper:block'}" /> 174 + <MadeWithBlento class="hidden {profilePosition === 'side' && '@5xl/wrapper:block'}" /> 175 175 </div> 176 176 </div>
+18 -18
src/lib/website/EditableWebsite.svelte
··· 497 497 target.value = ''; 498 498 } 499 499 500 - $inspect(items); 500 + // $inspect(items); 501 501 </script> 502 502 503 503 <svelte:body ··· 535 535 </div> 536 536 {/if} 537 537 538 - {#if getHideProfileSection(data)} 539 - <Button 540 - size="sm" 541 - variant="ghost" 542 - onclick={() => { 543 - data.publication.preferences ??= {}; 544 - data.publication.preferences.hideProfileSection = false; 545 - data = { ...data }; 546 - }} 547 - class="absolute top-14 left-4 z-20" 548 - > 549 - show profile 550 - </Button> 551 - {/if} 552 538 {#if showingMobileView} 553 539 <div 554 540 class="bg-base-200 dark:bg-base-950 pointer-events-none fixed inset-0 -z-10 h-full w-full" ··· 581 567 582 568 <div 583 569 class={[ 584 - 'mx-auto max-w-lg', 570 + 'pointer-events-none relative mx-auto max-w-lg', 585 571 !getHideProfileSection(data) && getProfilePosition(data) === 'side' 586 572 ? '@5xl/wrapper:grid @5xl/wrapper:max-w-7xl @5xl/wrapper:grid-cols-4' 587 573 : '@5xl/wrapper:max-w-4xl' 588 574 ]} 589 575 > 590 - <div></div> 576 + {#if getHideProfileSection(data)} 577 + <Button 578 + size="sm" 579 + variant="ghost" 580 + onclick={() => { 581 + data.publication.preferences ??= {}; 582 + data.publication.preferences.hideProfileSection = false; 583 + data = { ...data }; 584 + }} 585 + class="pointer-events-auto absolute top-2 left-4 z-20" 586 + > 587 + show profile 588 + </Button> 589 + {/if} 590 + <div class="pointer-events-none"></div> 591 591 <!-- svelte-ignore a11y_no_static_element_interactions --> 592 592 <div 593 593 bind:this={container} ··· 689 689 return true; 690 690 }} 691 691 class={[ 692 - '@container/grid relative col-span-3 rounded-4xl px-2 py-8 @5xl/wrapper:px-8', 692 + '@container/grid pointer-events-auto relative col-span-3 rounded-4xl px-2 py-8 @5xl/wrapper:px-8', 693 693 imageDragOver && 'outline-accent-500 outline-3 -outline-offset-10 outline-dashed' 694 694 ]} 695 695 >
+4 -5
src/lib/website/load.ts
··· 51 51 page: string = 'self' 52 52 ): Promise<WebsiteData> { 53 53 if (!handle) throw error(404); 54 + if (handle === 'favicon.ico') throw error(404); 54 55 55 56 if (!forceUpdate) { 56 57 const cachedResult = await getCache(handle, page, cache); ··· 58 59 if (cachedResult) return cachedResult; 59 60 } 60 61 61 - if (handle === 'favicon.ico') throw error(404); 62 - 63 - console.log('resolving', handle); 64 62 const did = await resolveHandle({ handle }); 65 63 66 64 const cards = await listRecords({ did, collection: 'app.blento.card' }).catch(() => { ··· 74 72 rkey: 'blento.self' 75 73 }).catch(() => { 76 74 console.error('error getting record for collection site.standard.publication'); 77 - return [] as Awaited<ReturnType<typeof listRecords>>; 75 + return undefined; 78 76 }); 79 77 80 78 const pages = await listRecords({ did, collection: 'app.blento.page' }).catch(() => { ··· 124 122 cards: (cards.map((v) => { 125 123 return { ...v.value }; 126 124 }) ?? []) as Item[], 127 - publications: [mainPublication, ...pages], 125 + publications: [mainPublication, ...pages].filter((v) => v), 128 126 additionalData, 129 127 profile, 130 128 updatedAt: Date.now(), ··· 135 133 await cache?.put?.(handle, stringifiedResult); 136 134 137 135 const parsedResult = JSON.parse(stringifiedResult); 136 + 138 137 parsedResult.publication = ( 139 138 parsedResult.publications as Awaited<ReturnType<typeof listRecords>> 140 139 ).find((v) => parseUri(v.uri).rkey === parsedResult.page)?.value;
-2
src/routes/[handle=handle]/[[page]]/+layout.server.ts
··· 9 9 10 10 const cache = platform?.env?.USER_DATA_CACHE as unknown; 11 11 12 - console.log(params.page); 13 - 14 12 return await loadData(params.handle as Handle, cache as UserCache, false, params.page); 15 13 }