aboutsummaryrefslogtreecommitdiffstats
path: root/webui/src/pages/identity/IdentityQuery.tsx
diff options
context:
space:
mode:
authorQuentin Gliech <quentingliech@gmail.com>2022-02-22 20:38:32 +0100
committerQuentin Gliech <quentingliech@gmail.com>2022-02-22 20:38:32 +0100
commitb0eb041e571dd616a9926d969bb42b3e7d6512e9 (patch)
tree5e6965b98386adb0fcd3548dc69e46daf788ccbb /webui/src/pages/identity/IdentityQuery.tsx
parentbce4d095e16fb33d181b29aa1d3476037c0c873a (diff)
downloadgit-bug-b0eb041e571dd616a9926d969bb42b3e7d6512e9.tar.gz
webui: upgrade react-router
Diffstat (limited to 'webui/src/pages/identity/IdentityQuery.tsx')
-rw-r--r--webui/src/pages/identity/IdentityQuery.tsx11
1 files changed, 5 insertions, 6 deletions
diff --git a/webui/src/pages/identity/IdentityQuery.tsx b/webui/src/pages/identity/IdentityQuery.tsx
index 762c17cc..5a3b2616 100644
--- a/webui/src/pages/identity/IdentityQuery.tsx
+++ b/webui/src/pages/identity/IdentityQuery.tsx
@@ -1,5 +1,5 @@
import * as React from 'react';
-import { RouteComponentProps } from 'react-router-dom';
+import { useParams } from 'react-router-dom';
import CircularProgress from '@material-ui/core/CircularProgress';
@@ -7,13 +7,12 @@ import { useGetUserByIdQuery } from '../../components/Identity/UserIdentity.gene
import Identity from './Identity';
-type Props = RouteComponentProps<{
- id: string;
-}>;
+const UserQuery: React.FC = () => {
+ const params = useParams<'id'>();
+ if (params.id === undefined) throw new Error();
-const UserQuery: React.FC<Props> = ({ match }: Props) => {
const { loading, error, data } = useGetUserByIdQuery({
- variables: { userId: match.params.id },
+ variables: { userId: params.id },
});
if (loading) return <CircularProgress />;
if (error) return <p>Error: {error}</p>;