diff --git a/src/modules/nostr-feed/components/FeedFilters.vue b/src/modules/nostr-feed/components/FeedFilters.vue index d70bb62..9c586c1 100644 --- a/src/modules/nostr-feed/components/FeedFilters.vue +++ b/src/modules/nostr-feed/components/FeedFilters.vue @@ -154,10 +154,10 @@ const presets = computed(() => [ { id: 'all', label: 'All Content' }, { id: 'announcements', label: 'Announcements' }, { id: 'community', label: 'Community' }, - { id: 'marketplace', label: 'Marketplace' }, { id: 'social', label: 'Social' }, { id: 'events', label: 'Events' }, - { id: 'content', label: 'Articles' } + { id: 'content', label: 'Articles' }, + { id: 'rideshare', label: 'Rideshare' } ]) // Current active filters diff --git a/src/modules/nostr-feed/components/MarketProduct.vue b/src/modules/nostr-feed/components/MarketProduct.vue deleted file mode 100644 index e80b842..0000000 --- a/src/modules/nostr-feed/components/MarketProduct.vue +++ /dev/null @@ -1,171 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/modules/nostr-feed/components/NostrFeed.vue b/src/modules/nostr-feed/components/NostrFeed.vue index d4e8dac..4cddac0 100644 --- a/src/modules/nostr-feed/components/NostrFeed.vue +++ b/src/modules/nostr-feed/components/NostrFeed.vue @@ -9,8 +9,6 @@ import { useProfiles } from '../composables/useProfiles' import { useReactions } from '../composables/useReactions' import appConfig from '@/app.config' import type { ContentFilter } from '../services/FeedService' -import MarketProduct from './MarketProduct.vue' -import { parseMarketProduct } from '../utils/marketParser' interface Emits { (e: 'reply-to-note', note: { id: string; content: string; pubkey: string }): void @@ -130,34 +128,6 @@ function getRideshareType(note: any): string | null { return 'Rideshare' } -// Get market product data for market events -function getMarketProductData(note: any) { - if (note.kind === 30018) { - // Create a mock NostrEvent from our FeedPost - const mockEvent = { - id: note.id, - pubkey: note.pubkey, - content: note.content, - created_at: note.created_at, - kind: note.kind, - tags: note.tags, - sig: '' // Required by Event interface - } - return parseMarketProduct(mockEvent) - } - return null -} - -// Handle market product actions -function onViewProduct(productId: string) { - console.log('View product:', productId) - // TODO: Navigate to product detail page or open modal -} - -function onShareProduct(productId: string) { - console.log('Share product:', productId) - // TODO: Implement sharing functionality -} // Handle reply to note function onReplyToNote(note: any) { @@ -247,53 +217,8 @@ async function onToggleLike(note: any) {
- - - - +
@@ -313,13 +238,6 @@ async function onToggleLike(note: any) { > Reply - - Market Product - = { filterByAuthor: 'exclude-admin' }, - // Market content - marketStalls: { - id: 'market-stalls', - label: 'Market Stalls', - kinds: [30017], // NIP-15: Nostr Marketplace - description: 'Marketplace stall listings' - }, - - marketProducts: { - id: 'market-products', - label: 'Market Products', - kinds: [30018], // NIP-15: Nostr Marketplace - description: 'Product listings and updates' - }, - - marketGeneral: { - id: 'market-general', - label: 'Market Activity', - kinds: [30019], // NIP-15: Nostr Marketplace - description: 'General marketplace activity' - }, // Chat messages (if user wants to see them in feed) chatMessages: { @@ -122,7 +101,6 @@ export const FILTER_PRESETS: Record = { CONTENT_FILTERS.calendarEvents, CONTENT_FILTERS.longFormContent // Note: reactions (kind 7) are handled separately by ReactionService - // Note: market items removed - they have their own dedicated section ], announcements: [ @@ -136,12 +114,6 @@ export const FILTER_PRESETS: Record = { // Note: reactions are handled separately for counts ], - marketplace: [ - CONTENT_FILTERS.marketStalls, - CONTENT_FILTERS.marketProducts, - CONTENT_FILTERS.marketGeneral - // Marketplace is a separate section - not mixed with regular feed - ], social: [ CONTENT_FILTERS.textNotes, diff --git a/src/modules/nostr-feed/services/FeedService.ts b/src/modules/nostr-feed/services/FeedService.ts index 1ae3286..a161dd9 100644 --- a/src/modules/nostr-feed/services/FeedService.ts +++ b/src/modules/nostr-feed/services/FeedService.ts @@ -279,10 +279,6 @@ export class FeedService extends BaseService { return false } - // Exclude marketplace events (they have their own dedicated section) - if (event.kind === 30017 || event.kind === 30018 || event.kind === 30019) { - return false - } const isAdminPost = config.adminPubkeys?.includes(event.pubkey) || false diff --git a/src/modules/nostr-feed/utils/marketParser.ts b/src/modules/nostr-feed/utils/marketParser.ts deleted file mode 100644 index 1c2e807..0000000 --- a/src/modules/nostr-feed/utils/marketParser.ts +++ /dev/null @@ -1,101 +0,0 @@ -import type { Event as NostrEvent } from 'nostr-tools' -import type { MarketProductData } from '../components/MarketProduct.vue' - -export interface MarketStallData { - id: string - name: string - description: string - currency: string - shipping: Array<{ - id: string - cost: number - }> -} - -/** - * Parse a Nostr market product event (kind 30018) into structured data - */ -export function parseMarketProduct(event: NostrEvent): MarketProductData | null { - try { - if (event.kind !== 30018) { - return null - } - - // Parse the JSON content - const productData = JSON.parse(event.content) - - // Validate required fields - if (!productData.id || !productData.name || typeof productData.price !== 'number') { - console.warn('Invalid market product data:', productData) - return null - } - - return { - id: productData.id, - stall_id: productData.stall_id || '', - name: productData.name, - description: productData.description || '', - images: Array.isArray(productData.images) ? productData.images : [], - currency: productData.currency || 'sat', - price: productData.price, - quantity: productData.quantity || 0, - active: productData.active !== false, // Default to true if not specified - shipping: Array.isArray(productData.shipping) ? productData.shipping : [] - } - } catch (error) { - console.error('Failed to parse market product event:', error, event) - return null - } -} - -/** - * Parse a Nostr market stall event (kind 30017) into structured data - */ -export function parseMarketStall(event: NostrEvent): MarketStallData | null { - try { - if (event.kind !== 30017) { - return null - } - - const stallData = JSON.parse(event.content) - - if (!stallData.id || !stallData.name) { - console.warn('Invalid market stall data:', stallData) - return null - } - - return { - id: stallData.id, - name: stallData.name, - description: stallData.description || '', - currency: stallData.currency || 'sat', - shipping: Array.isArray(stallData.shipping) ? stallData.shipping : [] - } - } catch (error) { - console.error('Failed to parse market stall event:', error, event) - return null - } -} - -/** - * Check if an event is a market-related event - */ -export function isMarketEvent(event: NostrEvent): boolean { - return event.kind === 30017 || event.kind === 30018 || event.kind === 30019 -} - -/** - * Get a human-readable type for a market event - */ -export function getMarketEventType(event: NostrEvent): string { - switch (event.kind) { - case 30017: - return 'Market Stall' - case 30018: - return 'Product' - case 30019: - return 'Market Activity' - default: - return 'Unknown Market Event' - } -} \ No newline at end of file