feat: add city/state/country to complex, new settings page with sidebar, and Biome linting
- Added city, state, and country optional fields to Complex model - Updated onboarding to include optional location fields - Created new settings page with sidebar navigation (Datos del Complejo, Canchas) - Replaced ESLint with Biome for frontend and backend linting - Added parallel dev script with concurrently - Migrated register-routes to use direct app.route() pattern
This commit is contained in:
@@ -1,25 +1,25 @@
|
||||
import type { PublicBookingConfirmation } from '@repo/api-contract'
|
||||
import { siWhatsapp } from 'simple-icons'
|
||||
import { Button } from '@/components/ui/button'
|
||||
import { Button } from '@/components/ui/button';
|
||||
import type { PublicBookingConfirmation } from '@repo/api-contract';
|
||||
import { siWhatsapp } from 'simple-icons';
|
||||
|
||||
type ShareWhatsappButtonProps = {
|
||||
confirmation: PublicBookingConfirmation
|
||||
}
|
||||
confirmation: PublicBookingConfirmation;
|
||||
};
|
||||
|
||||
function formatDateLabel(isoDate: string) {
|
||||
const [year, month, day] = isoDate.split('-').map(Number)
|
||||
const date = new Date(year, (month ?? 1) - 1, day ?? 1)
|
||||
const [year, month, day] = isoDate.split('-').map(Number);
|
||||
const date = new Date(year, (month ?? 1) - 1, day ?? 1);
|
||||
|
||||
return new Intl.DateTimeFormat('es-AR', {
|
||||
weekday: 'long',
|
||||
day: '2-digit',
|
||||
month: 'long',
|
||||
year: 'numeric',
|
||||
}).format(date)
|
||||
}).format(date);
|
||||
}
|
||||
|
||||
function createWhatsappMessage(confirmation: PublicBookingConfirmation) {
|
||||
const dateLabel = formatDateLabel(confirmation.date)
|
||||
const dateLabel = formatDateLabel(confirmation.date);
|
||||
return [
|
||||
'Ya reservamos cancha para jugar.',
|
||||
`Complejo: ${confirmation.complexName}`,
|
||||
@@ -27,13 +27,13 @@ function createWhatsappMessage(confirmation: PublicBookingConfirmation) {
|
||||
`Fecha: ${dateLabel}`,
|
||||
`Horario: ${confirmation.startTime} - ${confirmation.endTime}`,
|
||||
`Codigo de reserva: ${confirmation.bookingCode}`,
|
||||
].join('\n')
|
||||
].join('\n');
|
||||
}
|
||||
|
||||
export function ShareWhatsappButton({ confirmation }: ShareWhatsappButtonProps) {
|
||||
const whatsappUrl = `https://wa.me/?text=${encodeURIComponent(
|
||||
createWhatsappMessage(confirmation),
|
||||
)}`
|
||||
createWhatsappMessage(confirmation)
|
||||
)}`;
|
||||
|
||||
return (
|
||||
<Button type="button" variant="outline" className="h-11 w-full text-sm sm:text-base" asChild>
|
||||
@@ -49,5 +49,5 @@ export function ShareWhatsappButton({ confirmation }: ShareWhatsappButtonProps)
|
||||
Compartir por WhatsApp
|
||||
</a>
|
||||
</Button>
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user