From 14b4c5bb019a90a60344b6dd21cc7b82a48d3b4d Mon Sep 17 00:00:00 2001 From: Nevo David Date: Wed, 30 Jul 2025 11:22:18 +0700 Subject: [PATCH] feat: copy channel id --- .../src/components/launches/menu/menu.tsx | 55 ++++++++++++++++++- .../translation/locales/en/translation.json | 1 + 2 files changed, 53 insertions(+), 3 deletions(-) diff --git a/apps/frontend/src/components/launches/menu/menu.tsx b/apps/frontend/src/components/launches/menu/menu.tsx index 85ad5935..202a5a2d 100644 --- a/apps/frontend/src/components/launches/menu/menu.tsx +++ b/apps/frontend/src/components/launches/menu/menu.tsx @@ -27,6 +27,8 @@ import { useT } from '@gitroom/react/translation/get.transation.service.client'; import { AddEditModal } from '@gitroom/frontend/components/new-launch/add.edit.modal'; import dayjs from 'dayjs'; import { ModalWrapperComponent } from '@gitroom/frontend/components/new-launch/modal.wrapper.component'; +import copy from 'copy-to-clipboard'; + export const Menu: FC<{ canEnable: boolean; canDisable: boolean; @@ -151,6 +153,16 @@ export const Menu: FC<{ setShow(false); }, [integrations]); + const copyChannelId = useCallback( + (integration: Integrations) => async () => { + setShow(false); + const channelId = integration.id; + copy(channelId); + toast.show(`Channel ID ${channelId} copied to clipboard`, 'success'); + }, + [] + ); + const createPost = useCallback( (integration: Integrations) => async () => { setShow(false); @@ -327,6 +339,34 @@ export const Menu: FC<{ )} +
+
+ + + + + +
+
{t('copy_id', 'Copy Channel ID')}
+
{canDisable && findIntegration?.refreshNeeded && !findIntegration.customFields && ( @@ -431,7 +471,10 @@ export const Menu: FC<{ )} -
+
-
+
)} -
+