feat: bind Landing Page explicitly to #landing route and dedicated Landing Page nav button

This commit is contained in:
Hamza-Ayed
2026-09-19 12:56:50 +03:00
parent e819186201
commit 82b1045f9c
3 changed files with 11 additions and 8 deletions
+9 -6
View File
@@ -25,7 +25,7 @@ try {
// Lightweight hash router with Sovereign Executive Styling
const NAV = [
{ hash: '#portal', label: 'البوابة التعريفية', icon: '✨' },
{ hash: '#landing', label: 'Landing Page (صفحة الهبوط)', icon: '🚀' },
{ hash: '#map', label: 'الخريطة والملاحة الشاملة', icon: '🗺️' },
{ hash: '#terrain3d', label: 'الخريطة ثلاثية الأبعاد والتضاريس', icon: '🏔️' },
{ hash: '#tourism', label: 'الخريطة السياحية والتراثية', icon: '🏛️' },
@@ -35,7 +35,7 @@ const NAV = [
]
function MasterHeader({ hash }: { hash: string }) {
const currentHash = hash || '#portal'
const currentHash = hash || '#map'
const [isFullscreen, setIsFullscreen] = useState(false);
const toggleFullscreen = () => {
@@ -258,13 +258,16 @@ class ErrorBoundary extends React.Component<{ children: React.ReactNode }, { has
function Root() {
const getInitialHash = () => {
const p = window.location.pathname.toLowerCase();
if (p.includes('landing')) {
return '#landing';
}
if (p.includes('tourism') || p.includes('heritage') || p.includes('tourist') || window.location.href.includes('سياح')) {
return '#tourism';
}
if (p.includes('tactical') || p.includes('military')) {
return '#tactical';
}
return window.location.hash || '#portal';
return window.location.hash || '#map';
};
const [hash, setHash] = useState(getInitialHash);
@@ -281,14 +284,14 @@ function Root() {
return () => window.removeEventListener('hashchange', on);
}, []);
const isPortal = hash === '#portal' || hash === '#landing' || hash === '#home' || !hash;
const isLanding = hash === '#landing' || hash === '#portal' || window.location.pathname.toLowerCase().includes('landing');
const isTourism = hash === '#tourism' || hash === '#heritage' || hash === '#tourist';
const isTactical = hash === '#tactical' || hash === '#military' || hash === '#siro';
const isTerrain3D = hash === '#terrain3d' || hash === '#3d' || hash === '#terrain';
const isExecutive = hash === '#showcase' || hash === '#pitch';
const isCompare = hash === '#compare';
const isReview = hash === '#review';
const isMap = hash === '#map';
const isMap = hash === '#map' || (!isLanding && !isTourism && !isTactical && !isTerrain3D && !isExecutive && !isCompare && !isReview);
return (
<ErrorBoundary>
@@ -304,7 +307,7 @@ function Root() {
height: 'calc(100vh - 52px)',
overflow: 'hidden'
}}>
{isPortal && (
{isLanding && (
<div style={{ width: '100%', height: '100%', overflowY: 'auto' }}>
<LandingPage />
</div>