Merge branch 'develop' into feat/migrate/hardcoded-strings

This commit is contained in:
Aryaman Sharma authored and GitHub committed 2025-03-12 01:17:17 +05:30
commit 529834bcba
14 files changed
+201 -32

No files matched your search

+3 -3
View File
@@ -128,7 +128,7 @@ const Search = ({
<Typography <Typography
component="span" component="span"
className="input-error" className="input-error"
color={theme.palette.error.contrastText} color={theme.palette.error.main}
mt={theme.spacing(2)} mt={theme.spacing(2)}
sx={{ sx={{
opacity: 0.8, opacity: 0.8,
@@ -188,8 +188,8 @@ const Search = ({
color: "red", color: "red",
}, },
"& li.MuiAutocomplete-option:hover:not([aria-selected='true'])": { "& li.MuiAutocomplete-option:hover:not([aria-selected='true'])": {
color: theme.palette.primary.main, color: theme.palette.secondary.contrastText,
backgroundColor: theme.palette.primary.contrastTextSecondary, backgroundColor: theme.palette.secondary.main,
}, },
"& .MuiAutocomplete-noOptions": { "& .MuiAutocomplete-noOptions": {
px: theme.spacing(6), px: theme.spacing(6),
+8 -1
View File
@@ -14,7 +14,14 @@ const Link = ({ level, label, url }) => {
const theme = useTheme(); const theme = useTheme();
const levelConfig = { const levelConfig = {
primary: {}, primary: {
color: theme.palette.primary.contrastTextTertiary,
sx: {
":hover": {
color: theme.palette.primary.contrastTextSecondary,
},
},
},
secondary: { secondary: {
color: theme.palette.primary.contrastTextSecondary, color: theme.palette.primary.contrastTextSecondary,
sx: { sx: {
+3
View File
@@ -17,6 +17,7 @@ import {
} from "@mui/material"; } from "@mui/material";
import ThemeSwitch from "../ThemeSwitch"; import ThemeSwitch from "../ThemeSwitch";
import Avatar from "../Avatar"; import Avatar from "../Avatar";
import StarPrompt from "../StarPrompt";
import LockSvg from "../../assets/icons/lock.svg?react"; import LockSvg from "../../assets/icons/lock.svg?react";
import UserSvg from "../../assets/icons/user.svg?react"; import UserSvg from "../../assets/icons/user.svg?react";
import TeamSvg from "../../assets/icons/user-two.svg?react"; import TeamSvg from "../../assets/icons/user-two.svg?react";
@@ -608,6 +609,8 @@ function Sidebar() {
</List> </List>
</Box> </Box>
{!collapsed && <StarPrompt />}
<List <List
component="nav" component="nav"
disablePadding disablePadding
+101
View File
@@ -0,0 +1,101 @@
import React from 'react';
import { Typography, IconButton, Stack, Box } from '@mui/material';
import CloseIcon from '@mui/icons-material/Close';
import { useTheme } from '@emotion/react';
import { useSelector, useDispatch } from 'react-redux';
import { useTranslation } from 'react-i18next';
import { setStarPromptOpen } from '../../Features/UI/uiSlice';
const StarPrompt = ({
repoUrl = 'https://github.com/bluewave-labs/checkmate'
}) => {
const theme = useTheme();
const dispatch = useDispatch();
const { t } = useTranslation();
const isOpen = useSelector((state) => state.ui?.starPromptOpen ?? true);
const mode = useSelector((state) => state.ui.mode);
const handleClose = () => {
dispatch(setStarPromptOpen(false));
};
const handleStarClick = () => {
window.open(repoUrl, '_blank');
};
if (!isOpen) return null;
return (
<Stack
direction="column"
sx={{
width: '100%',
padding: `${theme.spacing(6)} ${theme.spacing(6)}`,
borderTop: `1px solid ${theme.palette.primary.lowContrast}`,
borderBottom: `1px solid ${theme.palette.primary.lowContrast}`,
borderRadius: 0,
gap: theme.spacing(1.5),
backgroundColor: theme.palette.primary.main,
}}
>
<Stack direction="row" justifyContent="space-between" alignItems="center" width="100%" pl={theme.spacing(4)}>
<Typography
variant="subtitle2"
sx={{
color: mode === 'dark' ? theme.palette.primary.contrastText : theme.palette.text.primary,
mt: theme.spacing(3)
}}
>
{t('starPromptTitle')}
</Typography>
<IconButton
onClick={handleClose}
size="small"
sx={{
color: theme.palette.text.primary,
padding: 0,
marginTop: theme.spacing(-5),
'&:hover': {
backgroundColor: 'transparent',
opacity: 0.8
},
}}
>
<CloseIcon sx={{ fontSize: '1.25rem' }} />
</IconButton>
</Stack>
<Typography
variant="body1"
sx={{
color: theme.palette.text.secondary,
fontSize: '0.938rem',
lineHeight: 1.5,
mb: 1,
px: theme.spacing(4)
}}
>
{t('starPromptDescription')}
</Typography>
<Box
component="img"
src={`https://img.shields.io/github/stars/bluewave-labs/checkmate?label=checkmate&style=social${mode === 'dark' ? '&color=white' : ''}`}
alt="GitHub stars"
onClick={handleStarClick}
sx={{
cursor: 'pointer',
transform: 'scale(0.65)',
transformOrigin: 'left center',
'&:hover': {
opacity: 0.8
},
pl: theme.spacing(4),
filter: mode === 'dark' ? 'invert(1)' : 'none'
}}
/>
</Stack>
);
};
export default StarPrompt;
+51
View File
@@ -0,0 +1,51 @@
.wallet-adapter-dropdown {
width: 100%;
display: flex;
flex-wrap: wrap;
justify-content: center;
align-items: center;
gap: var(--env-var-spacing-1);
}
.wallet-adapter-button {
display: flex;
align-items: center;
justify-content: center;
width: auto;
height: var(--env-var-height-2) !important;
font-size: var(--env-var-font-size-medium-plus) !important;
font-weight: 500 !important;
margin: 0;
padding: calc((var(--env-var-height-2) - var(--env-var-font-size-medium-plus) * 1.2) / 2) var(--env-var-spacing-1);
white-space: nowrap;
}
.wallet-adapter-modal-title {
font-size: var(--font-size-h5) !important;
}
/* Separator styling */
.wallet-adapter-modal-divider {
background-color: var(--border-color) !important;
margin: var(--spacing-md) 0 !important;
}
/* Responsive fixes */
@media (max-width: 1200px) {
.wallet-adapter-button {
font-size: var(--env-var-font-size-medium) !important;
padding: calc((var(--env-var-height-2) - var(--env-var-font-size-medium) * 1.2) / 2)
var(--env-var-spacing-1-minus) !important;
}
}
@media (max-width: 900px) {
.wallet-adapter-modal-wrapper {
flex-direction: column !important;
}
.wallet-adapter-modal-divider {
margin: var(--spacing-sm) 0 !important;
}
}
+1
View File
@@ -9,6 +9,7 @@ import {
import { WalletModalProvider } from "@solana/wallet-adapter-react-ui"; import { WalletModalProvider } from "@solana/wallet-adapter-react-ui";
import { clusterApiUrl } from "@solana/web3.js"; import { clusterApiUrl } from "@solana/web3.js";
import PropTypes from "prop-types"; import PropTypes from "prop-types";
import "./index.css";
// Default styles that can be overridden by your app // Default styles that can be overridden by your app
import "@solana/wallet-adapter-react-ui/styles.css"; import "@solana/wallet-adapter-react-ui/styles.css";
+5
View File
@@ -24,6 +24,7 @@ const initialState = {
timezone: "America/Toronto", timezone: "America/Toronto",
distributedUptimeEnabled: false, distributedUptimeEnabled: false,
language: "gb", language: "gb",
starPromptOpen: true,
}; };
const uiSlice = createSlice({ const uiSlice = createSlice({
@@ -55,6 +56,9 @@ const uiSlice = createSlice({
setLanguage(state, action) { setLanguage(state, action) {
state.language = action.payload; state.language = action.payload;
}, },
setStarPromptOpen: (state, action) => {
state.starPromptOpen = action.payload;
},
}, },
}); });
@@ -67,4 +71,5 @@ export const {
setTimezone, setTimezone,
setDistributedUptimeEnabled, setDistributedUptimeEnabled,
setLanguage, setLanguage,
setStarPromptOpen,
} = uiSlice.actions; } = uiSlice.actions;
@@ -30,7 +30,6 @@ const StatusHeader = ({ monitor, connectionStatus, elementToCapture }) => {
}; };
let bgColor = COLOR_MAP[connectionStatus]; let bgColor = COLOR_MAP[connectionStatus];
return ( return (
<ColContainer backgroundColor={bgColor}> <ColContainer backgroundColor={bgColor}>
<Stack <Stack
@@ -61,7 +60,8 @@ const StatusHeader = ({ monitor, connectionStatus, elementToCapture }) => {
backgroundColor={theme.palette.successSecondary.lowContrast} backgroundColor={theme.palette.successSecondary.lowContrast}
color={theme.palette.success.lowContrast} color={theme.palette.success.lowContrast}
> >
{t("distributedUptimeDetailsStatusHeaderUptime")} {(monitor.totalUptime * 100).toFixed(2)}% {t("distributedUptimeDetailsStatusHeaderUptime")}{" "}
{(monitor.uptimePercentage * 100).toFixed(2)}%
</Typography> </Typography>
</Stack> </Stack>
<Typography <Typography
+2 -1
View File
@@ -298,7 +298,7 @@ const Settings = () => {
{t("settingsWalletDescription")} {t("settingsWalletDescription")}
</Typography> </Typography>
</Box> </Box>
<Box> <Box sx={{ display: 'flex', flexWrap: 'wrap', justifyContent: 'flex-start', gap: 2 }}>
<Stack <Stack
direction="row" direction="row"
spacing={2} spacing={2}
@@ -401,6 +401,7 @@ const Settings = () => {
</ConfigBox> </ConfigBox>
)} )}
<ConfigBox> <ConfigBox>
<Box> <Box>
<Typography component="h1">{t("settingsAbout")}</Typography> <Typography component="h1">{t("settingsAbout")}</Typography>
-2
View File
@@ -24,7 +24,6 @@ const PublicStatus = () => {
const [isDeleteOpen, setIsDeleteOpen] = useState(false); const [isDeleteOpen, setIsDeleteOpen] = useState(false);
// Utils // Utils
const theme = useTheme(); const theme = useTheme();
const isAdmin = useIsAdmin();
const location = useLocation(); const location = useLocation();
const navigate = useNavigate(); const navigate = useNavigate();
@@ -33,7 +32,6 @@ const PublicStatus = () => {
const [deleteStatusPage, isDeleting] = useStatusPageDelete(fetchStatusPage, url); const [deleteStatusPage, isDeleting] = useStatusPageDelete(fetchStatusPage, url);
// Setup // Setup
const currentPath = location.pathname;
let sx = { paddingLeft: theme.spacing(20), paddingRight: theme.spacing(20) }; let sx = { paddingLeft: theme.spacing(20), paddingRight: theme.spacing(20) };
let link = undefined; let link = undefined;
const isPublic = location.pathname.startsWith("/status/uptime/public"); const isPublic = location.pathname.startsWith("/status/uptime/public");
@@ -25,7 +25,7 @@ const StatusPagesTable = ({ data }) => {
row.type === "distributed" row.type === "distributed"
? `/status/distributed/public/${row.url}` ? `/status/distributed/public/${row.url}`
: `/status/uptime/public/${row.url}`; : `/status/uptime/public/${row.url}`;
navigate(url); window.open(url, "_blank", "noopener,noreferrer")
} }
}, },
render: (row) => { render: (row) => {
+1 -1
View File
@@ -332,13 +332,13 @@ const baseTheme = (palette) => ({
color: palette.error.main, color: palette.error.main,
opacity: 0.8, opacity: 0.8,
fontSize: "var(--env-var-font-size-medium)", fontSize: "var(--env-var-font-size-medium)",
marginLeft: 0, marginLeft: 0,
}, },
"& .MuiFormHelperText-root.Mui-error": { "& .MuiFormHelperText-root.Mui-error": {
opacity: 0.8, opacity: 0.8,
fontSize: "var(--env-var-font-size-medium)", fontSize: "var(--env-var-font-size-medium)",
color: palette.error.main, color: palette.error.main,
whiteSpace: 'nowrap',
}, },
}), }),
}, },
+20 -20
View File
@@ -230,37 +230,37 @@
"settingsFailedToAddDemoMonitors": "Failed to add demo monitors", "settingsFailedToAddDemoMonitors": "Failed to add demo monitors",
"settingsMonitorsDeleted": "Successfully deleted all monitors", "settingsMonitorsDeleted": "Successfully deleted all monitors",
"settingsFailedToDeleteMonitors": "Failed to delete all monitors", "settingsFailedToDeleteMonitors": "Failed to delete all monitors",
"starPromptTitle": "Star Checkmate",
"starPromptDescription": "See the latest releases and help grow the community on GitHub",
"notifications": { "notifications": {
"enableNotifications": "Enable {{platform}} notifications", "enableNotifications": "Enable {{platform}} notifications",
"testNotification": "Test notification", "testNotification": "Test notification",
"addOrEditNotifications": "Add or edit notifications", "addOrEditNotifications": "Add or edit notifications",
"slack": { "slack": {
"label": "Slack", "label": "Slack",
"description": "To enable Slack notifications, create a Slack app and enable incoming webhooks. After that, simply provide the webhook URL here.", "description": "To enable Slack notifications, create a Slack app and enable incoming webhooks. After that, simply provide the webhook URL here.",
"webhookLabel": "Webhook URL", "webhookLabel": "Webhook URL",
"webhookPlaceholder": "https://hooks.slack.com/services/..." "webhookPlaceholder": "https://hooks.slack.com/services/..."
}, },
"discord": { "discord": {
"label": "Discord", "label": "Discord",
"description": "To send data to a Discord channel from Checkmate via Discord notifications using webhooks, you can use Discord's incoming Webhooks feature.", "description": "To send data to a Discord channel from Checkmate via Discord notifications using webhooks, you can use Discord's incoming Webhooks feature.",
"webhookLabel": "Discord Webhook URL", "webhookLabel": "Discord Webhook URL",
"webhookPlaceholder": "https://discord.com/api/webhooks/..." "webhookPlaceholder": "https://discord.com/api/webhooks/..."
}, },
"telegram": { "telegram": {
"label": "Telegram", "label": "Telegram",
"description": "To enable Telegram notifications, create a Telegram bot using BotFather, an official bot for creating and managing Telegram bots. Then, get the API token and chat ID and write them down here.", "description": "To enable Telegram notifications, create a Telegram bot using BotFather, an official bot for creating and managing Telegram bots. Then, get the API token and chat ID and write them down here.",
"tokenLabel": "Your bot token", "tokenLabel": "Your bot token",
"tokenPlaceholder": "123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11", "tokenPlaceholder": "123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11",
"chatIdLabel": "Your Chat ID", "chatIdLabel": "Your Chat ID",
"chatIdPlaceholder": "-1001234567890" "chatIdPlaceholder": "-1001234567890"
}, },
"webhook": { "webhook": {
"label": "Webhooks", "label": "Webhooks",
"description": "You can set up a custom webhook to receive notifications when incidents occur.", "description": "You can set up a custom webhook to receive notifications when incidents occur.",
"urlLabel": "Webhook URL", "urlLabel": "Webhook URL",
"urlPlaceholder": "https://your-server.com/webhook" "urlPlaceholder": "https://your-server.com/webhook"
} }
} }
} }
+3 -1
View File
@@ -101,5 +101,7 @@
"settingsDemoMonitorsAdded": "Demo monitörler başarıyla eklendi", "settingsDemoMonitorsAdded": "Demo monitörler başarıyla eklendi",
"settingsFailedToAddDemoMonitors": "Demo monitörler eklenemedi", "settingsFailedToAddDemoMonitors": "Demo monitörler eklenemedi",
"settingsMonitorsDeleted": "Tüm monitörler başarıyla silindi", "settingsMonitorsDeleted": "Tüm monitörler başarıyla silindi",
"settingsFailedToDeleteMonitors": "Monitörler silinemedi" "settingsFailedToDeleteMonitors": "Monitörler silinemedi",
"starPromptTitle": "Checkmate yıldızla değerlendirin",
"starPromptDescription": "En son sürümleri görün ve GitHub'daki topluluğun büyümesine yardımcı olun"
} }