From cc6ba2612d3b8b89dcefe6a6d83986c3216bde0b Mon Sep 17 00:00:00 2001 From: padreug Date: Thu, 3 Jul 2025 08:34:26 +0200 Subject: [PATCH] feat: Update app configuration and enhance identity management - Change app manifest details to reflect new branding for "Ario - Nostr Community Hub". - Add new properties to the manifest, including categories and language support. - Refactor identity handling in IdentityDialog and PasswordDialog components for improved profile initialization. - Update event creation functions in events.ts to use the correct event type from nostr-tools. --- src/components/nostr/IdentityDialog.vue | 21 ++++++++++++--- src/components/nostr/PasswordDialog.vue | 2 +- src/lib/nostr/events.ts | 12 ++++----- vite.config.ts | 34 ++++++++++++++++--------- 4 files changed, 46 insertions(+), 23 deletions(-) diff --git a/src/components/nostr/IdentityDialog.vue b/src/components/nostr/IdentityDialog.vue index db8562b..93e3d01 100644 --- a/src/components/nostr/IdentityDialog.vue +++ b/src/components/nostr/IdentityDialog.vue @@ -7,7 +7,6 @@ import { Input } from '@/components/ui/input' import { Label } from '@/components/ui/label' import { Textarea } from '@/components/ui/textarea' import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card' -import { Badge } from '@/components/ui/badge' import { Key, Download, Upload, Copy, Check } from 'lucide-vue-next' import { identity } from '@/composables/useIdentity' import { toast } from 'vue-sonner' @@ -20,7 +19,7 @@ interface Emits { (e: 'update:isOpen', value: boolean): void } -const props = defineProps() +defineProps() const emit = defineEmits() @@ -64,7 +63,14 @@ async function handleGenerate() { // Initialize profile form with current data const profile = identity.currentProfile.value if (profile) { - profileForm.value = { ...profile } + profileForm.value = { + name: profile.name || '', + display_name: profile.display_name || '', + about: profile.about || '', + picture: profile.picture || '', + website: profile.website || '', + lud16: profile.lud16 || '' + } } toast.success('Identity generated successfully!') @@ -82,7 +88,14 @@ async function handleImport() { // Initialize profile form with current data const profile = identity.currentProfile.value if (profile) { - profileForm.value = { ...profile } + profileForm.value = { + name: profile.name || '', + display_name: profile.display_name || '', + about: profile.about || '', + picture: profile.picture || '', + website: profile.website || '', + lud16: profile.lud16 || '' + } } toast.success('Identity imported successfully!') diff --git a/src/components/nostr/PasswordDialog.vue b/src/components/nostr/PasswordDialog.vue index ff0f25e..db4fd1a 100644 --- a/src/components/nostr/PasswordDialog.vue +++ b/src/components/nostr/PasswordDialog.vue @@ -18,7 +18,7 @@ interface Emits { (e: 'cancel'): void } -const props = withDefaults(defineProps(), { +withDefaults(defineProps(), { title: 'Enter Password', description: 'Your identity is encrypted. Please enter your password to continue.' }) diff --git a/src/lib/nostr/events.ts b/src/lib/nostr/events.ts index 4b25904..9db8fef 100644 --- a/src/lib/nostr/events.ts +++ b/src/lib/nostr/events.ts @@ -1,4 +1,4 @@ -import { finalizeEvent, type EventTemplate, type UnsignedEvent } from 'nostr-tools' +import { finalizeEvent, type EventTemplate, type Event } from 'nostr-tools' import type { NostrIdentity } from './identity' import { hexToBytes } from '@/lib/utils/crypto' @@ -18,7 +18,7 @@ export const EventKinds = { /** * Create a text note event */ -export function createTextNote(content: string, identity: NostrIdentity, replyTo?: string): UnsignedEvent { +export function createTextNote(content: string, identity: NostrIdentity, replyTo?: string): Event { const eventTemplate: EventTemplate = { kind: EventKinds.TEXT_NOTE, created_at: Math.floor(Date.now() / 1000), @@ -42,7 +42,7 @@ export function createReaction( targetAuthor: string, reaction: string, identity: NostrIdentity -): UnsignedEvent { +): Event { const eventTemplate: EventTemplate = { kind: EventKinds.REACTION, created_at: Math.floor(Date.now() / 1000), @@ -59,7 +59,7 @@ export function createReaction( /** * Create a profile metadata event */ -export function createProfileMetadata(profile: Record, identity: NostrIdentity): UnsignedEvent { +export function createProfileMetadata(profile: Record, identity: NostrIdentity): Event { const eventTemplate: EventTemplate = { kind: EventKinds.PROFILE_METADATA, created_at: Math.floor(Date.now() / 1000), @@ -73,7 +73,7 @@ export function createProfileMetadata(profile: Record, identity: No /** * Create a contact list event (following) */ -export function createContactList(contacts: string[], identity: NostrIdentity): UnsignedEvent { +export function createContactList(contacts: string[], identity: NostrIdentity): Event { const eventTemplate: EventTemplate = { kind: EventKinds.CONTACT_LIST, created_at: Math.floor(Date.now() / 1000), @@ -87,7 +87,7 @@ export function createContactList(contacts: string[], identity: NostrIdentity): /** * Create a delete event */ -export function createDeleteEvent(eventIds: string[], identity: NostrIdentity, reason?: string): UnsignedEvent { +export function createDeleteEvent(eventIds: string[], identity: NostrIdentity, reason?: string): Event { const eventTemplate: EventTemplate = { kind: EventKinds.DELETE, created_at: Math.floor(Date.now() / 1000), diff --git a/vite.config.ts b/vite.config.ts index 4834ab1..77ef7fa 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -27,13 +27,13 @@ export default defineConfig(({ mode }) => ({ }, includeAssets: ['favicon.ico', 'apple-touch-icon.png', 'mask-icon.svg'], manifest: { - name: 'Vue Shadcn App', - short_name: 'Vue App', - description: 'A Vue 3 app with Shadcn UI', - theme_color: '#ffffff', + name: 'Ario - Nostr Community Hub', + short_name: 'Ario', + description: 'Nostr-based community platform with Lightning Network integration for events and announcements', + theme_color: '#1f2937', background_color: '#ffffff', display: 'standalone', - orientation: 'portrait', + orientation: 'portrait-primary', start_url: '/', scope: '/', id: 'ario-nostr-hub', @@ -43,18 +43,28 @@ export default defineConfig(({ mode }) => ({ { src: 'pwa-192x192.png', sizes: '192x192', - type: 'image/png' - }, - { - src: 'pwa-512x512.png', - sizes: '512x512', - type: 'image/png' + type: 'image/png', + purpose: 'any' }, { src: 'pwa-512x512.png', sizes: '512x512', type: 'image/png', - purpose: 'any maskable' + purpose: 'any' + }, + { + src: 'pwa-512x512.png', + sizes: '512x512', + type: 'image/png', + purpose: 'maskable' + } + ], + screenshots: [ + { + src: 'splash.png', + sizes: '1080x1920', + type: 'image/png', + form_factor: 'narrow' } ] }