From 4736f4f301b56a11afd4e7daf4558a74533a22b7 Mon Sep 17 00:00:00 2001 From: Skorpios Date: Thu, 6 Mar 2025 17:46:43 -0800 Subject: [PATCH] Got rid of button overrides and made a variant for text button. --- .../NotificationIntegrationModal.jsx | 25 ----------------- src/Utils/Theme/globalTheme.js | 27 +++++++++++++++++++ 2 files changed, 27 insertions(+), 25 deletions(-) diff --git a/src/Components/NotificationIntegrationModal/NotificationIntegrationModal.jsx b/src/Components/NotificationIntegrationModal/NotificationIntegrationModal.jsx index 1392d6edf..8716550f5 100644 --- a/src/Components/NotificationIntegrationModal/NotificationIntegrationModal.jsx +++ b/src/Components/NotificationIntegrationModal/NotificationIntegrationModal.jsx @@ -56,27 +56,6 @@ const NotificationIntegrationModal = ({ webhook: monitor?.notifications?.some(n => n.type === "webhook") || false, webhookUrl: monitor?.notifications?.find(n => n.type === "webhook")?.url || "", }); - - const testNotificationButtonStyle = { - textDecoration: 'underline', - color: '#344054', - textTransform: 'none', - padding: '0 !important', - margin: 0, - fontSize: '0.9rem', - fontWeight: 'normal', - backgroundColor: 'transparent !important', - '&:hover': { - backgroundColor: 'transparent !important', - textDecoration: 'underline' - }, - '&.Mui-disabled': { - backgroundColor: 'transparent !important' - }, - minWidth: '0 !important', - boxShadow: 'none !important', - border: 'none !important' - }; const handleChangeTab = (event, newValue) => { setTabValue(newValue); @@ -226,7 +205,6 @@ const NotificationIntegrationModal = ({ color="info" onClick={() => handleTestNotification('slack')} disabled={!integrations.slack || !integrations.slackWebhook} - sx={testNotificationButtonStyle} > Test notification @@ -267,7 +245,6 @@ const NotificationIntegrationModal = ({ color="info" onClick={() => handleTestNotification('discord')} disabled={!integrations.discord || !integrations.discordWebhook} - sx={testNotificationButtonStyle} > Test notification @@ -320,7 +297,6 @@ const NotificationIntegrationModal = ({ color="info" onClick={() => handleTestNotification('telegram')} disabled={!integrations.telegram || !integrations.telegramToken || !integrations.telegramChatId} - sx={testNotificationButtonStyle} > Test notification @@ -361,7 +337,6 @@ const NotificationIntegrationModal = ({ color="info" onClick={() => handleTestNotification('webhook')} disabled={!integrations.webhook || !integrations.webhookUrl} - sx={testNotificationButtonStyle} > Test notification diff --git a/src/Utils/Theme/globalTheme.js b/src/Utils/Theme/globalTheme.js index 7f347d29f..89ad85c2b 100644 --- a/src/Utils/Theme/globalTheme.js +++ b/src/Utils/Theme/globalTheme.js @@ -117,6 +117,33 @@ const baseTheme = (palette) => ({ color: `${theme.palette.secondary.contrastText} !important`, }, }, + + { + props: { variant: 'text', color: 'info' }, + style: { + textDecoration: 'underline', + color: '#344054', + padding: 0, + margin: 0, + fontSize: '0.9rem', + fontWeight: 'normal', + backgroundColor: 'transparent', + '&:hover': { + backgroundColor: 'transparent', + textDecoration: 'underline' + }, + "&.Mui-disabled": { + backgroundColor: theme.palette.secondary.main, + color: theme.palette.primary.contrastText, + "&.MuiButton-text": { + backgroundColor: 'transparent' + } + }, + minWidth: 0, + boxShadow: 'none', + border: 'none' + }, + }, ], height: 34, fontWeight: 400,