fix: removing code duplication
This commit is contained in:
1 parent
2e869310b8
commit
0e8a71c760
1 file changed
+3
-20
@@ -74,30 +74,13 @@ const MonitorDetailsControlHeader = ({
|
|||||||
: ""
|
: ""
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
{isTestNotificationsDisabled ? (
|
<span>
|
||||||
<span>
|
|
||||||
<Button
|
|
||||||
variant="contained"
|
|
||||||
color="secondary"
|
|
||||||
loading={isSending}
|
|
||||||
startIcon={<EmailIcon />}
|
|
||||||
disabled
|
|
||||||
onClick={() => {
|
|
||||||
testAllNotifications({ monitorId: monitor?._id });
|
|
||||||
}}
|
|
||||||
sx={{
|
|
||||||
whiteSpace: "nowrap",
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{t("sendTestNotifications")}
|
|
||||||
</Button>
|
|
||||||
</span>
|
|
||||||
) : (
|
|
||||||
<Button
|
<Button
|
||||||
variant="contained"
|
variant="contained"
|
||||||
color="secondary"
|
color="secondary"
|
||||||
loading={isSending}
|
loading={isSending}
|
||||||
startIcon={<EmailIcon />}
|
startIcon={<EmailIcon />}
|
||||||
|
disabled={isTestNotificationsDisabled}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
testAllNotifications({ monitorId: monitor?._id });
|
testAllNotifications({ monitorId: monitor?._id });
|
||||||
}}
|
}}
|
||||||
@@ -107,7 +90,7 @@ const MonitorDetailsControlHeader = ({
|
|||||||
>
|
>
|
||||||
{t("sendTestNotifications")}
|
{t("sendTestNotifications")}
|
||||||
</Button>
|
</Button>
|
||||||
)}
|
</span>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
<Button
|
<Button
|
||||||
variant="contained"
|
variant="contained"
|
||||||
|
|||||||
Reference in new issue
Block a user