diff --git a/pages/[name]/territories.js b/pages/[name]/territories.js new file mode 100644 index 000000000..3b7a18775 --- /dev/null +++ b/pages/[name]/territories.js @@ -0,0 +1,33 @@ +import { getGetServerSideProps } from '../../api/ssrApollo' +import { useRouter } from 'next/router' +import { USER, USER_WITH_SUBS } from '../../fragments/users' +import { useQuery } from '@apollo/client' +import PageLoading from '../../components/page-loading' +import { UserLayout } from '.' +import TerritoryList from '../../components/territory-list' + +export const getServerSideProps = getGetServerSideProps({ query: USER_WITH_SUBS }) + +export default function UserTerritories ({ ssrData }) { + const router = useRouter() + const variables = { ...router.query } + + const { data } = useQuery(USER, { variables }) + if (!data && !ssrData) return + + const { user } = data || ssrData + + return ( + +
+ data.userSubs} + rank + /> +
+
+ ) +}