feat: don't update progress bar on searches

This commit is contained in:
Vyacheslav Matyukhin 2022-03-26 14:42:13 +03:00
parent bb846068f3
commit d662572bcd
No known key found for this signature in database
GPG Key ID: 3D2A774C5489F96C
2 changed files with 6 additions and 29 deletions

View File

@ -4,7 +4,12 @@ import '../styles/main.css';
import Router from 'next/router'; import Router from 'next/router';
import NProgress from 'nprogress'; 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("routeChangeComplete", () => NProgress.done());
Router.events.on("routeChangeError", () => NProgress.done()); Router.events.on("routeChangeError", () => NProgress.done());

View File

@ -1,28 +0,0 @@
import React from 'react';
export default function DropdownForStars({
value,
onChange,
options,
howmanystars,
}) {
const handleSelectOption = (event) => {
onChange(event.target.value);
};
return (
<select
onChange={(e) => handleSelectOption(e)}
className="border-none"
value={options.filter((option) => howmanystars(option) == value)[0]}
>
{options.map((address, key) => {
return (
<option key={key} value={address}>
{address}
</option>
);
})}
</select>
);
}