feat: Implement market functionality with ProductCard, useMarket composable, and market store
- Add ProductCard.vue component for displaying product details, including image, name, description, price, and stock status. - Create useMarket.ts composable to manage market loading, data fetching, and real-time updates from Nostr. - Introduce market.ts store to handle market, stall, product, and order states, along with filtering and sorting capabilities. - Develop Market.vue page to present market content, including loading states, error handling, and product grid. - Update router to include a new market route for user navigation.
This commit is contained in:
parent
2fc87fa032
commit
4d3d69f527
6 changed files with 1079 additions and 1 deletions
|
|
@ -16,10 +16,18 @@ interface PushConfig {
|
|||
enabled: boolean
|
||||
}
|
||||
|
||||
interface MarketConfig {
|
||||
defaultNaddr: string
|
||||
supportedRelays: string[]
|
||||
lightningEnabled: boolean
|
||||
defaultCurrency: string
|
||||
}
|
||||
|
||||
interface AppConfig {
|
||||
nostr: NostrConfig
|
||||
api: ApiConfig
|
||||
push: PushConfig
|
||||
market: MarketConfig
|
||||
support: {
|
||||
npub: string
|
||||
}
|
||||
|
|
@ -51,6 +59,18 @@ export const config: AppConfig = {
|
|||
vapidPublicKey: import.meta.env.VITE_VAPID_PUBLIC_KEY || '',
|
||||
enabled: Boolean(import.meta.env.VITE_PUSH_NOTIFICATIONS_ENABLED)
|
||||
},
|
||||
market: {
|
||||
defaultNaddr: import.meta.env.VITE_MARKET_NADDR || '',
|
||||
supportedRelays: parseJsonEnv(import.meta.env.VITE_MARKET_RELAYS, [
|
||||
'wss://relay.damus.io',
|
||||
'wss://relay.snort.social',
|
||||
'wss://nostr-pub.wellorder.net',
|
||||
'wss://nostr.zebedee.cloud',
|
||||
'wss://nostr.walletofsatoshi.com'
|
||||
]),
|
||||
lightningEnabled: Boolean(import.meta.env.VITE_LIGHTNING_ENABLED),
|
||||
defaultCurrency: import.meta.env.VITE_MARKET_DEFAULT_CURRENCY || 'sat'
|
||||
},
|
||||
support: {
|
||||
npub: import.meta.env.VITE_SUPPORT_NPUB || ''
|
||||
}
|
||||
|
|
@ -74,10 +94,18 @@ export const configUtils = {
|
|||
return Boolean(config.push.vapidPublicKey && config.push.enabled)
|
||||
},
|
||||
|
||||
hasMarketConfig: (): boolean => {
|
||||
return Boolean(config.market.defaultNaddr)
|
||||
},
|
||||
|
||||
getDefaultRelays: (): string[] => {
|
||||
return config.nostr.relays
|
||||
},
|
||||
|
||||
getMarketRelays: (): string[] => {
|
||||
return config.market.supportedRelays
|
||||
}
|
||||
}
|
||||
|
||||
// Export individual config sections for convenience
|
||||
export const { nostr: nostrConfig, api: apiConfig } = config
|
||||
export const { nostr: nostrConfig, api: apiConfig, market: marketConfig } = config
|
||||
Loading…
Add table
Add a link
Reference in a new issue