// Public-facing homepage
const PublicHome = ({ state, navigate }) => {
const packages = state.packages.filter(p => p.status === 'published');
const featured = packages.filter(p => p.featured).slice(0, 4);
const allTours = packages;
const [searchDest, setSearchDest] = useState('');
const [searchService, setSearchService] = useState('All services');
const [searchPrice, setSearchPrice] = useState('Any price');
return (
{/* HERO */}
Kuching-based · Licensed {state.settings.license}
Sarawak,
on your terms.
Inbound tours from the people who actually live here. Outbound trips without the call-centre middleman.
Since 2008.
{/* Search bar */}
Service
setSearchService(e.target.value)} style={{ border: 0, outline: 0, fontSize: 15, marginTop: 2, width: '100%', background: 'transparent', appearance: 'none', color: 'var(--ink)' }}>
All services Tour Car Rental Hotel Ticketing
Budget
setSearchPrice(e.target.value)} style={{ border: 0, outline: 0, fontSize: 15, marginTop: 2, width: '100%', background: 'transparent', appearance: 'none', color: 'var(--ink)' }}>
Any price Under RM 200 RM 200–500 RM 500–1,500 RM 1,500+
navigate({ route: 'tours' })}>Search
{/* Trust strip */}
{[
{ k: '17 yrs', v: 'curating Sarawak' },
{ k: '12,400+', v: 'travellers hosted' },
{ k: '4.8 ★', v: 'average rating' },
{ k: 'Local', v: 'guides, always' },
].map((s, i) => (
{s.k}
{s.v}
))}
{/* SERVICES */}
What we do
Four services, one honest agency.
We don't list everything under the sun. We list the things we've personally vetted — and we answer WhatsApp messages ourselves.
{[
{ icon: 'compass', title: 'Tours', text: 'Inbound Sarawak + curated outbound trips.', count: packages.length + ' packages' },
{ icon: 'bed-double', title: 'Hotels', text: '4★ and boutique, with direct-booking rates.', count: '60+ partners' },
{ icon: 'plane', title: 'Ticketing', text: 'Flight ticketing with on-shore support.', count: '24h response' },
{ icon: 'car', title: 'Car Rental', text: 'Self-drive + chauffeured, Kuching-wide.', count: state.vehicles.length + ' vehicles' },
].map((s, i) => (
e.currentTarget.style.background = '#FBF8F1'}
onMouseLeave={e => e.currentTarget.style.background = 'white'}
onClick={() => navigate({ route: i === 0 ? 'tours' : i === 3 ? 'vehicles' : 'contact' })}>
{s.title}
{s.text}
{s.count} →
))}
{/* FEATURED TOURS */}
Featured trips
Borneo, actually seen.
navigate({ route: 'tours' })} style={{ display: 'inline-flex', alignItems: 'center', gap: 8, fontWeight: 500, color: 'var(--ink)', borderBottom: '1px solid var(--ink)', paddingBottom: 2 }}>
View all {allTours.length} packages
{featured.map((p, i) => navigate({ route: 'tour', slug: p.slug })} hero={i === 0} />)}
{/* EDITORIAL BAND */}
★ The PXS promise
No white-label itineraries. No sub-contracted guides.{' '}
Just our team , from inquiry to airport drop-off.
{[
['01', 'You inquire', 'Form or WhatsApp — a human replies in under 4 hours.'],
['02', 'We plan', 'A licensed Kuching-based consultant builds the trip with you.'],
['03', 'You travel', 'One phone number for the whole trip. Answered 24/7.'],
].map(([n, t, d], i) => (
))}
{/* TESTIMONIALS */}
Travellers
What they said when they got home.
{[
{ name: 'Clara Bennett', from: 'London, UK', text: 'We used PXS for a two-week Sarawak loop. Peter actually meets you for a coffee when you land — who does that any more?', rating: 5 },
{ name: 'Yoshi Nakamura', from: 'Tokyo, Japan', text: 'Impeccable communication in English. Our Mulu trip had a weather hiccup and they rebooked us instantly, at no cost.', rating: 5 },
{ name: 'Michael O\'Brien', from: 'Sydney, AU', text: 'We\'ve used them for three family trips now. Kids love Sarah, one of their guides. Book her if you can.', rating: 5 },
].map((r, i) => (
{[...Array(r.rating)].map((_, j) => )}
"{r.text}"
))}
{/* Partner logos */}
Licensed partner of
{['Sarawak Tourism', 'MATTA', 'ASEANTA', 'MAS Tours', 'AirAsia', 'Ministry of Tourism'].map(x => (
{x}
))}
{/* BLOG TEASER */}
Field notes
From the journal.
navigate({ route: 'blog' })} style={{ display: 'inline-flex', alignItems: 'center', gap: 8, fontWeight: 500, borderBottom: '1px solid var(--ink)', paddingBottom: 2 }}>
All articles
{state.blogs.filter(b => b.status === 'published').slice(0, 3).map(b => (
navigate({ route: 'blogpost', slug: b.slug })} style={{ cursor: 'pointer' }}
onMouseEnter={e => { const img = e.currentTarget.querySelector('img'); if (img) img.style.transform = 'scale(1.04)'; }}
onMouseLeave={e => { const img = e.currentTarget.querySelector('img'); if (img) img.style.transform = 'scale(1)'; }}>
{b.category}
{b.title}
{b.excerpt}
{b.author} · {fmtDate(b.date)}
))}
{/* CTA */}
Ready to go? WhatsApp is fastest.
Most inquiries answered within the hour during business hours.
window.open(`https://wa.me/${state.settings.whatsapp.replace(/[^\d]/g, '')}`, '_blank')}>Chat on WhatsApp
navigate({ route: 'contact' })}>Send inquiry
);
};
// ---------- Tour card ----------
const TourCard = ({ pkg, onClick, hero = false }) => {
const [hover, setHover] = useState(false);
return (
setHover(true)} onMouseLeave={() => setHover(false)}
style={{
gridColumn: hero ? 'span 2' : 'auto',
gridRow: hero ? 'span 2' : 'auto',
cursor: 'pointer', background: 'white', borderRadius: 18, overflow: 'hidden',
border: '1px solid #e8e1cf', transition: 'all .2s',
transform: hover ? 'translateY(-3px)' : 'translateY(0)',
boxShadow: hover ? '0 18px 40px rgba(26,31,28,0.12)' : '0 1px 3px rgba(0,0,0,0.03)',
}}>
{pkg.category === 'inbound' ? 'Sarawak' : 'Outbound'}
{pkg.duration &&
{pkg.duration} }
{pkg.destination}
{pkg.title}
{hero &&
{pkg.short}
}
From
{fmtMYR(pkg.priceFrom)}/pax
{pkg.rating}
({pkg.reviews})
);
};
// ---------- Nav bar ----------
const PublicNav = ({ state, navigate, dark = false }) => {
const color = dark ? '#F5EEDE' : 'var(--ink)';
const border = dark ? 'rgba(245,238,222,0.2)' : '#e8e1cf';
const nav = state.nav.filter(n => n.visible);
return (
navigate({ route: 'home' })} style={{ cursor: 'pointer', display: 'flex', alignItems: 'center', gap: 10, color }}>
P
{state.settings.agencyName}
Kuching · Sarawak
{nav.map(n => {
const route = n.link.startsWith('/p/') ? { route: 'page', slug: n.link.replace('/p/', '') }
: n.link === '/tours' ? { route: 'tours' }
: n.link === '/vehicles' ? { route: 'vehicles' }
: n.link === '/blog' ? { route: 'blog' }
: n.link === '/contact' ? { route: 'contact' }
: { route: 'home' };
return (
navigate(route)} style={{ color, fontSize: 14, fontWeight: 500, padding: '4px 0' }}>{n.label}
);
})}
{ const menu = document.getElementById('pxs-mobile-menu'); if (menu) menu.style.display = menu.style.display === 'block' ? 'none' : 'block'; }}>
EN / BM
window.open(`https://wa.me/${state.settings.whatsapp.replace(/[^\d]/g, '')}`, '_blank')}>WhatsApp
);
};
// ---------- Footer ----------
const PublicFooter = ({ state, navigate }) => (
P
{state.settings.agencyName}
{state.settings.tagline} Licensed {state.settings.license}. Family-run since 2008.
{['facebook', 'instagram', 'youtube'].map(s => (
))}
{[
['Travel', ['Tours', 'Car rental', 'Hotel booking', 'Flight ticketing']],
['Company', ['About', 'FAQ', 'Blog', 'Contact']],
['Contact', [state.settings.phone, state.settings.whatsapp + ' (WA)', state.settings.email, state.settings.address]],
].map(([title, items]) => (
))}
© 2026 PXS Travel Sdn Bhd. All rights reserved.
navigate({ route: 'page', slug: 'terms' })}>Terms
navigate({ route: 'page', slug: 'privacy' })}>Privacy
Hours: {state.settings.hours}
);
Object.assign(window, { PublicHome, TourCard, PublicNav, PublicFooter });