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:
parent
e16f23afea
commit
9a4b6a2a9e
@ -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;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user