Skip to content

Commit d561cbd

Browse files
committed
Check for Button status when navigation happens
1 parent 520f81d commit d561cbd

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/controls/TicketsButton.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React, { useEffect, useRef, useState } from 'react';
22
import { motion, useAnimate } from 'framer-motion';
3-
import { useNavigation } from 'react-router-dom';
3+
import { useLocation, useNavigation } from 'react-router-dom';
44
import classnames from 'classnames';
55

66
import { EventbriteConfig } from 'config/delorean.config';
@@ -10,6 +10,7 @@ import { LocalActivity } from '@mui/icons-material';
1010
import './TicketsButton.scss';
1111

1212
const TicketButton = () => {
13+
const location = useLocation();
1314
const [scope, animate] = useAnimate();
1415

1516
const [isMobile, setMobile] = useState(false);
@@ -35,6 +36,10 @@ const TicketButton = () => {
3536
}
3637
}, [])
3738

39+
useEffect(() => {
40+
onTransitionEvent();
41+
}, [location]);
42+
3843
useEffect(() => {
3944
if (scope.current && isMobile && prev.current.isFooterVisible !== isFooterVisible) {
4045
if (isFooterVisible) {

0 commit comments

Comments
 (0)