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:
syoul
2025-12-09 12:57:31 +01:00
parent 53c9e1253d
commit 7097490439
2 changed files with 61 additions and 32 deletions

View File

@@ -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
RUN mkdir -p .techradar/src/pages && \
cat > .techradar/src/pages/team.tsx << 'EOF'
import { useEffect } from 'react';
import { useEffect, useState } from 'react';
export default function TeamPage() {
const [loaded, setLoaded] = useState(false);
useEffect(() => {
// Vérification côté client uniquement
if (typeof window === 'undefined' || typeof document === 'undefined') return;
// Petit délai pour laisser Next.js finir son rendu
const timer = setTimeout(() => {
setLoaded(true);
}, 100);
try {
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);
}
return () => clearTimeout(timer);
}, []);
// Rendu côté serveur : rien (évite erreurs SSR)
if (typeof window === 'undefined') {
// Rendu direct de l'iframe dans le composant React
if (loaded) {
return (
<div style={{width: '100vw', height: '100vh', background: '#1a4d3a', display: 'flex', alignItems: 'center', justifyContent: 'center'}}>
<div style={{color: 'white', fontSize: '18px'}}>Chargement de la page Équipe...</div>
</div>
<iframe
src="/team.html"
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
return null;
// Pendant le chargement
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
RUN echo "✅ Page team.tsx créée (version ultra-simplifiée)" && \

View File

@@ -2,29 +2,35 @@
(function() {
'use strict';
// BLOQUER ABSOLUMENT TOUTES LES PAGES ÉQUIPE
if (window.location.pathname === '/team' ||
window.location.pathname === '/team/' ||
window.location.pathname.startsWith('/team/') ||
window.location.href.includes('/team')) {
// DÉTECTION PAGE ÉQUIPE
var isTeamPage = window.location.pathname === '/team' ||
window.location.pathname === '/team/' ||
window.location.pathname.startsWith('/team/') ||
window.location.href.includes('/team');
if (isTeamPage) {
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;
// Bloquer immédiatement tout chargement de script
// Permettre quand même les scripts essentiels pour la navigation
var originalAppendChild = Element.prototype.appendChild;
Element.prototype.appendChild = function(child) {
if (child.tagName === 'SCRIPT' && child.src && child.src.includes('strategie-script.js')) {
console.log('🚫 Script strategie-script.js BLOQUÉ sur page équipe');
return child; // Ne pas l'ajouter
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');
return child; // Ne pas l'ajouter
}
// Permettre les autres scripts (navigation, etc.)
}
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');
})();