File tree Expand file tree Collapse file tree 6 files changed +12
-10
lines changed Expand file tree Collapse file tree 6 files changed +12
-10
lines changed Original file line number Diff line number Diff line change 1616 {#if isPreviewing }
1717 <a
1818 class =" relative flex transition-all duration-300 p-2 gap-1 group hover:bg-red-100 hover:text-red-500"
19- href ={resolve (` /preview/disable ` , {
19+ href ={resolve (' /preview/disable' , {
2020 redirect: page .url .pathname
2121 })}
2222 >
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ export default defineConfig({
1818 presentationTool ( {
1919 previewUrl : {
2020 origin,
21+ initial : '/' ,
2122 previewMode : {
2223 enable : '/preview/enable' ,
2324 disable : '/preview/disable'
Original file line number Diff line number Diff line change 33 import type { PageProps } from ' ./$types' ;
44
55 const { data }: PageProps = $props ();
6- const { data : buildings } = $derived (data );
6+ const buildings = $derived (data . data );
77 </script >
88
99<BuildingsPage {buildings } />
Original file line number Diff line number Diff line change 11<script lang =" ts" >
2- import { getIsPreviewing , QueryLoader } from ' @sanity/sveltekit' ;
2+ import { QueryLoader } from ' @sanity/sveltekit' ;
33 import { client } from ' $lib/sanity/client' ;
44 import Features from ' $lib/components/Features.svelte' ;
5+ import type { LayoutProps } from ' ./$types' ;
56
6- const { children } = $props ();
7- const isPreviewing = getIsPreviewing ( );
7+ const { children, data } : LayoutProps = $props ();
8+ const { previewEnabled } = $derived ( data );
89 </script >
910
10- <QueryLoader enabled ={isPreviewing } {client }>
11+ <QueryLoader enabled ={previewEnabled } {client }>
1112 {@render children ()}
1213 <Features />
1314</QueryLoader >
Original file line number Diff line number Diff line change 44 import type { PageProps } from ' ./$types' ;
55
66 const { data }: PageProps = $props ();
7- const value = $derived ( useQuery (data ) );
8- const { data : buildings } = $derived ($value );
7+ const query = useQuery (data );
8+ const buildings = $derived ($query . data );
99 </script >
1010
1111{#if buildings }
Original file line number Diff line number Diff line change 44 import type { PageProps } from ' ./$types' ;
55
66 const { data }: PageProps = $props ();
7- const value = $derived ( useQuery (data ) );
8- const { data : building } = $derived ($value );
7+ const query = useQuery (data );
8+ const building = $derived ($query . data );
99 </script >
1010
1111{#if building }
You can’t perform that action at this time.
0 commit comments