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