Skip to content

Commit a837785

Browse files
committed
siglead management screen done
1 parent d678eb6 commit a837785

File tree

2 files changed

+52
-49
lines changed

2 files changed

+52
-49
lines changed

src/ui/pages/siglead/ManageSigLeads.page.tsx

Lines changed: 5 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { getRunEnvironmentConfig } from '@ui/config';
1111
import { useApi } from '@ui/util/api';
1212
import { OrganizationList as orgList } from '@common/orgs';
1313
import { AppRoles } from '@common/roles';
14+
import { ScreenComponent } from './SigScreenComponents';
1415

1516
export function capitalizeFirstLetter(string: string) {
1617
return string.charAt(0).toUpperCase() + string.slice(1);
@@ -154,54 +155,9 @@ export const ManageSigLeadsPage: React.FC = () => {
154155
};
155156

156157
return (
157-
<div
158-
style={{
159-
display: 'flex',
160-
flexDirection: 'column',
161-
alignItems: 'center',
162-
justifyContent: 'center',
163-
height: '100vh',
164-
textAlign: 'center',
165-
}}
166-
>
167-
<svg
168-
xmlns="http://www.w3.org/2000/svg"
169-
width="100"
170-
height="100"
171-
viewBox="0 0 24 24"
172-
fill="none"
173-
stroke="currentColor"
174-
strokeWidth="2"
175-
strokeLinecap="round"
176-
strokeLinejoin="round"
177-
style={{
178-
animation: 'rotate 2s linear infinite',
179-
}}
180-
>
181-
<path d="M12 2v2"></path>
182-
<path d="M12 20v2"></path>
183-
<path d="m4.93 4.93 1.41 1.41"></path>
184-
<path d="m17.66 17.66 1.41 1.41"></path>
185-
<path d="M2 12h2"></path>
186-
<path d="M20 12h2"></path>
187-
<path d="m6.34 17.66-1.41 1.41"></path>
188-
<path d="m19.07 4.93-1.41 1.41"></path>
189-
<circle cx="12" cy="12" r="3"></circle>
190-
</svg>
191-
<h1 style={{ marginTop: '20px', fontSize: '24px' }}>Page Under Construction</h1>
192-
193-
<style>
194-
{`
195-
@keyframes rotate {
196-
from {
197-
transform: rotate(0deg);
198-
}
199-
to {
200-
transform: rotate(360deg);
201-
}
202-
}
203-
`}
204-
</style>
205-
</div>
158+
<AuthGuard resourceDef={{ service: 'core', validRoles: [AppRoles.IAM_ADMIN] }}>
159+
<Title order={2}>SigLead Management System</Title>
160+
<ScreenComponent />
161+
</AuthGuard>
206162
);
207163
};
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
import React, { useEffect, useMemo, useState } from 'react';
2+
import { z } from 'zod';
3+
import { OrganizationList } from '@common/orgs';
4+
import { NavLink } from '@mantine/core';
5+
import { AuthGuard } from '@ui/components/AuthGuard';
6+
import { AppRoles } from '@common/roles';
7+
import { IconUsersGroup } from '@tabler/icons-react';
8+
import { useLocation } from 'react-router-dom';
9+
10+
// use personn icon
11+
// import { IconPlus, IconTrash } from '@tabler/icons-react';
12+
13+
// const OrganizationListEnum = z.enum(OrganizationList);
14+
15+
// const renderTableRow = (org: string) => {
16+
// const count = 50;
17+
// return(
18+
// <Transition mounted={true} transition="fade" duration={400} timingFunction="ease">
19+
// {(styles) => (
20+
// <tr style={{ ...styles, display: 'table-row' }}>
21+
// <Table.Td>{org}</Table.Td>
22+
// <Table.Td>{count}</Table.Td>
23+
// </tr>
24+
// )}
25+
// </Transition>
26+
// )
27+
// }
28+
29+
const renderSigLink = (org: string, index: number) => {
30+
return (
31+
<NavLink
32+
href={`${useLocation().pathname}/${org}`}
33+
label={org}
34+
active={index % 2 === 0}
35+
rightSection={
36+
<div style={{ display: 'flex', alignItems: 'center', gap: '4px' }}>
37+
<span>MemberCount[{index}]</span>
38+
<IconUsersGroup />
39+
</div>
40+
}
41+
/>
42+
);
43+
};
44+
45+
export const ScreenComponent: React.FC = () => {
46+
return <>{OrganizationList.map(renderSigLink)}</>;
47+
};

0 commit comments

Comments
 (0)