5 changed files with 53 additions and 18 deletions
@ -0,0 +1,17 @@ |
|||||||
|
import { useMemo } from "react"; |
||||||
|
import { useLocation } from "react-router-dom"; |
||||||
|
|
||||||
|
export function useQueryParams() { |
||||||
|
const loc = useLocation(); |
||||||
|
|
||||||
|
const queryParams = useMemo(() => { |
||||||
|
// Basic absolutely-not-fool-proof URL query param parser
|
||||||
|
const obj: Record<string, string> = Object.fromEntries( |
||||||
|
new URLSearchParams(loc.search).entries() |
||||||
|
); |
||||||
|
|
||||||
|
return obj; |
||||||
|
}, [loc]); |
||||||
|
|
||||||
|
return queryParams; |
||||||
|
} |
||||||
@ -1,15 +0,0 @@ |
|||||||
.popout-wrapper ::-webkit-scrollbar-track { |
|
||||||
background-color: transparent; |
|
||||||
} |
|
||||||
|
|
||||||
.popout-wrapper ::-webkit-scrollbar-thumb { |
|
||||||
background-color: theme("colors.denim-500"); |
|
||||||
border: 5px solid transparent; |
|
||||||
border-left: 0; |
|
||||||
background-clip: content-box; |
|
||||||
} |
|
||||||
|
|
||||||
.popout-wrapper ::-webkit-scrollbar { |
|
||||||
/* For some reason the styles don't get applied without the width */ |
|
||||||
width: 13px; |
|
||||||
} |
|
||||||
Loading…
Reference in new issue