// Shared shell: Logo, Nav, Footer, TrustStrip, MobiBar, common UI
const { useState, useEffect, useRef, useCallback, createContext, useContext } = React;
// ---- Routing context ----
const RouterCtx = createContext({ route: 'home', go: () => {} });
const useRouter = () => useContext(RouterCtx);
// ---- Constants ----
const PHONE = '+971 55 166 8588';
const PHONE_RAW = '+971551668588';
const WA_NUMBER = '971551668588';
const EMAIL = 'info@arabianprints.com';
const ADDRESS_LINE_1 = 'Al Quoz Industrial Area 2';
const ADDRESS_LINE_2 = 'Dubai, United Arab Emirates';
function waLink(text) {
return `https://wa.me/${WA_NUMBER}?text=${encodeURIComponent(text)}`;
}
// ---- Logo ----
function Logo({ onDark }) {
return (
Arabian Prints
Print · Sign · Exhibition
);
}
// ---- Nav ----
function Nav() {
const { route, go } = useRouter();
const links = [
{ id: 'home', label: 'Home' },
{ id: 'products', label: 'Products' },
{ id: 'portfolio', label: 'Portfolio' },
{ id: 'upload', label: 'Upload & Order' },
{ id: 'contact', label: 'Contact' },
];
return (
);
}
// ---- Footer ----
function Footer() {
const { go } = useRouter();
return (
<>
>
);
}
// ---- Trust strip ----
function TrustStrip() {
return (
01 / Speed
24-hour turnaround
Order by 11am, ready next-day 7pm
02 / Design
Free design
Bundled with every print job
03 / Payment
No advance payment
Pay only when you're happy
04 / Delivery
Free UAE delivery
Anywhere, on orders over AED 200
);
}
// ---- Mobile bottom bar ----
function MobiBar() {
const { go } = useRouter();
return (
);
}
// ---- Icons (minimal, monoline) ----
function PhoneIcon() {
return ();
}
function WaIcon() {
return ();
}
function ArrowIcon() {
return ();
}
function UploadIcon() {
return ();
}
function FileIcon() {
return ();
}
function XIcon() {
return ();
}
// ---- Section header ----
function SectionHead({ eyebrow, title, right }) {
return (
{eyebrow &&
{eyebrow}
}
{title}
{right &&
{right}
}
);
}
// ---- Helper: format file size ----
function formatSize(bytes) {
if (bytes < 1024) return bytes + ' B';
if (bytes < 1024*1024) return (bytes/1024).toFixed(1) + ' KB';
return (bytes/(1024*1024)).toFixed(1) + ' MB';
}
// ---- Scroll to top on route change ----
function ScrollTopOnRoute({ route }) {
useEffect(() => {
window.scrollTo({ top: 0, behavior: 'instant' });
}, [route]);
return null;
}
// Export to window
Object.assign(window, {
RouterCtx, useRouter,
PHONE, PHONE_RAW, WA_NUMBER, EMAIL, ADDRESS_LINE_1, ADDRESS_LINE_2,
waLink, formatSize,
Logo, Nav, Footer, TrustStrip, MobiBar,
PhoneIcon, WaIcon, ArrowIcon, UploadIcon, FileIcon, XIcon,
SectionHead, ScrollTopOnRoute,
});