+
No reviews yet.
+ {#if canEdit()}
+
+ {/if}
{:else}
- import { getAdditionalUserData, getDidContext, getHandleContext } from '$lib/website/context';
+ import {
+ getAdditionalUserData,
+ getCanEdit,
+ getDidContext,
+ getHandleContext
+ } from '$lib/website/context';
import { onMount } from 'svelte';
import { CardDefinitionsByType } from '..';
import type { ContentComponentProps } from '../types';
import BlogEntry from './BlogEntry.svelte';
+ import { Button } from '@foxui/core';
let { item }: ContentComponentProps = $props();
@@ -14,6 +20,8 @@
let did = getDidContext();
let handle = getHandleContext();
+ let canEdit = getCanEdit();
+
onMount(async () => {
if (!feed) {
feed = (await CardDefinitionsByType[item.cardType]?.loadData?.([item], {
@@ -37,22 +45,23 @@
/>
{/each}
{:else if feed}
-
-
No blog posts found.
-
- Create some on Leaflet
- or
- Pckt
-
+
+ No blog posts found.
+
+ {#if canEdit()}
+
+ Create some for example on
+ or
+
+
+ {/if}
{:else}
{
- item.h = 3;
- item.mobileH = 5;
- },
+ createNew: (item) => {},
loadData: async (items, { did }) => {
const data = await listRecords({ did, collection: 'xyz.statusphere.status', limit: 1 });
diff --git a/src/lib/components/card-command/CardCommand.svelte b/src/lib/components/card-command/CardCommand.svelte
index 71d94a7..ec2b24d 100644
--- a/src/lib/components/card-command/CardCommand.svelte
+++ b/src/lib/components/card-command/CardCommand.svelte
@@ -75,7 +75,7 @@
function handleKeydown(e: KeyboardEvent) {
if (e.key === 'k' && (e.metaKey || e.ctrlKey)) {
e.preventDefault();
- open = true;
+ open = !open;
}
if (e.key === '+' && !isTyping()) {
e.preventDefault();
diff --git a/src/lib/website/Account.svelte b/src/lib/website/Account.svelte
index c48150c..d263cdd 100644
--- a/src/lib/website/Account.svelte
+++ b/src/lib/website/Account.svelte
@@ -1,5 +1,7 @@
{#if user.isLoggedIn && user.profile}
-
+
{#snippet child({ props })}
{/snippet}
-
+
+ {#if user.profile}
+
+ {/if}
+
+
+
{/if}
diff --git a/src/lib/website/Context.svelte b/src/lib/website/Context.svelte
index e0d6106..8cadf44 100644
--- a/src/lib/website/Context.svelte
+++ b/src/lib/website/Context.svelte
@@ -8,16 +8,18 @@
let {
data,
- children
+ children,
+ isEditing
}: {
data: WebsiteData;
children: Snippet<[]>;
+ isEditing?: boolean;
} = $props();
// svelte-ignore state_referenced_locally
setAdditionalUserData(data.additionalData);
- setCanEdit(() => dev || (user.isLoggedIn && user.profile?.did === data.did));
+ setCanEdit(() => dev || (user.isLoggedIn && user.profile?.did === data.did && isEditing === true));
// svelte-ignore state_referenced_locally
setDidContext(data.did as Did);
diff --git a/src/lib/website/EditableWebsite.svelte b/src/lib/website/EditableWebsite.svelte
index 023a862..4c2ac3e 100644
--- a/src/lib/website/EditableWebsite.svelte
+++ b/src/lib/website/EditableWebsite.svelte
@@ -1,5 +1,5 @@