frontend: react+mui (#3004)

* mui v5 wip

* wip

* wip

* wip

* use compressor for all controlplane endpoints

* wip

* wip

* add deps

* fix authenticate URL

* fix test

* fix test

* fix build

* maybe fix build

* fix integration test

* remove image asset test

* add yarn.lock
This commit is contained in:
Caleb Doxsey 2022-02-07 08:47:58 -07:00 committed by GitHub
parent 64d8748251
commit 2824faecbf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
84 changed files with 13373 additions and 1455 deletions

View file

@ -0,0 +1,55 @@
import GroupDetails from "./GroupDetails";
import HeroSection from "./HeroSection";
import PersonIcon from "./PersonIcon";
import SessionDetails from "./SessionDetails";
import SessionDeviceCredentials from "./SessionDeviceCredentials";
import UserClaims from "./UserClaims";
import MuiAvatar from "@mui/material/Avatar";
import Container from "@mui/material/Container";
import Stack from "@mui/material/Stack";
import styled from "@mui/material/styles/styled";
import React, { FC } from "react";
import { UserInfoPageData } from "src/types";
const Avatar = styled(MuiAvatar)(({ theme }) => ({
backgroundColor: theme.palette.primary.main,
height: 48,
width: 48
}));
type UserInfoPageProps = {
data: UserInfoPageData;
};
const UserInfoPage: FC<UserInfoPageProps> = ({ data }) => {
const name = data?.user?.claims?.given_name?.[0] || data?.user?.name;
return (
<Container>
<Stack spacing={3}>
<HeroSection
icon={
<Avatar>
<PersonIcon />
</Avatar>
}
title={<>Hi {name}!</>}
text={
<>
Welcome to the user info endpoint. Here you can view your current
session details, and authorization context.
</>
}
/>
<SessionDetails session={data?.session} />
<UserClaims user={data?.user} />
<GroupDetails groups={data?.directoryGroups} />
<SessionDeviceCredentials
csrfToken={data?.csrfToken}
session={data?.session}
user={data?.user}
webAuthnUrl={data?.webAuthnUrl}
/>
</Stack>
</Container>
);
};
export default UserInfoPage;