Skip to content

Commit c75ec3c

Browse files
committed
column headers and text color
1 parent a837785 commit c75ec3c

File tree

2 files changed

+109
-3
lines changed

2 files changed

+109
-3
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +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';
14+
import { ScreenComponent, SigTable } from './SigScreenComponents';
1515

1616
export function capitalizeFirstLetter(string: string) {
1717
return string.charAt(0).toUpperCase() + string.slice(1);
@@ -158,6 +158,7 @@ export const ManageSigLeadsPage: React.FC = () => {
158158
<AuthGuard resourceDef={{ service: 'core', validRoles: [AppRoles.IAM_ADMIN] }}>
159159
<Title order={2}>SigLead Management System</Title>
160160
<ScreenComponent />
161+
{/* <SigTable /> */}
161162
</AuthGuard>
162163
);
163164
};

src/ui/pages/siglead/SigScreenComponents.tsx

Lines changed: 107 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React, { useEffect, useMemo, useState } from 'react';
22
import { z } from 'zod';
33
import { OrganizationList } from '@common/orgs';
4-
import { NavLink } from '@mantine/core';
4+
import { NavLink, Paper } from '@mantine/core';
55
import { AuthGuard } from '@ui/components/AuthGuard';
66
import { AppRoles } from '@common/roles';
77
import { IconUsersGroup } from '@tabler/icons-react';
@@ -31,7 +31,14 @@ const renderSigLink = (org: string, index: number) => {
3131
<NavLink
3232
href={`${useLocation().pathname}/${org}`}
3333
label={org}
34+
variant="filled"
3435
active={index % 2 === 0}
36+
// color="blue"
37+
// style={{
38+
// // color: "lightgray",
39+
// backgroundColor: "DodgerBlue",
40+
// opacity: 0.5
41+
// }}
3542
rightSection={
3643
<div style={{ display: 'flex', alignItems: 'center', gap: '4px' }}>
3744
<span>MemberCount[{index}]</span>
@@ -43,5 +50,103 @@ const renderSigLink = (org: string, index: number) => {
4350
};
4451

4552
export const ScreenComponent: React.FC = () => {
46-
return <>{OrganizationList.map(renderSigLink)}</>;
53+
return (
54+
<>
55+
<Paper
56+
shadow="xs"
57+
p="sm"
58+
style={{
59+
display: 'flex',
60+
justifyContent: 'space-between',
61+
alignItems: 'center',
62+
fontWeight: 'bold',
63+
// backgroundColor: "#f8f9fa",
64+
borderRadius: '8px',
65+
padding: '10px 16px',
66+
marginBottom: '8px',
67+
}}
68+
>
69+
<span>Organization</span>
70+
<span>Member Count</span>
71+
</Paper>
72+
{OrganizationList.map(renderSigLink)}
73+
</>
74+
);
4775
};
76+
77+
import { Table } from '@mantine/core';
78+
79+
export const SigTable = () => {
80+
const location = useLocation();
81+
return (
82+
<Table highlightOnHover>
83+
{/* Headers */}
84+
<thead>
85+
<tr>
86+
<th>Organization</th>
87+
<th>Member Count</th>
88+
</tr>
89+
</thead>
90+
91+
<tbody>
92+
{OrganizationList.map((org, index) => (
93+
<tr key={index}>
94+
{/* Organization Column */}
95+
<td>
96+
<NavLink
97+
href={`${location.pathname}/${org}`}
98+
label={org}
99+
variant="filled"
100+
active={index % 2 === 0}
101+
/>
102+
</td>
103+
104+
{/* Member Count Column */}
105+
<td style={{ display: 'flex', alignItems: 'center', gap: '8px' }}>
106+
<span>MemberCount[{index}]</span>
107+
<IconUsersGroup />
108+
</td>
109+
</tr>
110+
))}
111+
</tbody>
112+
{/* <tbody>
113+
{OrganizationList.map((org, index) => (
114+
<tr key={index}>
115+
<td>{renderSigLink(org, index)}</td>
116+
</tr>
117+
))}
118+
</tbody> */}
119+
</Table>
120+
);
121+
};
122+
123+
// const navLinks = [
124+
// { label: "Home", icon: <IconHome size={16} />, path: "/" },
125+
// { label: "Profile", icon: <IconUser size={16} />, path: "/profile" },
126+
// { label: "Settings", icon: <IconSettings size={16} />, path: "/settings" },
127+
// ];
128+
129+
// export const NavLinkTable = () => {
130+
// return (
131+
// <Table highlightOnHover>
132+
// <thead>
133+
// <tr>
134+
// <th>Navigation</th>
135+
// </tr>
136+
// </thead>
137+
// <tbody>
138+
// {navLinks.map((link, index) => (
139+
// <tr key={index}>
140+
// <td>
141+
// <NavLink
142+
// label={link.label}
143+
// component={Link} // Integrates with React Router
144+
// to={link.path}
145+
// />
146+
// </td>
147+
// </tr>
148+
// ))}
149+
// </tbody>
150+
// </Table>
151+
// );
152+
// }

0 commit comments

Comments
 (0)