From d662572bcd4c0f0154ad7daefcbab750201e18bd Mon Sep 17 00:00:00 2001 From: Vyacheslav Matyukhin Date: Sat, 26 Mar 2022 14:42:13 +0300 Subject: [PATCH] feat: don't update progress bar on searches --- src/pages/_app.tsx | 7 ++++++- src/web/display/dropdown.tsx | 28 ---------------------------- 2 files changed, 6 insertions(+), 29 deletions(-) delete mode 100644 src/web/display/dropdown.tsx diff --git a/src/pages/_app.tsx b/src/pages/_app.tsx index df5d536..86e1028 100644 --- a/src/pages/_app.tsx +++ b/src/pages/_app.tsx @@ -4,7 +4,12 @@ import '../styles/main.css'; import Router from 'next/router'; import NProgress from 'nprogress'; -Router.events.on("routeChangeStart", () => NProgress.start()); +Router.events.on("routeChangeStart", (as, { shallow }) => { + console.log(shallow); + if (!shallow) { + NProgress.start(); + } +}); Router.events.on("routeChangeComplete", () => NProgress.done()); Router.events.on("routeChangeError", () => NProgress.done()); diff --git a/src/web/display/dropdown.tsx b/src/web/display/dropdown.tsx deleted file mode 100644 index 0766401..0000000 --- a/src/web/display/dropdown.tsx +++ /dev/null @@ -1,28 +0,0 @@ -import React from 'react'; - -export default function DropdownForStars({ - value, - onChange, - options, - howmanystars, -}) { - const handleSelectOption = (event) => { - onChange(event.target.value); - }; - - return ( - - ); -}