From db7ac7d4072e539944b7862f9cabe8bdb4fd3adc Mon Sep 17 00:00:00 2001 From: harshit078 Date: Thu, 7 Nov 2024 17:13:37 +0530 Subject: [PATCH] fixed dropdown --- .../SettingsDevelopersWebhookDetail.tsx | 22 +++++++++++++------ 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/packages/twenty-front/src/pages/settings/developers/webhooks/components/SettingsDevelopersWebhookDetail.tsx b/packages/twenty-front/src/pages/settings/developers/webhooks/components/SettingsDevelopersWebhookDetail.tsx index e5655ad5e574..c60f4e82387f 100644 --- a/packages/twenty-front/src/pages/settings/developers/webhooks/components/SettingsDevelopersWebhookDetail.tsx +++ b/packages/twenty-front/src/pages/settings/developers/webhooks/components/SettingsDevelopersWebhookDetail.tsx @@ -37,13 +37,19 @@ import { useIsFeatureEnabled } from '@/workspace/hooks/useIsFeatureEnabled'; import { useRecoilValue } from 'recoil'; import { WEBHOOK_EMPTY_OPERATION } from '~/pages/settings/developers/webhooks/constants/WebhookEmptyOperation'; import { WebhookOperationType } from '~/pages/settings/developers/webhooks/types/WebhookOperationsType'; +import { useIsMobile } from '@/ui/utilities/responsive/hooks/useIsMobile'; const OBJECT_DROPDOWN_WIDTH = 340; const ACTION_DROPDOWN_WIDTH = 140; +const OBJECT_Mobile_WIDTH = 150; +const ACTION_Mobile_WIDTH = 140; -const StyledFilterRow = styled.div` +const StyledFilterRow = styled.div<{ isMobile: boolean }>` display: grid; - grid-template-columns: ${OBJECT_DROPDOWN_WIDTH}px ${ACTION_DROPDOWN_WIDTH}px auto; + grid-template-columns: ${({ isMobile }) => + isMobile + ? `${OBJECT_Mobile_WIDTH}px ${ACTION_Mobile_WIDTH}px auto` + : `${OBJECT_DROPDOWN_WIDTH}px ${ACTION_DROPDOWN_WIDTH}px auto`}; gap: ${({ theme }) => theme.spacing(2)}; margin-bottom: ${({ theme }) => theme.spacing(2)}; align-items: center; @@ -57,7 +63,7 @@ const StyledPlaceholder = styled.div` export const SettingsDevelopersWebhooksDetail = () => { const { objectMetadataItems } = useObjectMetadataItems(); const isAnalyticsEnabled = useRecoilValue(isAnalyticsEnabledState); - + const isMobile = useIsMobile(); const navigate = useNavigate(); const { webhookId = '' } = useParams(); @@ -244,10 +250,12 @@ export const SettingsDevelopersWebhooksDetail = () => { description="Select the events you wish to send to this endpoint" /> {operations.map((operation, index) => ( - + updateOperation(index, 'action', action)} @@ -311,4 +319,4 @@ export const SettingsDevelopersWebhooksDetail = () => { ); -}; +}; \ No newline at end of file