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

Client list UI changes #1688

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from
Draft
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
2 changes: 1 addition & 1 deletion app/javascript/src/common/ChartBar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const GetClientBar = ({ data, totalMinutes }: IChartBarGraph) => {
<section>
<div className="hidden md:block">
<p className="mb-3 text-tiny tracking-widest text-miru-dark-purple-600">
TOTAL HOURS:{" "}
TOTAL HOURS:
<span className="font-medium">{minToHHMM(totalMinutes)}</span>
</p>
<div className="flex h-1 w-full bg-gray-200">
Expand Down
8 changes: 8 additions & 0 deletions app/javascript/src/components/Clients/List/TableData.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,14 @@ const TableData = (
</Tooltip>
),
col2: (
<div
className="total-hours text-left text-sm font-medium text-miru-dark-purple-1000"
id={`${client.id}`}
>
{client.email || "-"}
</div>
),
col3: (
<div
className="total-hours text-right text-xl font-bold text-miru-dark-purple-1000"
id={`${client.id}`}
Expand Down
4 changes: 3 additions & 1 deletion app/javascript/src/components/Clients/List/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,10 @@ const ClientList = ({
}) => {
const { isAdminUser, isDesktop } = useUserContext();

const sortedClientData = clientData.sort((a, b) => b.minutes - a.minutes);

const getTableData = TableData(
clientData,
sortedClientData,
handleTooltip,
showToolTip,
toolTipRef,
Expand Down
11 changes: 8 additions & 3 deletions app/javascript/src/components/Clients/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,17 @@ export const tableHeader = [
{
Header: "CLIENT",
accessor: "col1", // accessor is the "key" in the data
cssClass: "md:w-1/3 capitalize",
cssClass: "md:w-1/4 capitalize",
},
{
Header: "HOURS LOGGED",
Header: "EMAIL ID(s)",
accessor: "col2",
cssClass: "text-right md:w-1/5", // accessor is the "key" in the data
cssClass: "text-left md:w-2/5", // accessor is the "key" in the data
},
{
Header: "HOURS LOGGED",
accessor: "col3",
cssClass: "text-right md:w-1/6", // accessor is the "key" in the data
},
];

Expand Down
Loading