From ba02f8d4a6ef976ec0a7843e7a6222842eafab4a Mon Sep 17 00:00:00 2001 From: ahmad anwar <7552088+AhmedAnwarHafez@users.noreply.github.com> Date: Thu, 2 Jan 2025 18:27:12 +1300 Subject: [PATCH 1/5] feat(OverviewActions): add OverviewActions component with pause and resume functionality; update OverviewPage layout and styles - Introduced a new `OverviewActions` component that provides pause and resume actions for queues. - Updated `OverviewPage` to include the new `OverviewActions` component in the header. - Enhanced CSS for the header layout to improve UI alignment and spacing. - Added new translation keys for pause and resume actions in the localization files. --- .../OverviewActions/OverviewActions.tsx | 37 +++++++++++++++++++ .../OverviewPage/OverviewPage.module.css | 6 +++ .../src/pages/OverviewPage/OverviewPage.tsx | 7 +++- .../ui/src/static/locales/en-US/messages.json | 6 ++- 4 files changed, 53 insertions(+), 3 deletions(-) create mode 100644 packages/ui/src/components/OverviewActions/OverviewActions.tsx diff --git a/packages/ui/src/components/OverviewActions/OverviewActions.tsx b/packages/ui/src/components/OverviewActions/OverviewActions.tsx new file mode 100644 index 000000000..9ed46df8d --- /dev/null +++ b/packages/ui/src/components/OverviewActions/OverviewActions.tsx @@ -0,0 +1,37 @@ +import React from 'react'; +import { Item, Portal, Root, Trigger } from '@radix-ui/react-dropdown-menu'; +import { Button } from '../Button/Button'; +import { DropdownContent } from '../DropdownContent/DropdownContent'; +import { EllipsisVerticalIcon } from '../Icons/EllipsisVertical'; +import { PauseIcon } from '../Icons/Pause'; +import { PlayIcon } from '../Icons/Play'; +import { useTranslation } from 'react-i18next'; + +export const OverviewActions = () => { + const { t } = useTranslation(); + + return ( + + + + + + + + + + {t('QUEUE.ACTIONS.PAUSE_ALL')} + + + + {t('QUEUE.ACTIONS.RESUME_ALL')} + + + + + ); +}; + +export default OverviewActions; diff --git a/packages/ui/src/pages/OverviewPage/OverviewPage.module.css b/packages/ui/src/pages/OverviewPage/OverviewPage.module.css index bac24fe63..2300ac68c 100644 --- a/packages/ui/src/pages/OverviewPage/OverviewPage.module.css +++ b/packages/ui/src/pages/OverviewPage/OverviewPage.module.css @@ -21,3 +21,9 @@ } } } + +.header { + display: flex; + justify-content: space-between; + align-items: center; +} diff --git a/packages/ui/src/pages/OverviewPage/OverviewPage.tsx b/packages/ui/src/pages/OverviewPage/OverviewPage.tsx index 56068b045..620980502 100644 --- a/packages/ui/src/pages/OverviewPage/OverviewPage.tsx +++ b/packages/ui/src/pages/OverviewPage/OverviewPage.tsx @@ -8,6 +8,7 @@ import { useQuery } from '../../hooks/useQuery'; import { useQueues } from '../../hooks/useQueues'; import { links } from '../../utils/links'; import s from './OverviewPage.module.css'; +import OverviewActions from '../../components/OverviewActions/OverviewActions'; export const OverviewPage = () => { const { t } = useTranslation(); @@ -20,8 +21,10 @@ export const OverviewPage = () => { queues?.filter((queue) => !selectedStatus || queue.counts[selectedStatus] > 0) || []; return (
- - +
+ + +
{queuesToView.length > 0 && (