diff --git a/src/components/onboarding/OnboardingTour.tsx b/src/components/onboarding/OnboardingTour.tsx index 0f0726f..965dbe3 100644 --- a/src/components/onboarding/OnboardingTour.tsx +++ b/src/components/onboarding/OnboardingTour.tsx @@ -19,6 +19,21 @@ const OnboardingTour: React.FC = ({ onSkip, onClose }) => { + // Definir a função ANTES de usá-la + const removeHighlightStyle = () => { + const elements = document.querySelectorAll('[data-tour]') as NodeListOf; + elements.forEach(element => { + element.style.backgroundColor = ''; + element.style.color = ''; + element.style.fontWeight = ''; + element.style.boxShadow = ''; + element.style.border = ''; + element.style.borderRadius = ''; + element.style.position = ''; + element.style.zIndex = ''; + }); + }; + // Cleanup de estilos quando o componente for desmontado ou tour fechado useEffect(() => { if (!isOpen) { @@ -85,21 +100,6 @@ const OnboardingTour: React.FC = ({ const currentStepData = steps[currentStep]; - // Remover estilos quando não há spotlight - const removeHighlightStyle = () => { - const elements = document.querySelectorAll('[data-tour]') as NodeListOf; - elements.forEach(element => { - element.style.backgroundColor = ''; - element.style.color = ''; - element.style.fontWeight = ''; - element.style.boxShadow = ''; - element.style.border = ''; - element.style.borderRadius = ''; - element.style.position = ''; - element.style.zIndex = ''; - }); - }; - // Estilo para destacar o elemento com fundo branco e texto preto const highlightElementStyle = () => { if (!currentStepData.spotlight) return;