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.
This commit is contained in:
parent
c05f40f1ec
commit
cc6ba2612d
4 changed files with 46 additions and 23 deletions
|
|
@ -7,7 +7,6 @@ import { Input } from '@/components/ui/input'
|
||||||
import { Label } from '@/components/ui/label'
|
import { Label } from '@/components/ui/label'
|
||||||
import { Textarea } from '@/components/ui/textarea'
|
import { Textarea } from '@/components/ui/textarea'
|
||||||
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card'
|
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 { Key, Download, Upload, Copy, Check } from 'lucide-vue-next'
|
||||||
import { identity } from '@/composables/useIdentity'
|
import { identity } from '@/composables/useIdentity'
|
||||||
import { toast } from 'vue-sonner'
|
import { toast } from 'vue-sonner'
|
||||||
|
|
@ -20,7 +19,7 @@ interface Emits {
|
||||||
(e: 'update:isOpen', value: boolean): void
|
(e: 'update:isOpen', value: boolean): void
|
||||||
}
|
}
|
||||||
|
|
||||||
const props = defineProps<Props>()
|
defineProps<Props>()
|
||||||
const emit = defineEmits<Emits>()
|
const emit = defineEmits<Emits>()
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -64,7 +63,14 @@ async function handleGenerate() {
|
||||||
// Initialize profile form with current data
|
// Initialize profile form with current data
|
||||||
const profile = identity.currentProfile.value
|
const profile = identity.currentProfile.value
|
||||||
if (profile) {
|
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!')
|
toast.success('Identity generated successfully!')
|
||||||
|
|
@ -82,7 +88,14 @@ async function handleImport() {
|
||||||
// Initialize profile form with current data
|
// Initialize profile form with current data
|
||||||
const profile = identity.currentProfile.value
|
const profile = identity.currentProfile.value
|
||||||
if (profile) {
|
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!')
|
toast.success('Identity imported successfully!')
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ interface Emits {
|
||||||
(e: 'cancel'): void
|
(e: 'cancel'): void
|
||||||
}
|
}
|
||||||
|
|
||||||
const props = withDefaults(defineProps<Props>(), {
|
withDefaults(defineProps<Props>(), {
|
||||||
title: 'Enter Password',
|
title: 'Enter Password',
|
||||||
description: 'Your identity is encrypted. Please enter your password to continue.'
|
description: 'Your identity is encrypted. Please enter your password to continue.'
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -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 type { NostrIdentity } from './identity'
|
||||||
import { hexToBytes } from '@/lib/utils/crypto'
|
import { hexToBytes } from '@/lib/utils/crypto'
|
||||||
|
|
||||||
|
|
@ -18,7 +18,7 @@ export const EventKinds = {
|
||||||
/**
|
/**
|
||||||
* Create a text note event
|
* 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 = {
|
const eventTemplate: EventTemplate = {
|
||||||
kind: EventKinds.TEXT_NOTE,
|
kind: EventKinds.TEXT_NOTE,
|
||||||
created_at: Math.floor(Date.now() / 1000),
|
created_at: Math.floor(Date.now() / 1000),
|
||||||
|
|
@ -42,7 +42,7 @@ export function createReaction(
|
||||||
targetAuthor: string,
|
targetAuthor: string,
|
||||||
reaction: string,
|
reaction: string,
|
||||||
identity: NostrIdentity
|
identity: NostrIdentity
|
||||||
): UnsignedEvent {
|
): Event {
|
||||||
const eventTemplate: EventTemplate = {
|
const eventTemplate: EventTemplate = {
|
||||||
kind: EventKinds.REACTION,
|
kind: EventKinds.REACTION,
|
||||||
created_at: Math.floor(Date.now() / 1000),
|
created_at: Math.floor(Date.now() / 1000),
|
||||||
|
|
@ -59,7 +59,7 @@ export function createReaction(
|
||||||
/**
|
/**
|
||||||
* Create a profile metadata event
|
* Create a profile metadata event
|
||||||
*/
|
*/
|
||||||
export function createProfileMetadata(profile: Record<string, any>, identity: NostrIdentity): UnsignedEvent {
|
export function createProfileMetadata(profile: Record<string, any>, identity: NostrIdentity): Event {
|
||||||
const eventTemplate: EventTemplate = {
|
const eventTemplate: EventTemplate = {
|
||||||
kind: EventKinds.PROFILE_METADATA,
|
kind: EventKinds.PROFILE_METADATA,
|
||||||
created_at: Math.floor(Date.now() / 1000),
|
created_at: Math.floor(Date.now() / 1000),
|
||||||
|
|
@ -73,7 +73,7 @@ export function createProfileMetadata(profile: Record<string, any>, identity: No
|
||||||
/**
|
/**
|
||||||
* Create a contact list event (following)
|
* 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 = {
|
const eventTemplate: EventTemplate = {
|
||||||
kind: EventKinds.CONTACT_LIST,
|
kind: EventKinds.CONTACT_LIST,
|
||||||
created_at: Math.floor(Date.now() / 1000),
|
created_at: Math.floor(Date.now() / 1000),
|
||||||
|
|
@ -87,7 +87,7 @@ export function createContactList(contacts: string[], identity: NostrIdentity):
|
||||||
/**
|
/**
|
||||||
* Create a delete event
|
* 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 = {
|
const eventTemplate: EventTemplate = {
|
||||||
kind: EventKinds.DELETE,
|
kind: EventKinds.DELETE,
|
||||||
created_at: Math.floor(Date.now() / 1000),
|
created_at: Math.floor(Date.now() / 1000),
|
||||||
|
|
|
||||||
|
|
@ -27,13 +27,13 @@ export default defineConfig(({ mode }) => ({
|
||||||
},
|
},
|
||||||
includeAssets: ['favicon.ico', 'apple-touch-icon.png', 'mask-icon.svg'],
|
includeAssets: ['favicon.ico', 'apple-touch-icon.png', 'mask-icon.svg'],
|
||||||
manifest: {
|
manifest: {
|
||||||
name: 'Vue Shadcn App',
|
name: 'Ario - Nostr Community Hub',
|
||||||
short_name: 'Vue App',
|
short_name: 'Ario',
|
||||||
description: 'A Vue 3 app with Shadcn UI',
|
description: 'Nostr-based community platform with Lightning Network integration for events and announcements',
|
||||||
theme_color: '#ffffff',
|
theme_color: '#1f2937',
|
||||||
background_color: '#ffffff',
|
background_color: '#ffffff',
|
||||||
display: 'standalone',
|
display: 'standalone',
|
||||||
orientation: 'portrait',
|
orientation: 'portrait-primary',
|
||||||
start_url: '/',
|
start_url: '/',
|
||||||
scope: '/',
|
scope: '/',
|
||||||
id: 'ario-nostr-hub',
|
id: 'ario-nostr-hub',
|
||||||
|
|
@ -43,18 +43,28 @@ export default defineConfig(({ mode }) => ({
|
||||||
{
|
{
|
||||||
src: 'pwa-192x192.png',
|
src: 'pwa-192x192.png',
|
||||||
sizes: '192x192',
|
sizes: '192x192',
|
||||||
type: 'image/png'
|
type: 'image/png',
|
||||||
},
|
purpose: 'any'
|
||||||
{
|
|
||||||
src: 'pwa-512x512.png',
|
|
||||||
sizes: '512x512',
|
|
||||||
type: 'image/png'
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
src: 'pwa-512x512.png',
|
src: 'pwa-512x512.png',
|
||||||
sizes: '512x512',
|
sizes: '512x512',
|
||||||
type: 'image/png',
|
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'
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue