Skip to content

Commit

Permalink
feat: make bars clickable, closes #717
Browse files Browse the repository at this point in the history
  • Loading branch information
felixmosh committed May 1, 2024
1 parent e05fd57 commit 422c0cf
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,23 @@
z-index: 10;
}

.progressBar > div {
.progressBar > .bar {
padding: 0.125rem;
transition: width 0.3s ease-in;
transition: width 0.3s ease-in, opacity 0.2s ease-in-out;

min-width: min-content;
text-decoration: none;
}

.progressBar > div + div {
.progressBar > .bar:visited {
color: inherit;
}

.progressBar > .bar:hover {
opacity: 0.75;
}

.progressBar > .bar + .bar {
border-left: 2px solid #fff;
}

Expand Down
10 changes: 7 additions & 3 deletions packages/ui/src/components/QueueCard/QueueStats/QueueStats.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { AppQueue } from '@bull-board/api/typings/app';
import cn from 'clsx';
import React from 'react';
import { useTranslation } from 'react-i18next';
import { Link } from 'react-router-dom';
import { links } from '../../../utils/links';
import { toCamelCase } from '../../../utils/toCamelCase';
import s from './QueueStats.module.css';

Expand All @@ -21,18 +24,19 @@ export const QueueStats = ({ queue }: IQueueStatsProps) => {
const value = queue.counts[status];

return (
<div
<Link
to={links.queuePage(queue.name, { [queue.name]: status })}
key={status}
role="progressbar"
style={{ width: `${(value / total) * 100}%` }}
aria-valuenow={value}
aria-valuemin={0}
aria-valuemax={total}
className={s[toCamelCase(status)]}
className={cn(s[toCamelCase(status)], s.bar)}
title={t(`QUEUE.STATUS.${status.toUpperCase()}`)}
>
{value}
</div>
</Link>
);
})}
</div>
Expand Down

0 comments on commit 422c0cf

Please sign in to comment.