user info page
This commit is contained in:
parent
deb33b73d2
commit
6458a0610b
5
.gitignore
vendored
5
.gitignore
vendored
@ -1,3 +1,8 @@
|
||||
node_modules/
|
||||
*/node_modules/
|
||||
*/build/
|
||||
|
||||
**/node_modules/
|
||||
**/build/
|
||||
.DS_Store
|
||||
.env
|
||||
File diff suppressed because one or more lines are too long
1
frontend/json/runtimeError.json
Normal file
1
frontend/json/runtimeError.json
Normal file
@ -0,0 +1 @@
|
||||
{}
|
||||
@ -92,6 +92,12 @@ const menuAside: MenuAsideItem[] = [
|
||||
label: 'Profile',
|
||||
icon: icon.mdiAccountCircle,
|
||||
},
|
||||
{
|
||||
href: '/user-info',
|
||||
label: 'User Info',
|
||||
icon: icon.mdiAccountCircle,
|
||||
},
|
||||
|
||||
|
||||
{
|
||||
href: '/home',
|
||||
|
||||
56
frontend/src/pages/user-info.tsx
Normal file
56
frontend/src/pages/user-info.tsx
Normal file
@ -0,0 +1,56 @@
|
||||
import { mdiAccountCircle } from '@mdi/js';
|
||||
import Head from 'next/head';
|
||||
import React, { ReactElement } from 'react';
|
||||
import CardBox from '../components/CardBox';
|
||||
import LayoutAuthenticated from '../layouts/Authenticated';
|
||||
import SectionMain from '../components/SectionMain';
|
||||
import SectionTitleLineWithButton from '../components/SectionTitleLineWithButton';
|
||||
import { getPageTitle } from '../config';
|
||||
import { useAppSelector } from '../stores/hooks';
|
||||
|
||||
const UserInfo = () => {
|
||||
const { currentUser } = useAppSelector((state) => state.auth);
|
||||
|
||||
return (
|
||||
<>
|
||||
<Head>
|
||||
<title>{getPageTitle('User Info')}</title>
|
||||
</Head>
|
||||
<SectionMain>
|
||||
<SectionTitleLineWithButton icon={mdiAccountCircle} title="User Info" main>
|
||||
{' '}
|
||||
</SectionTitleLineWithButton>
|
||||
<CardBox>
|
||||
{currentUser ? (
|
||||
<dl className="grid grid-cols-1 gap-x-4 gap-y-2 sm:grid-cols-2">
|
||||
<div>
|
||||
<dt className="text-sm font-medium text-gray-500">First Name</dt>
|
||||
<dd className="mt-1 text-sm text-gray-900">{currentUser.firstName}</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt className="text-sm font-medium text-gray-500">Last Name</dt>
|
||||
<dd className="mt-1 text-sm text-gray-900">{currentUser.lastName}</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt className="text-sm font-medium text-gray-500">Email</dt>
|
||||
<dd className="mt-1 text-sm text-gray-900">{currentUser.email}</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt className="text-sm font-medium text-gray-500">Phone Number</dt>
|
||||
<dd className="mt-1 text-sm text-gray-900">{currentUser.phoneNumber}</dd>
|
||||
</div>
|
||||
</dl>
|
||||
) : (
|
||||
<p>User information not available.</p>
|
||||
)}
|
||||
</CardBox>
|
||||
</SectionMain>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
UserInfo.getLayout = function getLayout(page: ReactElement) {
|
||||
return <LayoutAuthenticated>{page}</LayoutAuthenticated>;
|
||||
};
|
||||
|
||||
export default UserInfo;
|
||||
Loading…
x
Reference in New Issue
Block a user