diff --git a/src/modules/nostr-feed/components/NostrFeed.vue b/src/modules/nostr-feed/components/NostrFeed.vue index d453ef1..40f4781 100644 --- a/src/modules/nostr-feed/components/NostrFeed.vue +++ b/src/modules/nostr-feed/components/NostrFeed.vue @@ -92,6 +92,44 @@ function isAdminPost(pubkey: string): boolean { return adminPubkeys.includes(pubkey) } +// Check if a post is a rideshare post +function isRidesharePost(note: any): boolean { + // Check for rideshare tags + const hasTags = note.tags?.some((tag: string[]) => + tag[0] === 't' && ['rideshare', 'carpool'].includes(tag[1]) + ) || false + + // Check for rideshare-specific custom tags + const hasRideshareTypeTags = note.tags?.some((tag: string[]) => + tag[0] === 'rideshare_type' && ['offering', 'seeking'].includes(tag[1]) + ) || false + + // Check content for rideshare keywords (fallback) + const hasRideshareContent = note.content && ( + note.content.includes('šŸš— OFFERING RIDE') || + note.content.includes('🚶 SEEKING RIDE') || + note.content.includes('#rideshare') || + note.content.includes('#carpool') + ) + + return hasTags || hasRideshareTypeTags || hasRideshareContent +} + +// Get rideshare type from post +function getRideshareType(note: any): string | null { + // Check custom tags first + const typeTag = note.tags?.find((tag: string[]) => tag[0] === 'rideshare_type') + if (typeTag) { + return typeTag[1] === 'offering' ? 'Offering Ride' : 'Seeking Ride' + } + + // Fallback to content analysis + if (note.content?.includes('šŸš— OFFERING RIDE')) return 'Offering Ride' + if (note.content?.includes('🚶 SEEKING RIDE')) return 'Seeking Ride' + + return 'Rideshare' +} + // Get market product data for market events function getMarketProductData(note: any) { if (note.kind === 30018) { @@ -281,6 +319,13 @@ async function onToggleLike(note: any) { > {{ getMarketEventType({ kind: note.kind }) }} + + šŸš— {{ getRideshareType(note) }} + {{ getDisplayName(note.pubkey) }} diff --git a/src/modules/nostr-feed/components/RideshareComposer.vue b/src/modules/nostr-feed/components/RideshareComposer.vue new file mode 100644 index 0000000..9d6ed4a --- /dev/null +++ b/src/modules/nostr-feed/components/RideshareComposer.vue @@ -0,0 +1,447 @@ +