From 41e85023019bc13c06a1de2c431e0bd920e9e29a Mon Sep 17 00:00:00 2001
From: Sascha <GlancingMind@outlook.com>
Date: Sat, 20 Mar 2021 15:13:10 +0100
Subject: Use profile page for each identity

Authorcomponent links to the authors profile page.
Replace pofile buglist with statistics
---
 webui/src/pages/identity/IdentityQuery.tsx | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)
 create mode 100644 webui/src/pages/identity/IdentityQuery.tsx

(limited to 'webui/src/pages/identity/IdentityQuery.tsx')

diff --git a/webui/src/pages/identity/IdentityQuery.tsx b/webui/src/pages/identity/IdentityQuery.tsx
new file mode 100644
index 00000000..964a9bac
--- /dev/null
+++ b/webui/src/pages/identity/IdentityQuery.tsx
@@ -0,0 +1,24 @@
+import React from 'react';
+import { RouteComponentProps } from 'react-router-dom';
+
+import CircularProgress from '@material-ui/core/CircularProgress';
+
+import { useGetUserByIdQuery } from '../../components/Identity/UserIdentity.generated';
+
+import Identity from './Identity';
+
+type Props = RouteComponentProps<{
+  id: string;
+}>;
+
+const UserQuery: React.FC<Props> = ({ match }: Props) => {
+  const { loading, error, data } = useGetUserByIdQuery({
+    variables: { userId: match.params.id },
+  });
+  if (loading) return <CircularProgress />;
+  if (error) return <p>Error: {error}</p>;
+  if (!data?.repository?.identity) return <p>404.</p>;
+  return <Identity identity={data.repository.identity} />;
+};
+
+export default UserQuery;
-- 
cgit 

