fix: approche React propre pour page équipe + navigation corrigée
- Page team.tsx rend directement l'iframe dans React (pas de manipulation DOM) - Script bloqueur plus sélectif : bloque seulement strategie-script.js - Permet les scripts de navigation essentiels - Évite les conflits avec les scripts JavaScript Cette approche devrait : - Afficher les visualisations équipe correctement - Garder la navigation fonctionnelle (logo vers accueil)
This commit is contained in:
@@ -98,36 +98,59 @@ RUN echo "📊 Comptage des fichiers .md dans .techradar/data/radar" && \
|
|||||||
# La page Next.js pour le routing, le HTML statique pour garantir l'affichage
|
# La page Next.js pour le routing, le HTML statique pour garantir l'affichage
|
||||||
RUN mkdir -p .techradar/src/pages && \
|
RUN mkdir -p .techradar/src/pages && \
|
||||||
cat > .techradar/src/pages/team.tsx << 'EOF'
|
cat > .techradar/src/pages/team.tsx << 'EOF'
|
||||||
import { useEffect } from 'react';
|
import { useEffect, useState } from 'react';
|
||||||
|
|
||||||
export default function TeamPage() {
|
export default function TeamPage() {
|
||||||
|
const [loaded, setLoaded] = useState(false);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
// Vérification côté client uniquement
|
// Petit délai pour laisser Next.js finir son rendu
|
||||||
if (typeof window === 'undefined' || typeof document === 'undefined') return;
|
const timer = setTimeout(() => {
|
||||||
|
setLoaded(true);
|
||||||
|
}, 100);
|
||||||
|
|
||||||
try {
|
return () => clearTimeout(timer);
|
||||||
console.log('🔄 TEAM PAGE: Chargement iframe équipe');
|
|
||||||
|
|
||||||
// Remplacement simple et sécurisé
|
|
||||||
document.body.innerHTML = '<iframe src="/team.html" style="width:100vw;height:100vh;border:none;position:fixed;top:0;left:0;z-index:9999;" title="Équipe & Technologies"></iframe>';
|
|
||||||
|
|
||||||
console.log('✅ TEAM PAGE: Iframe chargé avec succès');
|
|
||||||
} catch (error) {
|
|
||||||
console.error('❌ Erreur chargement iframe:', error);
|
|
||||||
}
|
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
// Rendu côté serveur : rien (évite erreurs SSR)
|
// Rendu direct de l'iframe dans le composant React
|
||||||
if (typeof window === 'undefined') {
|
if (loaded) {
|
||||||
return (
|
return (
|
||||||
<div style={{width: '100vw', height: '100vh', background: '#1a4d3a', display: 'flex', alignItems: 'center', justifyContent: 'center'}}>
|
<iframe
|
||||||
<div style={{color: 'white', fontSize: '18px'}}>Chargement de la page Équipe...</div>
|
src="/team.html"
|
||||||
</div>
|
style={{
|
||||||
|
width: '100vw',
|
||||||
|
height: '100vh',
|
||||||
|
border: 'none',
|
||||||
|
position: 'fixed',
|
||||||
|
top: 0,
|
||||||
|
left: 0,
|
||||||
|
zIndex: 9999,
|
||||||
|
background: '#1a4d3a'
|
||||||
|
}}
|
||||||
|
title="Équipe & Technologies"
|
||||||
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Côté client : rien, useEffect gère tout
|
// Pendant le chargement
|
||||||
return null;
|
return (
|
||||||
|
<div style={{
|
||||||
|
width: '100vw',
|
||||||
|
height: '100vh',
|
||||||
|
background: '#1a4d3a',
|
||||||
|
display: 'flex',
|
||||||
|
alignItems: 'center',
|
||||||
|
justifyContent: 'center',
|
||||||
|
position: 'fixed',
|
||||||
|
top: 0,
|
||||||
|
left: 0,
|
||||||
|
zIndex: 9999
|
||||||
|
}}>
|
||||||
|
<div style={{color: 'white', fontSize: '18px'}}>
|
||||||
|
Chargement des visualisations équipe...
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
RUN echo "✅ Page team.tsx créée (version ultra-simplifiée)" && \
|
RUN echo "✅ Page team.tsx créée (version ultra-simplifiée)" && \
|
||||||
|
|||||||
@@ -2,29 +2,35 @@
|
|||||||
(function() {
|
(function() {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
// BLOQUER ABSOLUMENT TOUTES LES PAGES ÉQUIPE
|
// DÉTECTION PAGE ÉQUIPE
|
||||||
if (window.location.pathname === '/team' ||
|
var isTeamPage = window.location.pathname === '/team' ||
|
||||||
window.location.pathname === '/team/' ||
|
window.location.pathname === '/team/' ||
|
||||||
window.location.pathname.startsWith('/team/') ||
|
window.location.pathname.startsWith('/team/') ||
|
||||||
window.location.href.includes('/team')) {
|
window.location.href.includes('/team');
|
||||||
|
|
||||||
|
if (isTeamPage) {
|
||||||
console.log('🚫 BLOQUEUR ÉQUIPE ACTIF - Page équipe détectée');
|
console.log('🚫 BLOQUEUR ÉQUIPE ACTIF - Page équipe détectée');
|
||||||
|
|
||||||
// Empêcher tout autre script de s'exécuter
|
// Bloquer les scripts qui interfèrent avec la page équipe
|
||||||
window.__blockTeamPages = true;
|
window.__blockTeamPages = true;
|
||||||
|
|
||||||
// Bloquer immédiatement tout chargement de script
|
// Permettre quand même les scripts essentiels pour la navigation
|
||||||
var originalAppendChild = Element.prototype.appendChild;
|
var originalAppendChild = Element.prototype.appendChild;
|
||||||
Element.prototype.appendChild = function(child) {
|
Element.prototype.appendChild = function(child) {
|
||||||
if (child.tagName === 'SCRIPT' && child.src && child.src.includes('strategie-script.js')) {
|
if (child.tagName === 'SCRIPT' && child.src) {
|
||||||
|
// Bloquer seulement strategie-script.js qui cause les problèmes
|
||||||
|
if (child.src.includes('strategie-script.js')) {
|
||||||
console.log('🚫 Script strategie-script.js BLOQUÉ sur page équipe');
|
console.log('🚫 Script strategie-script.js BLOQUÉ sur page équipe');
|
||||||
return child; // Ne pas l'ajouter
|
return child; // Ne pas l'ajouter
|
||||||
}
|
}
|
||||||
|
// Permettre les autres scripts (navigation, etc.)
|
||||||
|
}
|
||||||
return originalAppendChild.call(this, child);
|
return originalAppendChild.call(this, child);
|
||||||
};
|
};
|
||||||
|
|
||||||
return; // Arrêt immédiat
|
console.log('✅ Navigation et scripts essentiels autorisés sur page équipe');
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('✅ Page normale détectée - scripts autorisés');
|
console.log('✅ Page normale détectée - tous scripts autorisés');
|
||||||
})();
|
})();
|
||||||
|
|||||||
Reference in New Issue
Block a user