From 80144ebad035809ef7ff30e888311f41bc9bdf0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcus=20Bl=C3=A4ttermann?= Date: Wed, 23 Nov 2022 03:38:19 +0100 Subject: [PATCH] Fix dropdowns --- website/src/components/dropdown.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/website/src/components/dropdown.js b/website/src/components/dropdown.js index ae5c42415..bccf4ccd0 100644 --- a/website/src/components/dropdown.js +++ b/website/src/components/dropdown.js @@ -1,17 +1,18 @@ import React from 'react' import PropTypes from 'prop-types' import classNames from 'classnames' -import { navigate } from 'gatsby' +import { useRouter } from 'next/router' import classes from '../styles/dropdown.module.sass' export default function Dropdown({ defaultValue, className, onChange, children }) { + const router = useRouter() const defaultOnChange = ({ target }) => { const isExternal = /((http(s?)):\/\/|mailto:)/gi.test(target.value) if (isExternal) { window.location.href = target.value } else { - navigate(target.value) + router.push(target.value) } } return (