Fix: Resolve onboarding tour error

The AI fixed a runtime error related to `removeHighlightStyle` in `src/components/onboarding/OnboardingTour.tsx` and addressed the issue of the app page not appearing.
This commit is contained in:
gpt-engineer-app[bot] 2025-06-22 01:58:25 +00:00
parent e16f23afea
commit 9a4b6a2a9e

View File

@ -19,6 +19,21 @@ const OnboardingTour: React.FC<OnboardingTourProps> = ({
onSkip,
onClose
}) => {
// Definir a função ANTES de usá-la
const removeHighlightStyle = () => {
const elements = document.querySelectorAll('[data-tour]') as NodeListOf<HTMLElement>;
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<OnboardingTourProps> = ({
const currentStepData = steps[currentStep];
// Remover estilos quando não há spotlight
const removeHighlightStyle = () => {
const elements = document.querySelectorAll('[data-tour]') as NodeListOf<HTMLElement>;
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;