diff options
| author | Rafi Zadanly <zadanlyr@gmail.com> | 2023-01-13 15:34:22 +0700 |
|---|---|---|
| committer | Rafi Zadanly <zadanlyr@gmail.com> | 2023-01-13 15:34:22 +0700 |
| commit | 9169b7241052916f7118556f96b3b141044f61dd (patch) | |
| tree | add41a68ea117cf70511844822f0d98828080e56 /src/components | |
| parent | a461c99e22ce5d43f5bcddffe1578649e2559df0 (diff) | |
disable multiple back in appbar
Diffstat (limited to 'src/components')
| -rw-r--r-- | src/components/AppBar.js | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/components/AppBar.js b/src/components/AppBar.js index 1da2510a..aeffdf12 100644 --- a/src/components/AppBar.js +++ b/src/components/AppBar.js @@ -21,6 +21,11 @@ const AppBar = ({ title }) => { }; }, []); + const handleBackButtonClick = (event) => { + event.currentTarget.disabled = true; + router.back(); + } + return ( <> <Head> @@ -29,7 +34,7 @@ const AppBar = ({ title }) => { <div className={"sticky-header flex justify-between !p-0 !pr-4 idt-transition " + (scrollPosition > 0 && "shadow border-b-transparent" ) }> {/* --- Start Title */} <div className="flex items-center"> - <button type="button" onClick={() => router.back()} className="text-gray_r-12 px-4 py-5"> + <button type="button" onClick={handleBackButtonClick} className="text-gray_r-12 px-4 py-5"> <ArrowLeftIcon className="w-6 stroke-2"/> </button> <h1 className="text-h-md">{ title }</h1> |
