All files / pages ProfilePage.js

100% Statements 5/5
100% Branches 2/2
100% Functions 1/1
100% Lines 5/5

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37              1x   8x   8x 2x         6x                                      
import React from "react";
import { useCurrentUser } from "main/utils/currentUser";
import BasicLayout from "main/layouts/BasicLayout/BasicLayout";
import ReactJson from "react-json-view";
import UsersTable from "main/components/Users/UsersTable"
import UserEmailsTable from "main/components/Users/UserEmailsTable";
 
const ProfilePage = () => {
 
    const { data: currentUser } = useCurrentUser();
 
    if (!currentUser.loggedIn) {
        return (
            <p>Not logged in.</p>
        )
    }
 
    return (
        <BasicLayout>
            <h1 className={"mb-3"}>
                User Profile for {currentUser.root.user.githubLogin}
            </h1>
            <UsersTable users={[currentUser.root.user]} />
            <h2 className={"mt-3 mb-3"}>
                Emails
            </h2>
            <UserEmailsTable emails={currentUser.root.user.emails} />
            <h2 className={"mt-3 mb-3"}>
                Debugging Information
            </h2>
            <ReactJson src={currentUser} />
        </BasicLayout>
    );
};
 
export default ProfilePage;