diff --git a/src/lib/cards/FriendsCard/FriendsCard.svelte b/src/lib/cards/FriendsCard/FriendsCard.svelte index c4ac918..296e471 100644 --- a/src/lib/cards/FriendsCard/FriendsCard.svelte +++ b/src/lib/cards/FriendsCard/FriendsCard.svelte @@ -61,6 +61,10 @@ return 'lg'; }); + function removeFriend(did: string) { + item.cardData.friends = item.cardData.friends.filter((d: string) => d !== did); + } + function getLink(profile: FriendsProfile): string { if (profile.hasBlento && profile.handle && profile.handle !== 'handle.invalid') { return `/${profile.handle}`; @@ -85,17 +89,40 @@
{#each profiles as profile (profile.did)} - - - +
+ + + + {#if canEdit()} + + {/if} +
{/each}
diff --git a/src/lib/cards/FriendsCard/FriendsCardSettings.svelte b/src/lib/cards/FriendsCard/FriendsCardSettings.svelte index 389a857..2a531bf 100644 --- a/src/lib/cards/FriendsCard/FriendsCardSettings.svelte +++ b/src/lib/cards/FriendsCard/FriendsCardSettings.svelte @@ -1,94 +1,23 @@ -
- - - {#if dids.length > 0} -
- {#each dids as did (did)} - {@const profile = getProfile(did)} -
- - - {profile?.handle ?? did} - - -
- {/each} -
- {/if} -
+ diff --git a/src/lib/cards/FriendsCard/index.ts b/src/lib/cards/FriendsCard/index.ts index 5ad6fb7..d6c5302 100644 --- a/src/lib/cards/FriendsCard/index.ts +++ b/src/lib/cards/FriendsCard/index.ts @@ -36,7 +36,8 @@ export const FriendsCardDefinition = { minW: 2, minH: 2, name: 'Friends', - // groups: ['Social'], + groups: ['Social'], keywords: ['friends', 'avatars', 'people', 'community', 'blentos'], - icon: `` + icon: ``, + canHaveLabel: true } as CardDefinition & { type: 'friends' }; diff --git a/src/lib/cards/GameCards/DinoGameCard/index.ts b/src/lib/cards/GameCards/DinoGameCard/index.ts index 2546769..6c61109 100644 --- a/src/lib/cards/GameCards/DinoGameCard/index.ts +++ b/src/lib/cards/GameCards/DinoGameCard/index.ts @@ -8,9 +8,9 @@ export const DinoGameCardDefinition = { allowSetColor: true, createNew: (card) => { card.w = 4; - card.h = 4; + card.h = 2; card.mobileW = 8; - card.mobileH = 6; + card.mobileH = 4; card.cardData = {}; }, canHaveLabel: true, diff --git a/src/lib/cards/GameCards/TetrisCard/index.ts b/src/lib/cards/GameCards/TetrisCard/index.ts index 5b75cbd..fdab5a1 100644 --- a/src/lib/cards/GameCards/TetrisCard/index.ts +++ b/src/lib/cards/GameCards/TetrisCard/index.ts @@ -9,10 +9,9 @@ export const TetrisCardDefinition = { type: 'tetris', contentComponent: TetrisCard as unknown as Component, allowSetColor: true, - defaultColor: 'accent', createNew: (card) => { - card.w = 4; - card.h = 6; + card.w = 2; + card.h = 4; card.mobileW = 8; card.mobileH = 12; card.cardData = {}; diff --git a/src/lib/cards/PopfeedReviews/PopfeedReviewsCard.svelte b/src/lib/cards/PopfeedReviews/PopfeedReviewsCard.svelte index 32924b0..c2cae3e 100644 --- a/src/lib/cards/PopfeedReviews/PopfeedReviewsCard.svelte +++ b/src/lib/cards/PopfeedReviews/PopfeedReviewsCard.svelte @@ -1,9 +1,15 @@
@@ -36,11 +44,11 @@
@@ -58,10 +66,13 @@ {/if} {/each} {:else if feed} -
+
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 @@