ssr on
This commit is contained in:
parent
a227055c1e
commit
8853515f07
6 changed files with 30 additions and 14 deletions
|
|
@ -1,7 +1,14 @@
|
|||
<script lang="ts">
|
||||
import { DropdownMenu as DropdownMenuPrimitive } from "bits-ui";
|
||||
|
||||
let { ref = $bindable(null), ...restProps }: DropdownMenuPrimitive.GroupProps = $props();
|
||||
let {
|
||||
ref = $bindable(null),
|
||||
...restProps
|
||||
}: DropdownMenuPrimitive.GroupProps = $props();
|
||||
</script>
|
||||
|
||||
<DropdownMenuPrimitive.Group bind:ref data-slot="dropdown-menu-group" {...restProps} />
|
||||
<DropdownMenuPrimitive.Group
|
||||
bind:ref
|
||||
data-slot="dropdown-menu-group"
|
||||
{...restProps}
|
||||
/>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,14 @@
|
|||
<script lang="ts">
|
||||
import { DropdownMenu as DropdownMenuPrimitive } from "bits-ui";
|
||||
|
||||
let { ref = $bindable(null), ...restProps }: DropdownMenuPrimitive.TriggerProps = $props();
|
||||
let {
|
||||
ref = $bindable(null),
|
||||
...restProps
|
||||
}: DropdownMenuPrimitive.TriggerProps = $props();
|
||||
</script>
|
||||
|
||||
<DropdownMenuPrimitive.Trigger bind:ref data-slot="dropdown-menu-trigger" {...restProps} />
|
||||
<DropdownMenuPrimitive.Trigger
|
||||
bind:ref
|
||||
data-slot="dropdown-menu-trigger"
|
||||
{...restProps}
|
||||
/>
|
||||
|
|
|
|||
|
|
@ -6,12 +6,12 @@
|
|||
ref = $bindable(null),
|
||||
class: className,
|
||||
...restProps
|
||||
}: WithoutChildren<WithElementRef<HTMLAttributes<HTMLDivElement>>> = $props();
|
||||
}: WithoutChildren<WithElementRef<HTMLAttributes<HTMLSpanElement>>> = $props();
|
||||
</script>
|
||||
|
||||
<div
|
||||
<span
|
||||
bind:this={ref}
|
||||
data-slot="skeleton"
|
||||
class={cn("bg-accent animate-pulse rounded-md", className)}
|
||||
{...restProps}
|
||||
></div>
|
||||
></span>
|
||||
|
|
|
|||
|
|
@ -2,11 +2,14 @@ import type { LayoutServerLoad } from './$types';
|
|||
import { dev } from '$app/environment';
|
||||
|
||||
export const load: LayoutServerLoad = async (event) => {
|
||||
event.setHeaders({
|
||||
'Cache-Control': dev
|
||||
? 'no-cache'
|
||||
: 'private, max-age=30'
|
||||
});
|
||||
// Only set Cache-Control if not already set
|
||||
if (!event.request.headers.get('cache-control')) {
|
||||
event.setHeaders({
|
||||
'Cache-Control': dev
|
||||
? 'no-cache'
|
||||
: 'private, max-age=30'
|
||||
});
|
||||
}
|
||||
|
||||
// Use the user data already fetched and processed in hooks
|
||||
return {
|
||||
|
|
|
|||
|
|
@ -1 +0,0 @@
|
|||
export const ssr = false;
|
||||
|
|
@ -16,5 +16,5 @@ export async function GET(event) {
|
|||
route: { id: "/api/hopium/questions/[id]" }
|
||||
};
|
||||
|
||||
return await getHopiumQuestion(hopiumEvent);
|
||||
return await getHopiumQuestion(hopiumEvent as any);
|
||||
}
|
||||
|
|
|
|||
Reference in a new issue