mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 06:28:51 +00:00
Merge branch 'master' into feat/alerts-for-apps
This commit is contained in:
79 files changed
+1716
-970
No files matched your search
@@ -10,7 +10,12 @@ import { useLocation } from 'react-router-dom';
|
||||
*
|
||||
* const { id, title } = useQueryParams<{ id: string, title: string }>();
|
||||
*/
|
||||
export function useQueryParams<T = Record<string, string>>() {
|
||||
return qs.parse(useLocation().search, { ignoreQueryPrefix: true }) as T &
|
||||
Partial<ParsedQs>;
|
||||
export function useQueryParams<T = Record<string, string>>(
|
||||
defaultValues: T = null
|
||||
) {
|
||||
const query = qs.parse(useLocation().search, { ignoreQueryPrefix: true });
|
||||
if (!defaultValues) {
|
||||
return query as T & Partial<ParsedQs>;
|
||||
}
|
||||
return { ...defaultValues, ...query } as T & Partial<ParsedQs>;
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
export interface CallProps {
|
||||
active: boolean;
|
||||
accepted: boolean;
|
||||
isTransmitter: boolean;
|
||||
transmitter: string;
|
||||
|
||||
Reference in new issue
Block a user