Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

999 Company Statistics Page #1032

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions FrontEnd/src/pages/AdminPage/Menu/Menu.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { NavLink, useLocation } from 'react-router-dom';
import { NavLink } from 'react-router-dom';
import { useAuth } from '../../../hooks';
import ProfilesStatistics from '../UserProfilesTable/ProfilesStatistics';
import css from './Menu.module.css';

const MENU = [
Expand All @@ -24,6 +23,11 @@ const MENU = [
title: 'Налаштування часу автоапруву',
link: '/customadmin/automoderation/'
},
{
id: 'am5',
title: 'Статистика компаній',
link: '/customadmin/statistics/'
},
];


Expand All @@ -43,7 +47,6 @@ const SUPERUSER_MENU = [

function Menu() {
const { isSuperUser } = useAuth();
const location = useLocation();

return (
<div className={css['menu-section']}>
Expand All @@ -56,7 +59,6 @@ function Menu() {
key={element.id} to={element.link}>{element.title}
</NavLink>
))}
{location.pathname === '/customadmin/profiles/' && <ProfilesStatistics />}
</div>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,23 +46,25 @@ function ProfilesStatistics() {
) : error ? (
<div className={css['error']}>Не вдалося отримати статистику компаній</div>
) : (
<Descriptions
title="Статистика компаній"
column={1}
bordered
size="small"
items={items.map((item) => ({
...item,
label: (
<span className={css['description-item-label']}>{item.label}</span>
),
children: (
<span className={css['description-item-content']}>
{item.children}
</span>
),
}))}
/>
<div className={css['statistics-container']}>
<Descriptions
title="Статистика компаній"
column={1}
bordered
size="small"
items={items.map((item) => ({
...item,
label: (
<span className={css['description-item-label']}>{item.label}</span>
),
children: (
<span className={css['description-item-content']}>
{item.children}
</span>
),
}))}
/>
</div>
);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
.statistics-container {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
height: 100%;
padding: 30px;
}

.description-item-label {
max-width: 150px;
}
Expand Down
2 changes: 2 additions & 0 deletions FrontEnd/src/routes/AdminRouter.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import ModerationEmail from '../pages/AdminPage/DetailView/ModerationEmail';
import Contacts from '../pages/AdminPage/DetailView/Contacts';
import AdminProfilePage from '../pages/AdminPage/AdminProfile/AdminProfilePage';
import AdminRegistration from '../pages/AdminPage/AdminRegistration/AdminRegistration';
import ProfilesStatistics from '../pages/AdminPage/UserProfilesTable/ProfilesStatistics';

import customAdminTheme from '../pages/CustomThemes/customAdminTheme.js';
import '../pages/AdminPage/AdminGlobal.css';
Expand Down Expand Up @@ -46,6 +47,7 @@ function AdminRouter() {
)}
<Route path="/contacts" element={<Contacts />} />
<Route path="/admin-profile/*" element={<AdminProfilePage />} />
<Route path="/statistics" element={<ProfilesStatistics />} />
</>
) : (
<Route path="/customadmin/" />
Expand Down
Loading