fix: ensure leaflet loads, add amenity badges, propagate version
This commit is contained in:
parent
5eed471ad9
commit
aa2883cb0c
4 changed files with 39 additions and 15 deletions
|
|
@ -9,6 +9,16 @@ type ListingPageProps = {
|
||||||
params: { slug: string };
|
params: { slug: string };
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const amenityIcons: Record<string, string> = {
|
||||||
|
sauna: '🧖',
|
||||||
|
fireplace: '🔥',
|
||||||
|
wifi: '📶',
|
||||||
|
pets: '🐾',
|
||||||
|
lake: '🌊',
|
||||||
|
ac: '❄️',
|
||||||
|
ev: '⚡',
|
||||||
|
};
|
||||||
|
|
||||||
export async function generateMetadata({ params }: ListingPageProps): Promise<Metadata> {
|
export async function generateMetadata({ params }: ListingPageProps): Promise<Metadata> {
|
||||||
const translation = await getListingBySlug({ slug: params.slug, locale: DEFAULT_LOCALE });
|
const translation = await getListingBySlug({ slug: params.slug, locale: DEFAULT_LOCALE });
|
||||||
|
|
||||||
|
|
@ -52,20 +62,29 @@ export default async function ListingPage({ params }: ListingPageProps) {
|
||||||
<strong>{t('listingCapacity')}:</strong> {t('capacityGuests', { count: listing.maxGuests })} - {t('capacityBedrooms', { count: listing.bedrooms })} -{' '}
|
<strong>{t('listingCapacity')}:</strong> {t('capacityGuests', { count: listing.maxGuests })} - {t('capacityBedrooms', { count: listing.bedrooms })} -{' '}
|
||||||
{t('capacityBeds', { count: listing.beds })} - {t('capacityBathrooms', { count: listing.bathrooms })}
|
{t('capacityBeds', { count: listing.beds })} - {t('capacityBathrooms', { count: listing.bathrooms })}
|
||||||
</div>
|
</div>
|
||||||
<div style={{ marginTop: 8 }}>
|
<div style={{ marginTop: 12 }}>
|
||||||
<strong>{t('listingAmenities')}:</strong>{' '}
|
<strong>{t('listingAmenities')}:</strong>
|
||||||
{[
|
<div style={{ display: 'flex', gap: 8, flexWrap: 'wrap', marginTop: 6 }}>
|
||||||
listing.hasSauna && t('amenitySauna'),
|
{listing.hasSauna ? <span className="badge">{amenityIcons.sauna} {t('amenitySauna')}</span> : null}
|
||||||
listing.hasFireplace && t('amenityFireplace'),
|
{listing.hasFireplace ? <span className="badge">{amenityIcons.fireplace} {t('amenityFireplace')}</span> : null}
|
||||||
listing.hasWifi && t('amenityWifi'),
|
{listing.hasWifi ? <span className="badge">{amenityIcons.wifi} {t('amenityWifi')}</span> : null}
|
||||||
listing.petsAllowed && t('amenityPets'),
|
{listing.petsAllowed ? <span className="badge">{amenityIcons.pets} {t('amenityPets')}</span> : null}
|
||||||
listing.byTheLake && t('amenityLake'),
|
{listing.byTheLake ? <span className="badge">{amenityIcons.lake} {t('amenityLake')}</span> : null}
|
||||||
listing.hasAirConditioning && t('amenityAirConditioning'),
|
{listing.hasAirConditioning ? <span className="badge">{amenityIcons.ac} {t('amenityAirConditioning')}</span> : null}
|
||||||
listing.evCharging === 'FREE' && t('amenityEvFree'),
|
{listing.evCharging === 'FREE' ? <span className="badge">{amenityIcons.ev} {t('amenityEvFree')}</span> : null}
|
||||||
listing.evCharging === 'PAID' && t('amenityEvPaid'),
|
{listing.evCharging === 'PAID' ? <span className="badge">{amenityIcons.ev} {t('amenityEvPaid')}</span> : null}
|
||||||
]
|
{!(
|
||||||
.filter(Boolean)
|
listing.hasSauna ||
|
||||||
.join(', ') || '-'}
|
listing.hasFireplace ||
|
||||||
|
listing.hasWifi ||
|
||||||
|
listing.petsAllowed ||
|
||||||
|
listing.byTheLake ||
|
||||||
|
listing.hasAirConditioning ||
|
||||||
|
listing.evCharging !== 'NONE'
|
||||||
|
)
|
||||||
|
? <span className="badge">-</span>
|
||||||
|
: null}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div style={{ marginTop: 8 }}>
|
<div style={{ marginTop: 8 }}>
|
||||||
<strong>{t('listingContact')}:</strong> {listing.contactName} - {listing.contactEmail}
|
<strong>{t('listingContact')}:</strong> {listing.contactName} - {listing.contactEmail}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
'use client';
|
'use client';
|
||||||
|
|
||||||
|
import 'leaflet/dist/leaflet.css';
|
||||||
import Link from 'next/link';
|
import Link from 'next/link';
|
||||||
import { useEffect, useMemo, useRef, useState } from 'react';
|
import { useEffect, useMemo, useRef, useState } from 'react';
|
||||||
import { useI18n } from '../components/I18nProvider';
|
import { useI18n } from '../components/I18nProvider';
|
||||||
|
|
|
||||||
|
|
@ -19,8 +19,9 @@ fi
|
||||||
|
|
||||||
IMAGE=$(cat deploy/.last-image)
|
IMAGE=$(cat deploy/.last-image)
|
||||||
K8S_IMAGE="$IMAGE"
|
K8S_IMAGE="$IMAGE"
|
||||||
|
APP_VERSION="${APP_VERSION:-$(echo \"$IMAGE\" | awk -F: '{print $NF}')}"
|
||||||
|
|
||||||
export K8S_NAMESPACE APP_HOST NEXT_PUBLIC_SITE_URL NEXT_PUBLIC_API_BASE APP_ENV CLUSTER_ISSUER INGRESS_CLASS K8S_IMAGE
|
export K8S_NAMESPACE APP_HOST NEXT_PUBLIC_SITE_URL NEXT_PUBLIC_API_BASE APP_ENV CLUSTER_ISSUER INGRESS_CLASS K8S_IMAGE APP_VERSION
|
||||||
|
|
||||||
TMP_MANIFEST=$(mktemp)
|
TMP_MANIFEST=$(mktemp)
|
||||||
envsubst < k8s/app.yaml > "$TMP_MANIFEST"
|
envsubst < k8s/app.yaml > "$TMP_MANIFEST"
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,9 @@ spec:
|
||||||
ports:
|
ports:
|
||||||
- containerPort: 3000
|
- containerPort: 3000
|
||||||
name: http
|
name: http
|
||||||
|
envFrom:
|
||||||
|
- configMapRef:
|
||||||
|
name: lomavuokraus-web-config
|
||||||
envFrom:
|
envFrom:
|
||||||
- secretRef:
|
- secretRef:
|
||||||
name: lomavuokraus-web-secrets
|
name: lomavuokraus-web-secrets
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue