Skip to content

Commit

Permalink
set scroll behavior when return from auth
Browse files Browse the repository at this point in the history
  • Loading branch information
jwkaterina committed Feb 26, 2024
1 parent 600edd8 commit 6c63d81
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/app/components/navigation/menus/auth-menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,21 @@ import { SlideContext } from '@/app/context/slide-context';
const AuthMenu = (): JSX.Element => {

const router = useRouter();
const { setBlockScroll } = useContext(SlideContext);
const { setScrollBehavior } = useContext(SlideContext);

const backHandler = () => {
setBlockScroll(true);
setScrollBehavior('auto');
router.back();
setTimeout(() => {
setBlockScroll(false);
setScrollBehavior('smooth');
}, 500);
}

const homeHandler = () => {
setBlockScroll(true);
setScrollBehavior('auto');
router.push('/');
setTimeout(() => {
setBlockScroll(false);
setScrollBehavior('smooth');
}, 500);
}

Expand Down

0 comments on commit 6c63d81

Please sign in to comment.