From ff60277ae9b75072a6572be387858d67e31e7b07 Mon Sep 17 00:00:00 2001 From: padreug Date: Wed, 17 Sep 2025 19:36:13 +0200 Subject: [PATCH] Update RideshareComposer to reflect pricing in satoshis - Changed price labels and descriptions to specify 'sats' instead of dollars, enhancing clarity for users. - Updated the price field type from string to number, ensuring proper validation and handling of input. - Adjusted content generation to display prices in satoshis, aligning with the overall theme of the rideshare feature. These changes improve the user experience by providing clearer financial information in the RideshareComposer component. --- .../nostr-feed/components/RideshareComposer.vue | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/modules/nostr-feed/components/RideshareComposer.vue b/src/modules/nostr-feed/components/RideshareComposer.vue index 9df607b..82bef88 100644 --- a/src/modules/nostr-feed/components/RideshareComposer.vue +++ b/src/modules/nostr-feed/components/RideshareComposer.vue @@ -130,21 +130,22 @@ - {{ watchedType === 'offering' ? 'Price per person' : 'Willing to pay' }} + {{ watchedType === 'offering' ? 'Price per person (sats)' : 'Willing to pay (sats)' }}
- $ + + sats
- {{ watchedType === 'offering' ? 'Cost per passenger (optional)' : 'Maximum you\'re willing to pay (optional)' }} + {{ watchedType === 'offering' ? 'Cost per passenger in satoshis (optional)' : 'Maximum satoshis you\'re willing to pay (optional)' }}
@@ -271,7 +272,7 @@ const rideshareSchema = toTypedSchema(z.object({ ), time: z.string().min(1, "Time is required"), seats: z.string().optional(), - price: z.string().optional(), + price: z.number().int().min(0, "Price must be positive").optional().or(z.literal('')).transform(val => val === '' ? undefined : val), details: z.string().max(200, "Details too long").optional(), contactMethod: z.enum(['nostr-dm', 'replies', 'other']).optional(), })) @@ -286,7 +287,7 @@ const form = useForm({ date: '', time: '', seats: '', - price: '', + price: undefined as number | undefined, details: '', contactMethod: 'nostr-dm' } @@ -327,7 +328,7 @@ const generateRideshareContent = (values: any): string => { if (values.price) { const priceLabel = values.type === 'offering' ? 'Price per person' : 'Willing to pay' - content += `💰 ${priceLabel}: $${values.price}\n` + content += `💰 ${priceLabel}: ${values.price} sats\n` } if (values.contactMethod) {