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