Skip to content

Commit

Permalink
added users count
Browse files Browse the repository at this point in the history
  • Loading branch information
Andcool-Systems committed Nov 16, 2024
1 parent f6783b1 commit 618e4a1
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
8 changes: 4 additions & 4 deletions src/app/admin/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ const Admin = () => {
})
}, [])

const UsersEl = users.map((user) => {
const usersEl = users.map((user) => {
return (
<div key={user.id} className={style_root.user_card}>
<div style={{ display: 'flex', flexDirection: 'column' }}>
Expand All @@ -83,10 +83,10 @@ const Admin = () => {
<main className={style_root.main}>
<div className={style_root.main_container}>
{
UsersEl.length !== 0 &&
usersEl.length !== 0 &&
<>
<h2>Пользователи</h2>
<AdaptiveGrid child_width={350} className={style_root}>{UsersEl}</AdaptiveGrid>
<h2>Пользователи ({usersEl.length})</h2>
<AdaptiveGrid child_width={350} className={style_root}>{usersEl}</AdaptiveGrid>
</>
}
</div>
Expand Down
28 changes: 14 additions & 14 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,21 @@ import meta from '@/app/meta.json';
import { merge } from 'lodash';

export const generateMetadata = async (): Promise<Metadata | undefined> => {
const headersList = headers();
const path = headersList.get('X-Forwarded-Path')?.split('?')[0]; // Working only with Nginx config!
if (!path) return;
const object = (meta as { [key: string]: any });
const base = meta.base;
const extend = object[path];
return merge({}, base, extend) as Metadata;
const headersList = headers();
const path = headersList.get('X-Forwarded-Path')?.split('?')[0]; // Working only with Nginx config!
if (!path) return;
const object = (meta as { [key: string]: any });
const base = meta.base;
const extend = object[path];
return merge({}, base, extend) as Metadata;
}

export default function RootLayout({ children }: Readonly<{ children: React.ReactNode }>) {
return (
<CookiesProvider>
<Providers>
{children}
</Providers>
</CookiesProvider>
);
return (
<CookiesProvider>
<Providers>
{children}
</Providers>
</CookiesProvider>
);
}

0 comments on commit 618e4a1

Please sign in to comment.