Merge pull request #770 from bluewave-labs/feat/theme-button-styles
Feat/theme button styles
This commit is contained in:
38 files changed
+614
-791
No files matched your search
@@ -1,12 +1,11 @@
|
|||||||
import PropTypes from "prop-types";
|
import PropTypes from "prop-types";
|
||||||
import { useTheme } from "@emotion/react";
|
import { useTheme } from "@emotion/react";
|
||||||
import { Box, IconButton, Stack, Typography } from "@mui/material";
|
import { Box, Button, IconButton, Stack, Typography } from "@mui/material";
|
||||||
import InfoOutlinedIcon from "@mui/icons-material/InfoOutlined";
|
import InfoOutlinedIcon from "@mui/icons-material/InfoOutlined";
|
||||||
import ErrorOutlineOutlinedIcon from "@mui/icons-material/ErrorOutlineOutlined";
|
import ErrorOutlineOutlinedIcon from "@mui/icons-material/ErrorOutlineOutlined";
|
||||||
import WarningAmberOutlinedIcon from "@mui/icons-material/WarningAmberOutlined";
|
import WarningAmberOutlinedIcon from "@mui/icons-material/WarningAmberOutlined";
|
||||||
import CloseIcon from "@mui/icons-material/Close";
|
import CloseIcon from "@mui/icons-material/Close";
|
||||||
import "./index.css";
|
import "./index.css";
|
||||||
import Button from "../Button";
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Icons mapping for different alert variants.
|
* Icons mapping for different alert variants.
|
||||||
@@ -65,8 +64,8 @@ const Alert = ({ variant, title, body, isToast, hasIcon = true, onClick }) => {
|
|||||||
)}
|
)}
|
||||||
{hasIcon && isToast && (
|
{hasIcon && isToast && (
|
||||||
<Button
|
<Button
|
||||||
level="tertiary"
|
variant="text"
|
||||||
label="Dismiss"
|
color="info"
|
||||||
onClick={onClick}
|
onClick={onClick}
|
||||||
sx={{
|
sx={{
|
||||||
fontWeight: "600",
|
fontWeight: "600",
|
||||||
@@ -74,15 +73,10 @@ const Alert = ({ variant, title, body, isToast, hasIcon = true, onClick }) => {
|
|||||||
mt: theme.spacing(4),
|
mt: theme.spacing(4),
|
||||||
padding: 0,
|
padding: 0,
|
||||||
minWidth: 0,
|
minWidth: 0,
|
||||||
"&:hover": {
|
|
||||||
backgroundColor: "transparent",
|
|
||||||
},
|
|
||||||
"& .MuiTouchRipple-root": {
|
|
||||||
pointerEvents: "none",
|
|
||||||
display: "none",
|
|
||||||
},
|
|
||||||
}}
|
}}
|
||||||
></Button>
|
>
|
||||||
|
Dismiss
|
||||||
|
</Button>
|
||||||
)}
|
)}
|
||||||
</Stack>
|
</Stack>
|
||||||
{isToast && (
|
{isToast && (
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import {
|
|||||||
Box,
|
Box,
|
||||||
Typography,
|
Typography,
|
||||||
Stack,
|
Stack,
|
||||||
|
Button,
|
||||||
} from "@mui/material";
|
} from "@mui/material";
|
||||||
import { useDispatch, useSelector } from "react-redux";
|
import { useDispatch, useSelector } from "react-redux";
|
||||||
import { setRowsPerPage } from "../../Features/UI/uiSlice";
|
import { setRowsPerPage } from "../../Features/UI/uiSlice";
|
||||||
@@ -21,7 +22,6 @@ import RightArrowDouble from "../../assets/icons/right-arrow-double.svg?react";
|
|||||||
import LeftArrow from "../../assets/icons/left-arrow.svg?react";
|
import LeftArrow from "../../assets/icons/left-arrow.svg?react";
|
||||||
import RightArrow from "../../assets/icons/right-arrow.svg?react";
|
import RightArrow from "../../assets/icons/right-arrow.svg?react";
|
||||||
import SelectorVertical from "../../assets/icons/selector-vertical.svg?react";
|
import SelectorVertical from "../../assets/icons/selector-vertical.svg?react";
|
||||||
import Button from "../Button";
|
|
||||||
import "./index.css";
|
import "./index.css";
|
||||||
/**
|
/**
|
||||||
* Component for pagination actions (first, previous, next, last).
|
* Component for pagination actions (first, previous, next, last).
|
||||||
@@ -54,37 +54,37 @@ const TablePaginationActions = (props) => {
|
|||||||
return (
|
return (
|
||||||
<Box sx={{ flexShrink: 0, ml: "24px" }}>
|
<Box sx={{ flexShrink: 0, ml: "24px" }}>
|
||||||
<Button
|
<Button
|
||||||
level="secondary"
|
variant="group"
|
||||||
label=""
|
|
||||||
img={<LeftArrowDouble />}
|
|
||||||
onClick={handleFirstPageButtonClick}
|
onClick={handleFirstPageButtonClick}
|
||||||
disabled={page === 0}
|
disabled={page === 0}
|
||||||
aria-label="first page"
|
aria-label="first page"
|
||||||
/>
|
>
|
||||||
|
<LeftArrowDouble />
|
||||||
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
level="secondary"
|
variant="group"
|
||||||
label=""
|
|
||||||
img={<LeftArrow />}
|
|
||||||
onClick={handleBackButtonClick}
|
onClick={handleBackButtonClick}
|
||||||
disabled={page === 0}
|
disabled={page === 0}
|
||||||
aria-label="previous page"
|
aria-label="previous page"
|
||||||
/>
|
>
|
||||||
|
<LeftArrow />
|
||||||
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
level="secondary"
|
variant="group"
|
||||||
label=""
|
|
||||||
img={<RightArrow />}
|
|
||||||
onClick={handleNextButtonClick}
|
onClick={handleNextButtonClick}
|
||||||
disabled={page >= Math.ceil(count / rowsPerPage) - 1}
|
disabled={page >= Math.ceil(count / rowsPerPage) - 1}
|
||||||
aria-label="next page"
|
aria-label="next page"
|
||||||
/>
|
>
|
||||||
|
<RightArrow />
|
||||||
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
level="secondary"
|
variant="group"
|
||||||
label=""
|
|
||||||
img={<RightArrowDouble />}
|
|
||||||
onClick={handleLastPageButtonClick}
|
onClick={handleLastPageButtonClick}
|
||||||
disabled={page >= Math.ceil(count / rowsPerPage) - 1}
|
disabled={page >= Math.ceil(count / rowsPerPage) - 1}
|
||||||
aria-label="last page"
|
aria-label="last page"
|
||||||
/>
|
>
|
||||||
|
<RightArrowDouble />
|
||||||
|
</Button>
|
||||||
</Box>
|
</Box>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
@@ -293,19 +293,10 @@ const BasicTable = ({ data, paginated, reversed, table }) => {
|
|||||||
sx={{
|
sx={{
|
||||||
mt: theme.spacing(6),
|
mt: theme.spacing(6),
|
||||||
color: theme.palette.text.secondary,
|
color: theme.palette.text.secondary,
|
||||||
"& button.MuiButtonBase-root, & .MuiSelect-select": {
|
|
||||||
border: 1,
|
|
||||||
borderColor: theme.palette.border.light,
|
|
||||||
borderRadius: theme.shape.borderRadius,
|
|
||||||
},
|
|
||||||
"& svg path": {
|
"& svg path": {
|
||||||
stroke: theme.palette.text.tertiary,
|
stroke: theme.palette.text.tertiary,
|
||||||
strokeWidth: 1.3,
|
strokeWidth: 1.3,
|
||||||
},
|
},
|
||||||
"& button:not(.Mui-disabled):hover": {
|
|
||||||
backgroundColor: theme.palette.background.fill,
|
|
||||||
borderColor: theme.palette.background.fill,
|
|
||||||
},
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</Stack>
|
</Stack>
|
||||||
|
|||||||
@@ -1,33 +0,0 @@
|
|||||||
.MuiButtonBase-root.button-rotate90 svg {
|
|
||||||
transition: transform 500ms ease;
|
|
||||||
}
|
|
||||||
.MuiButtonBase-root.button-rotate90:hover svg {
|
|
||||||
transform: rotate(90deg);
|
|
||||||
transform-origin: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.MuiButtonBase-root.button-rotate180 svg {
|
|
||||||
transition: transform 700ms ease;
|
|
||||||
}
|
|
||||||
.MuiButtonBase-root.button-rotate180:hover svg {
|
|
||||||
transform: rotate(180deg);
|
|
||||||
transform-origin: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.MuiButtonBase-root.button-slideLeft {
|
|
||||||
padding-left: 45px;
|
|
||||||
}
|
|
||||||
.MuiButtonBase-root.button-slideLeft svg {
|
|
||||||
position: absolute;
|
|
||||||
left: 15px;
|
|
||||||
transition: left 250ms cubic-bezier(0.65, 0, 0.076, 1);
|
|
||||||
}
|
|
||||||
.MuiButtonBase-root.button-slideLeft:hover svg {
|
|
||||||
left: 11px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.MuiButtonBase-root.button-slideLeft:hover,
|
|
||||||
.MuiButtonBase-root.button-rotate180:hover,
|
|
||||||
.MuiButtonBase-root.button-rotate90:hover {
|
|
||||||
background-color: rgba(71, 84, 103, 0.08);
|
|
||||||
}
|
|
||||||
@@ -1,108 +0,0 @@
|
|||||||
import { Button as MuiButton } from "@mui/material";
|
|
||||||
import PropTypes from "prop-types";
|
|
||||||
import "./index.css";
|
|
||||||
|
|
||||||
const levelConfig = {
|
|
||||||
primary: {
|
|
||||||
variant: "contained",
|
|
||||||
color: "primary",
|
|
||||||
},
|
|
||||||
secondary: {
|
|
||||||
variant: "outlined",
|
|
||||||
color: "secondary",
|
|
||||||
},
|
|
||||||
tertiary: {
|
|
||||||
variant: "text",
|
|
||||||
color: "tertiary",
|
|
||||||
},
|
|
||||||
error: {
|
|
||||||
variant: "contained",
|
|
||||||
color: "error",
|
|
||||||
},
|
|
||||||
imagePrimary: {
|
|
||||||
color: "primary",
|
|
||||||
variant: "text",
|
|
||||||
},
|
|
||||||
imageSecondary: {
|
|
||||||
color: "secondary",
|
|
||||||
variant: "text",
|
|
||||||
},
|
|
||||||
imageTertiary: {
|
|
||||||
color: "tertiary",
|
|
||||||
variant: "text",
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @component
|
|
||||||
* @param {Object} props
|
|
||||||
* @param {'primary' | 'secondary' | 'tertiary' | 'error' | 'imagePrimary' | 'imageSecondary' | 'imageTertiary'} props.level - The level of the button
|
|
||||||
* @param {string} props.type - The type of the button
|
|
||||||
* @param {string} props.label - The label of the button
|
|
||||||
* @param {React.ReactNode} props.img - Image for button
|
|
||||||
* @param {boolean} [props.disabled] - Whether the button is disabled
|
|
||||||
* @param {function} props.onClick - Function to run when the button is clicked
|
|
||||||
* @param {Object} props.sx - Styles for the button
|
|
||||||
* @returns {JSX.Element}
|
|
||||||
* @example
|
|
||||||
* // Render an error button
|
|
||||||
* <Button type="submit" level="error" label="Error" disabled sx={{marginTop: "1rem"}}/>
|
|
||||||
*/
|
|
||||||
|
|
||||||
const Button = ({
|
|
||||||
id,
|
|
||||||
animate,
|
|
||||||
type,
|
|
||||||
level,
|
|
||||||
label,
|
|
||||||
disabled,
|
|
||||||
img,
|
|
||||||
onClick,
|
|
||||||
props,
|
|
||||||
sx,
|
|
||||||
}) => {
|
|
||||||
const { variant, color } = levelConfig[level];
|
|
||||||
return (
|
|
||||||
<MuiButton
|
|
||||||
id={id}
|
|
||||||
className={`button-${animate}`}
|
|
||||||
type={type}
|
|
||||||
variant={variant}
|
|
||||||
color={color}
|
|
||||||
disabled={disabled}
|
|
||||||
onClick={onClick}
|
|
||||||
disableRipple
|
|
||||||
sx={{
|
|
||||||
lineHeight: 1.5,
|
|
||||||
fontWeight: 400,
|
|
||||||
boxShadow: "none",
|
|
||||||
textTransform: "none",
|
|
||||||
borderRadius: "4px",
|
|
||||||
"&:focus": {
|
|
||||||
outline: "none",
|
|
||||||
},
|
|
||||||
"&:hover": {
|
|
||||||
boxShadow: "none",
|
|
||||||
},
|
|
||||||
...sx,
|
|
||||||
}}
|
|
||||||
{...props}
|
|
||||||
>
|
|
||||||
{img && img}
|
|
||||||
<span>{label}</span>
|
|
||||||
</MuiButton>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
Button.propTypes = {
|
|
||||||
id: PropTypes.string,
|
|
||||||
type: PropTypes.string,
|
|
||||||
level: PropTypes.string.isRequired,
|
|
||||||
label: PropTypes.string.isRequired,
|
|
||||||
img: PropTypes.node,
|
|
||||||
onClick: PropTypes.func,
|
|
||||||
sx: PropTypes.object,
|
|
||||||
disabled: PropTypes.bool,
|
|
||||||
};
|
|
||||||
|
|
||||||
export default Button;
|
|
||||||
@@ -1,105 +0,0 @@
|
|||||||
import LoadingButton from "@mui/lab/LoadingButton";
|
|
||||||
import PropTypes from "prop-types";
|
|
||||||
|
|
||||||
const levelConfig = {
|
|
||||||
primary: {
|
|
||||||
variant: "contained",
|
|
||||||
color: "primary",
|
|
||||||
},
|
|
||||||
secondary: {
|
|
||||||
variant: "outlined",
|
|
||||||
color: "secondary",
|
|
||||||
},
|
|
||||||
tertiary: {
|
|
||||||
variant: "text",
|
|
||||||
color: "tertiary",
|
|
||||||
},
|
|
||||||
error: {
|
|
||||||
variant: "contained",
|
|
||||||
color: "error",
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @component
|
|
||||||
* @param {Object} props
|
|
||||||
* @param {'primary' | 'secondary' | 'tertiary' | 'error'} props.level - The style level of the button.
|
|
||||||
* @param {string} props.label - The label text displayed on the button.
|
|
||||||
* @param {React.ReactNode} [props.img] - Icon or image element to display within the button.
|
|
||||||
* @param {boolean} [props.disabled=false] - Determines if the button is disabled.
|
|
||||||
* @param {string} [props.loadingText] - Text displayed when the button is in a loading state.
|
|
||||||
* @param {'start' | 'end'} [props.position] - Specifies where the icon or loading loadingText should be positioned relative to the label.
|
|
||||||
* @param {function} props.onClick - Callback function invoked when the button is clicked.
|
|
||||||
* @param {boolean} props.isLoading - Indicates if the button is in a loading state.
|
|
||||||
* @param {Object} [props.sx] - Additional styles to apply to the button.
|
|
||||||
* @returns {JSX.Element}
|
|
||||||
* @example
|
|
||||||
* // Render a primary button with an icon at the end
|
|
||||||
* <ButtonSpinner
|
|
||||||
* level="primary"
|
|
||||||
* label="Save"
|
|
||||||
* img={<SaveIcon />}
|
|
||||||
* position="end"
|
|
||||||
* onClick={handleSaveClick}
|
|
||||||
* isLoading={loading}
|
|
||||||
* />
|
|
||||||
*/
|
|
||||||
|
|
||||||
const ButtonSpinner = ({
|
|
||||||
level,
|
|
||||||
label,
|
|
||||||
disabled,
|
|
||||||
loadingText,
|
|
||||||
position,
|
|
||||||
img,
|
|
||||||
onClick,
|
|
||||||
isLoading,
|
|
||||||
sx,
|
|
||||||
}) => {
|
|
||||||
const { variant, color } = levelConfig[level];
|
|
||||||
//if both a loadingPosition and loadingIndicator are provided, the spinner overlaps with the text and it breaks
|
|
||||||
if (position && loadingText) loadingText = null;
|
|
||||||
return (
|
|
||||||
<LoadingButton
|
|
||||||
variant={variant}
|
|
||||||
color={color}
|
|
||||||
disabled={disabled}
|
|
||||||
loadingIndicator={loadingText}
|
|
||||||
loadingPosition={position}
|
|
||||||
startIcon={position === "start" && img}
|
|
||||||
endIcon={position === "end" && img}
|
|
||||||
onClick={onClick}
|
|
||||||
loading={isLoading}
|
|
||||||
disableRipple
|
|
||||||
sx={{
|
|
||||||
boxShadow: "none",
|
|
||||||
textTransform: "none",
|
|
||||||
borderRadius: "4px",
|
|
||||||
"&:focus": {
|
|
||||||
outline: "none",
|
|
||||||
},
|
|
||||||
"&:hover": {
|
|
||||||
boxShadow: "none",
|
|
||||||
transition: "none",
|
|
||||||
},
|
|
||||||
...sx,
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<span>{label}</span>
|
|
||||||
</LoadingButton>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
ButtonSpinner.propTypes = {
|
|
||||||
level: PropTypes.string.isRequired,
|
|
||||||
label: PropTypes.string.isRequired,
|
|
||||||
loadingText: PropTypes.string,
|
|
||||||
position: PropTypes.oneOf(["start", "end"]),
|
|
||||||
img: PropTypes.node,
|
|
||||||
onClick: PropTypes.func.isRequired,
|
|
||||||
isLoading: PropTypes.bool.isRequired,
|
|
||||||
sx: PropTypes.object,
|
|
||||||
disabled: PropTypes.bool,
|
|
||||||
};
|
|
||||||
|
|
||||||
export default ButtonSpinner;
|
|
||||||
@@ -22,7 +22,7 @@ const CustomToolTip = ({ active, payload, label }) => {
|
|||||||
>
|
>
|
||||||
<Typography
|
<Typography
|
||||||
sx={{
|
sx={{
|
||||||
color: theme.palette.common.main,
|
color: theme.palette.primary.main,
|
||||||
fontSize: 13,
|
fontSize: 13,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
import PropTypes from "prop-types";
|
import PropTypes from "prop-types";
|
||||||
import { useTheme } from "@emotion/react";
|
import { useTheme } from "@emotion/react";
|
||||||
import { Box, Stack, Typography } from "@mui/material";
|
import { Box, Button, Stack, Typography } from "@mui/material";
|
||||||
import Skeleton from "../../assets/Images/create-placeholder.svg?react";
|
import Skeleton from "../../assets/Images/create-placeholder.svg?react";
|
||||||
import SkeletonDark from "../../assets/Images/create-placeholder-dark.svg?react";
|
import SkeletonDark from "../../assets/Images/create-placeholder-dark.svg?react";
|
||||||
import Background from "../../assets/Images/background-grid.svg?react";
|
import Background from "../../assets/Images/background-grid.svg?react";
|
||||||
import Button from "../Button";
|
|
||||||
import Check from "../Check/Check";
|
import Check from "../Check/Check";
|
||||||
import { useNavigate } from "react-router-dom";
|
import { useNavigate } from "react-router-dom";
|
||||||
import { useSelector } from "react-redux";
|
import { useSelector } from "react-redux";
|
||||||
@@ -66,11 +65,13 @@ const Fallback = ({ title, checks, link = "/", isAdmin }) => {
|
|||||||
{/* TODO - display a different fallback if user is not an admin*/}
|
{/* TODO - display a different fallback if user is not an admin*/}
|
||||||
{isAdmin && (
|
{isAdmin && (
|
||||||
<Button
|
<Button
|
||||||
level="primary"
|
variant="contained"
|
||||||
label={`Let's create your ${title}`}
|
color="primary"
|
||||||
sx={{ alignSelf: "center" }}
|
sx={{ alignSelf: "center" }}
|
||||||
onClick={() => navigate(link)}
|
onClick={() => navigate(link)}
|
||||||
/>
|
>
|
||||||
|
Let's create your {title}
|
||||||
|
</Button>
|
||||||
)}
|
)}
|
||||||
</Stack>
|
</Stack>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -38,12 +38,12 @@ const ImageField = ({ id, src, loading, onChange }) => {
|
|||||||
border: "dashed",
|
border: "dashed",
|
||||||
borderRadius: theme.shape.borderRadius,
|
borderRadius: theme.shape.borderRadius,
|
||||||
borderColor: isDragging
|
borderColor: isDragging
|
||||||
? theme.palette.common.main
|
? theme.palette.primary.main
|
||||||
: theme.palette.border.light,
|
: theme.palette.border.light,
|
||||||
borderWidth: "2px",
|
borderWidth: "2px",
|
||||||
transition: "0.2s",
|
transition: "0.2s",
|
||||||
"&:hover": {
|
"&:hover": {
|
||||||
borderColor: theme.palette.common.main,
|
borderColor: theme.palette.primary.main,
|
||||||
backgroundColor: "hsl(215, 87%, 51%, 0.05)",
|
backgroundColor: "hsl(215, 87%, 51%, 0.05)",
|
||||||
},
|
},
|
||||||
}}
|
}}
|
||||||
@@ -96,7 +96,7 @@ const ImageField = ({ id, src, loading, onChange }) => {
|
|||||||
<Typography
|
<Typography
|
||||||
component="span"
|
component="span"
|
||||||
fontSize="inherit"
|
fontSize="inherit"
|
||||||
color={theme.palette.common.main}
|
color={theme.palette.primary.main}
|
||||||
fontWeight={500}
|
fontWeight={500}
|
||||||
>
|
>
|
||||||
Click to upload
|
Click to upload
|
||||||
|
|||||||
@@ -28,11 +28,11 @@ const Link = ({ level, label, url }) => {
|
|||||||
sx: {
|
sx: {
|
||||||
textDecoration: "underline",
|
textDecoration: "underline",
|
||||||
textDecorationStyle: "dashed",
|
textDecorationStyle: "dashed",
|
||||||
textDecorationColor: theme.palette.common.main,
|
textDecorationColor: theme.palette.primary.main,
|
||||||
textUnderlineOffset: "1px",
|
textUnderlineOffset: "1px",
|
||||||
":hover": {
|
":hover": {
|
||||||
color: theme.palette.text.tertiary,
|
color: theme.palette.text.tertiary,
|
||||||
textDecorationColor: theme.palette.common.main,
|
textDecorationColor: theme.palette.primary.main,
|
||||||
backgroundColor: theme.palette.background.fill,
|
backgroundColor: theme.palette.background.fill,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ aside.collapsed .MuiAvatar-root + .MuiBox-root + .MuiIconButton-root {
|
|||||||
}
|
}
|
||||||
|
|
||||||
aside .MuiListSubheader-root {
|
aside .MuiListSubheader-root {
|
||||||
transition: all 200ms ease;
|
transition: padding 200ms ease;
|
||||||
}
|
}
|
||||||
|
|
||||||
@keyframes fadeIn {
|
@keyframes fadeIn {
|
||||||
|
|||||||
@@ -154,7 +154,7 @@ function Sidebar() {
|
|||||||
color="white"
|
color="white"
|
||||||
sx={{
|
sx={{
|
||||||
position: "relative",
|
position: "relative",
|
||||||
backgroundColor: theme.palette.common.main,
|
backgroundColor: theme.palette.primary.main,
|
||||||
borderRadius: theme.shape.borderRadius,
|
borderRadius: theme.shape.borderRadius,
|
||||||
userSelect: "none",
|
userSelect: "none",
|
||||||
}}
|
}}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import TabPanel from "@mui/lab/TabPanel";
|
|||||||
import React, { useState } from "react";
|
import React, { useState } from "react";
|
||||||
import { useTheme } from "@emotion/react";
|
import { useTheme } from "@emotion/react";
|
||||||
import { Box, Stack, Typography } from "@mui/material";
|
import { Box, Stack, Typography } from "@mui/material";
|
||||||
import ButtonSpinner from "../../ButtonSpinner";
|
import LoadingButton from "@mui/lab/LoadingButton";
|
||||||
import Field from "../../Inputs/Field";
|
import Field from "../../Inputs/Field";
|
||||||
import { credentials } from "../../../Validation/validation";
|
import { credentials } from "../../../Validation/validation";
|
||||||
import Alert from "../../Alert";
|
import Alert from "../../Alert";
|
||||||
@@ -164,19 +164,20 @@ const PasswordPanel = () => {
|
|||||||
</Box>
|
</Box>
|
||||||
</Stack>
|
</Stack>
|
||||||
<Stack direction="row" justifyContent="flex-end">
|
<Stack direction="row" justifyContent="flex-end">
|
||||||
<ButtonSpinner
|
<LoadingButton
|
||||||
level="primary"
|
variant="contained"
|
||||||
label="Save"
|
color="primary"
|
||||||
onClick={handleSubmit}
|
onClick={handleSubmit}
|
||||||
isLoading={isLoading}
|
loading={isLoading}
|
||||||
loadingText="Saving..."
|
loadingIndicator="Saving..."
|
||||||
disabled={Object.keys(errors).length !== 0 && true}
|
disabled={Object.keys(errors).length !== 0 && true}
|
||||||
sx={{
|
sx={{
|
||||||
paddingX: theme.spacing(12),
|
px: theme.spacing(12),
|
||||||
width: "fit-content",
|
|
||||||
mt: theme.spacing(20),
|
mt: theme.spacing(20),
|
||||||
}}
|
}}
|
||||||
/>
|
>
|
||||||
|
Save
|
||||||
|
</LoadingButton>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Stack>
|
</Stack>
|
||||||
</TabPanel>
|
</TabPanel>
|
||||||
|
|||||||
@@ -1,9 +1,7 @@
|
|||||||
import { useTheme } from "@emotion/react";
|
import { useTheme } from "@emotion/react";
|
||||||
import { useRef, useState } from "react";
|
import { useRef, useState } from "react";
|
||||||
import TabPanel from "@mui/lab/TabPanel";
|
import TabPanel from "@mui/lab/TabPanel";
|
||||||
import { Box, Divider, Modal, Stack, Typography } from "@mui/material";
|
import { Box, Button, Divider, Modal, Stack, Typography } from "@mui/material";
|
||||||
import ButtonSpinner from "../../ButtonSpinner";
|
|
||||||
import Button from "../../Button";
|
|
||||||
import Avatar from "../../Avatar";
|
import Avatar from "../../Avatar";
|
||||||
import Field from "../../Inputs/Field";
|
import Field from "../../Inputs/Field";
|
||||||
import ImageField from "../../Inputs/Image";
|
import ImageField from "../../Inputs/Image";
|
||||||
@@ -20,6 +18,7 @@ import { formatBytes } from "../../../Utils/fileUtils";
|
|||||||
import { clearUptimeMonitorState } from "../../../Features/UptimeMonitors/uptimeMonitorsSlice";
|
import { clearUptimeMonitorState } from "../../../Features/UptimeMonitors/uptimeMonitorsSlice";
|
||||||
import { createToast } from "../../../Utils/toastUtils";
|
import { createToast } from "../../../Utils/toastUtils";
|
||||||
import { logger } from "../../../Utils/Logger";
|
import { logger } from "../../../Utils/Logger";
|
||||||
|
import LoadingButton from "@mui/lab/LoadingButton";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ProfilePanel component displays a form for editing user profile information
|
* ProfilePanel component displays a form for editing user profile information
|
||||||
@@ -292,19 +291,12 @@ const ProfilePanel = () => {
|
|||||||
}
|
}
|
||||||
sx={{ mr: "8px" }}
|
sx={{ mr: "8px" }}
|
||||||
/>
|
/>
|
||||||
<Button
|
<Button variant="text" color="info" onClick={handleDeletePicture}>
|
||||||
level="tertiary"
|
Delete
|
||||||
label="Delete"
|
</Button>
|
||||||
onClick={handleDeletePicture}
|
<Button variant="text" color="primary" onClick={openPictureModal}>
|
||||||
/>
|
Update
|
||||||
<Button
|
</Button>
|
||||||
level="tertiary"
|
|
||||||
label="Update"
|
|
||||||
onClick={openPictureModal}
|
|
||||||
sx={{
|
|
||||||
color: theme.palette.common.main,
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</Stack>
|
</Stack>
|
||||||
</Stack>
|
</Stack>
|
||||||
<Divider
|
<Divider
|
||||||
@@ -316,19 +308,19 @@ const ProfilePanel = () => {
|
|||||||
/>
|
/>
|
||||||
<Stack direction="row" justifyContent="flex-end">
|
<Stack direction="row" justifyContent="flex-end">
|
||||||
<Box width="fit-content">
|
<Box width="fit-content">
|
||||||
<ButtonSpinner
|
<LoadingButton
|
||||||
level="primary"
|
variant="contained"
|
||||||
label="Save"
|
color="primary"
|
||||||
onClick={handleSaveProfile}
|
onClick={handleSaveProfile}
|
||||||
isLoading={isLoading}
|
loading={isLoading}
|
||||||
loadingText="Saving..."
|
loadingIndicator="Saving..."
|
||||||
disabled={
|
disabled={
|
||||||
Object.keys(errors).length !== 0 && !errors?.picture && true
|
Object.keys(errors).length !== 0 && !errors?.picture && true
|
||||||
}
|
}
|
||||||
sx={{
|
sx={{ px: theme.spacing(12) }}
|
||||||
paddingX: theme.spacing(12),
|
>
|
||||||
}}
|
Save
|
||||||
/>
|
</LoadingButton>
|
||||||
</Box>
|
</Box>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Stack>
|
</Stack>
|
||||||
@@ -339,13 +331,8 @@ const ProfilePanel = () => {
|
|||||||
borderColor: theme.palette.border.light,
|
borderColor: theme.palette.border.light,
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Stack
|
<Box component="form" noValidate spellCheck="false">
|
||||||
component="form"
|
<Box mb={theme.spacing(6)}>
|
||||||
noValidate
|
|
||||||
spellCheck="false"
|
|
||||||
gap={theme.spacing(4)}
|
|
||||||
>
|
|
||||||
<Box>
|
|
||||||
<Typography component="h1">Delete account</Typography>
|
<Typography component="h1">Delete account</Typography>
|
||||||
<Typography component="p" sx={{ opacity: 0.6 }}>
|
<Typography component="p" sx={{ opacity: 0.6 }}>
|
||||||
Note that deleting your account will remove all data from our
|
Note that deleting your account will remove all data from our
|
||||||
@@ -353,12 +340,13 @@ const ProfilePanel = () => {
|
|||||||
</Typography>
|
</Typography>
|
||||||
</Box>
|
</Box>
|
||||||
<Button
|
<Button
|
||||||
level="error"
|
variant="contained"
|
||||||
label="Delete account"
|
color="error"
|
||||||
onClick={() => setIsOpen("delete")}
|
onClick={() => setIsOpen("delete")}
|
||||||
sx={{ width: "fit-content", mt: theme.spacing(4) }}
|
>
|
||||||
/>
|
Delete account
|
||||||
</Stack>
|
</Button>
|
||||||
|
</Box>
|
||||||
{/* TODO - Update ModalPopup Component with @mui for reusability */}
|
{/* TODO - Update ModalPopup Component with @mui for reusability */}
|
||||||
<Modal
|
<Modal
|
||||||
aria-labelledby="modal-delete-account"
|
aria-labelledby="modal-delete-account"
|
||||||
@@ -400,17 +388,17 @@ const ProfilePanel = () => {
|
|||||||
mt={theme.spacing(5)}
|
mt={theme.spacing(5)}
|
||||||
justifyContent="flex-end"
|
justifyContent="flex-end"
|
||||||
>
|
>
|
||||||
<Button
|
<Button variant="text" color="info" onClick={() => setIsOpen("")}>
|
||||||
level="tertiary"
|
Cancel
|
||||||
label="Cancel"
|
</Button>
|
||||||
onClick={() => setIsOpen("")}
|
<LoadingButton
|
||||||
/>
|
variant="contained"
|
||||||
<ButtonSpinner
|
color="error"
|
||||||
level="error"
|
|
||||||
label="Delete account"
|
|
||||||
onClick={handleDeleteAccount}
|
onClick={handleDeleteAccount}
|
||||||
isLoading={isLoading}
|
loading={isLoading}
|
||||||
/>
|
>
|
||||||
|
Delete account
|
||||||
|
</LoadingButton>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Modal>
|
</Modal>
|
||||||
@@ -480,15 +468,19 @@ const ProfilePanel = () => {
|
|||||||
justifyContent="flex-end"
|
justifyContent="flex-end"
|
||||||
>
|
>
|
||||||
<Button
|
<Button
|
||||||
level="secondary"
|
variant="outlined"
|
||||||
label="Edit"
|
color="secondary"
|
||||||
disabled
|
disabled
|
||||||
sx={{ mr: "auto" }}
|
sx={{ mr: "auto" }}
|
||||||
/>
|
>
|
||||||
<Button level="tertiary" label="Remove" onClick={removePicture} />
|
Edit
|
||||||
|
</Button>
|
||||||
|
<Button variant="text" color="info" onClick={removePicture}>
|
||||||
|
Remove
|
||||||
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
level="primary"
|
variant="contained"
|
||||||
label="Update"
|
color="primary"
|
||||||
onClick={handleUpdatePicture}
|
onClick={handleUpdatePicture}
|
||||||
disabled={
|
disabled={
|
||||||
(Object.keys(errors).length !== 0 && errors?.picture) ||
|
(Object.keys(errors).length !== 0 && errors?.picture) ||
|
||||||
@@ -496,7 +488,9 @@ const ProfilePanel = () => {
|
|||||||
? true
|
? true
|
||||||
: false
|
: false
|
||||||
}
|
}
|
||||||
/>
|
>
|
||||||
|
Update
|
||||||
|
</Button>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Modal>
|
</Modal>
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import { useTheme } from "@emotion/react";
|
|||||||
import TabPanel from "@mui/lab/TabPanel";
|
import TabPanel from "@mui/lab/TabPanel";
|
||||||
import {
|
import {
|
||||||
Box,
|
Box,
|
||||||
|
Button,
|
||||||
ButtonGroup,
|
ButtonGroup,
|
||||||
Divider,
|
Divider,
|
||||||
IconButton,
|
IconButton,
|
||||||
@@ -10,8 +11,6 @@ import {
|
|||||||
TextField,
|
TextField,
|
||||||
Typography,
|
Typography,
|
||||||
} from "@mui/material";
|
} from "@mui/material";
|
||||||
import ButtonSpinner from "../../ButtonSpinner";
|
|
||||||
import Button from "../../Button";
|
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import EditSvg from "../../../assets/icons/edit.svg?react";
|
import EditSvg from "../../../assets/icons/edit.svg?react";
|
||||||
import Field from "../../Inputs/Field";
|
import Field from "../../Inputs/Field";
|
||||||
@@ -22,6 +21,7 @@ import { useSelector } from "react-redux";
|
|||||||
import BasicTable from "../../BasicTable";
|
import BasicTable from "../../BasicTable";
|
||||||
import Remove from "../../../assets/icons/trash-bin.svg?react";
|
import Remove from "../../../assets/icons/trash-bin.svg?react";
|
||||||
import Select from "../../Inputs/Select";
|
import Select from "../../Inputs/Select";
|
||||||
|
import LoadingButton from "@mui/lab/LoadingButton";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TeamPanel component manages the organization and team members,
|
* TeamPanel component manages the organization and team members,
|
||||||
@@ -283,48 +283,37 @@ const TeamPanel = () => {
|
|||||||
gap={theme.spacing(6)}
|
gap={theme.spacing(6)}
|
||||||
sx={{ fontSize: 14 }}
|
sx={{ fontSize: 14 }}
|
||||||
>
|
>
|
||||||
<ButtonGroup
|
<ButtonGroup>
|
||||||
sx={{
|
|
||||||
"& button, & button:hover": {
|
|
||||||
borderColor: theme.palette.border.light,
|
|
||||||
},
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<Button
|
<Button
|
||||||
level="secondary"
|
variant="group"
|
||||||
label="All"
|
filled={(filter === "all").toString()}
|
||||||
onClick={() => setFilter("all")}
|
onClick={() => setFilter("all")}
|
||||||
sx={{
|
>
|
||||||
backgroundColor:
|
All
|
||||||
filter === "all" && theme.palette.background.fill,
|
</Button>
|
||||||
}}
|
|
||||||
/>
|
|
||||||
<Button
|
<Button
|
||||||
level="secondary"
|
variant="group"
|
||||||
label="Administrator"
|
filled={(filter === "admin").toString()}
|
||||||
onClick={() => setFilter("admin")}
|
onClick={() => setFilter("admin")}
|
||||||
sx={{
|
>
|
||||||
backgroundColor:
|
Administrator
|
||||||
filter === "admin" && theme.palette.background.fill,
|
</Button>
|
||||||
}}
|
|
||||||
/>
|
|
||||||
<Button
|
<Button
|
||||||
level="secondary"
|
variant="group"
|
||||||
label="Member"
|
filled={(filter === "user").toString()}
|
||||||
onClick={() => setFilter("user")}
|
onClick={() => setFilter("user")}
|
||||||
sx={{
|
>
|
||||||
backgroundColor:
|
Member
|
||||||
filter === "user" && theme.palette.background.fill,
|
</Button>
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</ButtonGroup>
|
</ButtonGroup>
|
||||||
</Stack>
|
</Stack>
|
||||||
<Button
|
<Button
|
||||||
level="primary"
|
variant="contained"
|
||||||
label="Invite a team member"
|
color="primary"
|
||||||
sx={{ paddingX: theme.spacing(15) }}
|
|
||||||
onClick={() => setIsOpen(true)}
|
onClick={() => setIsOpen(true)}
|
||||||
/>
|
>
|
||||||
|
Invite a team member
|
||||||
|
</Button>
|
||||||
</Stack>
|
</Stack>
|
||||||
<BasicTable
|
<BasicTable
|
||||||
data={tableData}
|
data={tableData}
|
||||||
@@ -400,18 +389,18 @@ const TeamPanel = () => {
|
|||||||
mt={theme.spacing(8)}
|
mt={theme.spacing(8)}
|
||||||
justifyContent="flex-end"
|
justifyContent="flex-end"
|
||||||
>
|
>
|
||||||
<Button
|
<Button variant="text" color="info" onClick={closeInviteModal}>
|
||||||
level="tertiary"
|
Cancel
|
||||||
label="Cancel"
|
</Button>
|
||||||
onClick={closeInviteModal}
|
<LoadingButton
|
||||||
/>
|
variant="contained"
|
||||||
<ButtonSpinner
|
color="primary"
|
||||||
level="primary"
|
|
||||||
label="Send invite"
|
|
||||||
onClick={handleInviteMember}
|
onClick={handleInviteMember}
|
||||||
isLoading={false}
|
loading={false}
|
||||||
disabled={Object.keys(errors).length !== 0}
|
disabled={Object.keys(errors).length !== 0}
|
||||||
/>
|
>
|
||||||
|
Send invite
|
||||||
|
</LoadingButton>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Modal>
|
</Modal>
|
||||||
|
|||||||
@@ -1,11 +1,10 @@
|
|||||||
import { Box, Stack, Typography } from "@mui/material";
|
import { Box, Button, Stack, Typography } from "@mui/material";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { useTheme } from "@emotion/react";
|
import { useTheme } from "@emotion/react";
|
||||||
import { useDispatch } from "react-redux";
|
import { useDispatch } from "react-redux";
|
||||||
import { useNavigate } from "react-router";
|
import { useNavigate } from "react-router";
|
||||||
import { createToast } from "../../Utils/toastUtils";
|
import { createToast } from "../../Utils/toastUtils";
|
||||||
import { forgotPassword } from "../../Features/Auth/authSlice";
|
import { forgotPassword } from "../../Features/Auth/authSlice";
|
||||||
import Button from "../../Components/Button";
|
|
||||||
import background from "../../assets/Images/background_pattern_decorative.png";
|
import background from "../../assets/Images/background_pattern_decorative.png";
|
||||||
import EmailIcon from "../../assets/icons/email.svg?react";
|
import EmailIcon from "../../assets/icons/email.svg?react";
|
||||||
import Logo from "../../assets/icons/bwu-icon.svg?react";
|
import Logo from "../../assets/icons/bwu-icon.svg?react";
|
||||||
@@ -90,9 +89,9 @@ const CheckEmail = () => {
|
|||||||
overflow="hidden"
|
overflow="hidden"
|
||||||
sx={{
|
sx={{
|
||||||
"& h1": {
|
"& h1": {
|
||||||
color: theme.palette.common.main,
|
color: theme.palette.primary.main,
|
||||||
fontWeight: 600,
|
fontWeight: 600,
|
||||||
fontSize: 26,
|
fontSize: 22,
|
||||||
},
|
},
|
||||||
"& p": {
|
"& p": {
|
||||||
fontSize: 14,
|
fontSize: 14,
|
||||||
@@ -150,21 +149,23 @@ const CheckEmail = () => {
|
|||||||
</Typography>
|
</Typography>
|
||||||
</Box>
|
</Box>
|
||||||
<Button
|
<Button
|
||||||
level="primary"
|
variant="contained"
|
||||||
label="Open email app"
|
color="primary"
|
||||||
onClick={openMail}
|
onClick={openMail}
|
||||||
sx={{
|
sx={{
|
||||||
width: "100%",
|
width: "100%",
|
||||||
maxWidth: 400,
|
maxWidth: 400,
|
||||||
}}
|
}}
|
||||||
/>
|
>
|
||||||
|
Open email app
|
||||||
|
</Button>
|
||||||
<Typography sx={{ alignSelf: "center", mb: theme.spacing(6) }}>
|
<Typography sx={{ alignSelf: "center", mb: theme.spacing(6) }}>
|
||||||
Didn't receive the email?{" "}
|
Didn't receive the email?{" "}
|
||||||
<Typography
|
<Typography
|
||||||
component="span"
|
component="span"
|
||||||
onClick={resendToken}
|
onClick={resendToken}
|
||||||
sx={{
|
sx={{
|
||||||
color: theme.palette.common.main,
|
color: theme.palette.primary.main,
|
||||||
userSelect: "none",
|
userSelect: "none",
|
||||||
pointerEvents: disabled ? "none" : "auto",
|
pointerEvents: disabled ? "none" : "auto",
|
||||||
cursor: disabled ? "default" : "pointer",
|
cursor: disabled ? "default" : "pointer",
|
||||||
@@ -181,7 +182,7 @@ const CheckEmail = () => {
|
|||||||
<Typography
|
<Typography
|
||||||
component="span"
|
component="span"
|
||||||
ml={theme.spacing(2)}
|
ml={theme.spacing(2)}
|
||||||
color={theme.palette.common.main}
|
color={theme.palette.primary.main}
|
||||||
onClick={handleNavigate}
|
onClick={handleNavigate}
|
||||||
sx={{ userSelect: "none" }}
|
sx={{ userSelect: "none" }}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -7,10 +7,10 @@ import { useEffect, useState } from "react";
|
|||||||
import { credentials } from "../../Validation/validation";
|
import { credentials } from "../../Validation/validation";
|
||||||
import { useNavigate } from "react-router-dom";
|
import { useNavigate } from "react-router-dom";
|
||||||
import Field from "../../Components/Inputs/Field";
|
import Field from "../../Components/Inputs/Field";
|
||||||
import ButtonSpinner from "../../Components/ButtonSpinner";
|
|
||||||
import Logo from "../../assets/icons/bwu-icon.svg?react";
|
import Logo from "../../assets/icons/bwu-icon.svg?react";
|
||||||
import Key from "../../assets/icons/key.svg?react";
|
import Key from "../../assets/icons/key.svg?react";
|
||||||
import background from "../../assets/Images/background_pattern_decorative.png";
|
import background from "../../assets/Images/background_pattern_decorative.png";
|
||||||
|
import LoadingButton from "@mui/lab/LoadingButton";
|
||||||
import "./index.css";
|
import "./index.css";
|
||||||
|
|
||||||
const ForgotPassword = () => {
|
const ForgotPassword = () => {
|
||||||
@@ -92,7 +92,7 @@ const ForgotPassword = () => {
|
|||||||
overflow="hidden"
|
overflow="hidden"
|
||||||
sx={{
|
sx={{
|
||||||
"& h1": {
|
"& h1": {
|
||||||
color: theme.palette.common.main,
|
color: theme.palette.primary.main,
|
||||||
fontWeight: 600,
|
fontWeight: 600,
|
||||||
fontSize: 24,
|
fontSize: 24,
|
||||||
},
|
},
|
||||||
@@ -166,18 +166,19 @@ const ForgotPassword = () => {
|
|||||||
onChange={handleChange}
|
onChange={handleChange}
|
||||||
error={errors.email}
|
error={errors.email}
|
||||||
/>
|
/>
|
||||||
<ButtonSpinner
|
<LoadingButton
|
||||||
|
variant="contained"
|
||||||
|
color="primary"
|
||||||
|
loading={isLoading}
|
||||||
disabled={errors.email !== undefined}
|
disabled={errors.email !== undefined}
|
||||||
onClick={handleSubmit}
|
onClick={handleSubmit}
|
||||||
isLoading={isLoading}
|
|
||||||
level="primary"
|
|
||||||
label="Send instructions"
|
|
||||||
sx={{
|
sx={{
|
||||||
width: "100%",
|
width: "100%",
|
||||||
fontWeight: 400,
|
|
||||||
mt: theme.spacing(15),
|
mt: theme.spacing(15),
|
||||||
}}
|
}}
|
||||||
/>
|
>
|
||||||
|
Send instructions
|
||||||
|
</LoadingButton>
|
||||||
</Box>
|
</Box>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Stack>
|
</Stack>
|
||||||
@@ -185,7 +186,7 @@ const ForgotPassword = () => {
|
|||||||
<Typography display="inline-block">Go back to —</Typography>
|
<Typography display="inline-block">Go back to —</Typography>
|
||||||
<Typography
|
<Typography
|
||||||
component="span"
|
component="span"
|
||||||
color={theme.palette.common.main}
|
color={theme.palette.primary.main}
|
||||||
ml={theme.spacing(2)}
|
ml={theme.spacing(2)}
|
||||||
onClick={handleNavigate}
|
onClick={handleNavigate}
|
||||||
sx={{ userSelect: "none" }}
|
sx={{ userSelect: "none" }}
|
||||||
|
|||||||
@@ -1,12 +1,11 @@
|
|||||||
import { useState, useEffect, useRef } from "react";
|
import { useState, useEffect, useRef } from "react";
|
||||||
import { useNavigate } from "react-router-dom";
|
import { useNavigate } from "react-router-dom";
|
||||||
import { Box, Stack, Typography } from "@mui/material";
|
import { Box, Button, Stack, Typography } from "@mui/material";
|
||||||
import { useTheme } from "@emotion/react";
|
import { useTheme } from "@emotion/react";
|
||||||
import { credentials } from "../../Validation/validation";
|
import { credentials } from "../../Validation/validation";
|
||||||
import { login } from "../../Features/Auth/authSlice";
|
import { login } from "../../Features/Auth/authSlice";
|
||||||
import { useDispatch, useSelector } from "react-redux";
|
import { useDispatch, useSelector } from "react-redux";
|
||||||
import { createToast } from "../../Utils/toastUtils";
|
import { createToast } from "../../Utils/toastUtils";
|
||||||
import Button from "../../Components/Button";
|
|
||||||
import { networkService } from "../../main";
|
import { networkService } from "../../main";
|
||||||
import Field from "../../Components/Inputs/Field";
|
import Field from "../../Components/Inputs/Field";
|
||||||
import background from "../../assets/Images/background_pattern_decorative.png";
|
import background from "../../assets/Images/background_pattern_decorative.png";
|
||||||
@@ -40,17 +39,22 @@ const LandingPage = ({ onContinue }) => {
|
|||||||
</Box>
|
</Box>
|
||||||
<Box width="100%">
|
<Box width="100%">
|
||||||
<Button
|
<Button
|
||||||
level="secondary"
|
variant="outlined"
|
||||||
label="Continue with Email"
|
color="info"
|
||||||
img={<Mail />}
|
|
||||||
onClick={onContinue}
|
onClick={onContinue}
|
||||||
sx={{
|
sx={{
|
||||||
width: "100%",
|
width: "100%",
|
||||||
"& svg": {
|
"& svg": {
|
||||||
mr: theme.spacing(4),
|
mr: theme.spacing(4),
|
||||||
|
"& path": {
|
||||||
|
stroke: theme.palette.other.icon,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}}
|
}}
|
||||||
/>
|
>
|
||||||
|
<Mail />
|
||||||
|
Continue with Email
|
||||||
|
</Button>
|
||||||
</Box>
|
</Box>
|
||||||
<Box maxWidth={400}>
|
<Box maxWidth={400}>
|
||||||
<Typography className="tos-p">
|
<Typography className="tos-p">
|
||||||
@@ -151,27 +155,29 @@ const StepOne = ({ form, errors, onSubmit, onChange, onBack }) => {
|
|||||||
</Box>
|
</Box>
|
||||||
<Stack direction="row" justifyContent="space-between">
|
<Stack direction="row" justifyContent="space-between">
|
||||||
<Button
|
<Button
|
||||||
level="secondary"
|
variant="outlined"
|
||||||
label="Back"
|
color="info"
|
||||||
animate="slideLeft"
|
|
||||||
img={<ArrowBackRoundedIcon />}
|
|
||||||
onClick={onBack}
|
onClick={onBack}
|
||||||
sx={{
|
sx={{
|
||||||
mb: theme.spacing(6),
|
px: theme.spacing(5),
|
||||||
px: theme.spacing(8),
|
|
||||||
"& svg.MuiSvgIcon-root": {
|
"& svg.MuiSvgIcon-root": {
|
||||||
mr: theme.spacing(2),
|
mr: theme.spacing(3),
|
||||||
},
|
},
|
||||||
}}
|
}}
|
||||||
props={{ tabIndex: -1 }}
|
props={{ tabIndex: -1 }}
|
||||||
/>
|
>
|
||||||
|
<ArrowBackRoundedIcon />
|
||||||
|
Back
|
||||||
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
level="primary"
|
variant="contained"
|
||||||
label="Continue"
|
color="primary"
|
||||||
onClick={onSubmit}
|
onClick={onSubmit}
|
||||||
disabled={errors.email && true}
|
disabled={errors.email && true}
|
||||||
sx={{ width: "30%" }}
|
sx={{ width: "30%" }}
|
||||||
/>
|
>
|
||||||
|
Continue
|
||||||
|
</Button>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Stack>
|
</Stack>
|
||||||
</>
|
</>
|
||||||
@@ -219,6 +225,7 @@ const StepTwo = ({ form, errors, onSubmit, onChange, onBack }) => {
|
|||||||
<>
|
<>
|
||||||
<Stack
|
<Stack
|
||||||
gap={{ xs: theme.spacing(8), sm: theme.spacing(12) }}
|
gap={{ xs: theme.spacing(8), sm: theme.spacing(12) }}
|
||||||
|
position="relative"
|
||||||
textAlign="center"
|
textAlign="center"
|
||||||
>
|
>
|
||||||
<Box>
|
<Box>
|
||||||
@@ -243,39 +250,49 @@ const StepTwo = ({ form, errors, onSubmit, onChange, onBack }) => {
|
|||||||
</Box>
|
</Box>
|
||||||
<Stack direction="row" justifyContent="space-between">
|
<Stack direction="row" justifyContent="space-between">
|
||||||
<Button
|
<Button
|
||||||
level="secondary"
|
variant="outlined"
|
||||||
label="Back"
|
color="info"
|
||||||
animate="slideLeft"
|
|
||||||
img={<ArrowBackRoundedIcon />}
|
|
||||||
onClick={onBack}
|
onClick={onBack}
|
||||||
sx={{
|
sx={{
|
||||||
mb: theme.spacing(6),
|
px: theme.spacing(5),
|
||||||
px: theme.spacing(8),
|
|
||||||
"& svg.MuiSvgIcon-root": {
|
"& svg.MuiSvgIcon-root": {
|
||||||
mr: theme.spacing(2),
|
mr: theme.spacing(3),
|
||||||
},
|
},
|
||||||
}}
|
}}
|
||||||
props={{ tabIndex: -1 }}
|
props={{ tabIndex: -1 }}
|
||||||
/>
|
>
|
||||||
|
<ArrowBackRoundedIcon />
|
||||||
|
Back
|
||||||
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
level="primary"
|
variant="contained"
|
||||||
label="Continue"
|
color="primary"
|
||||||
onClick={onSubmit}
|
onClick={onSubmit}
|
||||||
disabled={errors.password && true}
|
disabled={errors.password && true}
|
||||||
sx={{ width: "30%" }}
|
sx={{ width: "30%" }}
|
||||||
/>
|
>
|
||||||
|
Continue
|
||||||
|
</Button>
|
||||||
</Stack>
|
</Stack>
|
||||||
<Box textAlign="center">
|
<Box
|
||||||
|
textAlign="center"
|
||||||
|
sx={{
|
||||||
|
position: "absolute",
|
||||||
|
top: "103%",
|
||||||
|
left: "50%",
|
||||||
|
transform: "translateX(-50%)"
|
||||||
|
}}
|
||||||
|
>
|
||||||
<Typography
|
<Typography
|
||||||
className="forgot-p"
|
className="forgot-p"
|
||||||
display="inline-block"
|
display="inline-block"
|
||||||
color={theme.palette.common.main}
|
color={theme.palette.primary.main}
|
||||||
>
|
>
|
||||||
Forgot password?
|
Forgot password?
|
||||||
</Typography>
|
</Typography>
|
||||||
<Typography
|
<Typography
|
||||||
component="span"
|
component="span"
|
||||||
color={theme.palette.common.main}
|
color={theme.palette.primary.main}
|
||||||
ml={theme.spacing(2)}
|
ml={theme.spacing(2)}
|
||||||
sx={{ userSelect: "none" }}
|
sx={{ userSelect: "none" }}
|
||||||
onClick={handleNavigate}
|
onClick={handleNavigate}
|
||||||
@@ -419,7 +436,7 @@ const Login = () => {
|
|||||||
overflow="hidden"
|
overflow="hidden"
|
||||||
sx={{
|
sx={{
|
||||||
"& h1": {
|
"& h1": {
|
||||||
color: theme.palette.common.main,
|
color: theme.palette.primary.main,
|
||||||
fontWeight: 600,
|
fontWeight: 600,
|
||||||
fontSize: 30,
|
fontSize: 30,
|
||||||
},
|
},
|
||||||
@@ -491,7 +508,7 @@ const Login = () => {
|
|||||||
</Typography>
|
</Typography>
|
||||||
<Typography
|
<Typography
|
||||||
component="span"
|
component="span"
|
||||||
color={theme.palette.common.main}
|
color={theme.palette.primary.main}
|
||||||
ml={theme.spacing(2)}
|
ml={theme.spacing(2)}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
navigate("/register");
|
navigate("/register");
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
import { Box, Stack, Typography } from "@mui/material";
|
import { Box, Button, Stack, Typography } from "@mui/material";
|
||||||
import { useTheme } from "@emotion/react";
|
import { useTheme } from "@emotion/react";
|
||||||
import { useNavigate } from "react-router";
|
import { useNavigate } from "react-router";
|
||||||
import { useDispatch } from "react-redux";
|
import { useDispatch } from "react-redux";
|
||||||
import { clearAuthState } from "../../Features/Auth/authSlice";
|
import { clearAuthState } from "../../Features/Auth/authSlice";
|
||||||
import { clearUptimeMonitorState } from "../../Features/UptimeMonitors/uptimeMonitorsSlice";
|
import { clearUptimeMonitorState } from "../../Features/UptimeMonitors/uptimeMonitorsSlice";
|
||||||
import Button from "../../Components/Button";
|
|
||||||
import background from "../../assets/Images/background_pattern_decorative.png";
|
import background from "../../assets/Images/background_pattern_decorative.png";
|
||||||
import ConfirmIcon from "../../assets/icons/confirm-icon.svg?react";
|
import ConfirmIcon from "../../assets/icons/confirm-icon.svg?react";
|
||||||
import Logo from "../../assets/icons/bwu-icon.svg?react";
|
import Logo from "../../assets/icons/bwu-icon.svg?react";
|
||||||
@@ -27,7 +26,7 @@ const NewPasswordConfirmed = () => {
|
|||||||
overflow="hidden"
|
overflow="hidden"
|
||||||
sx={{
|
sx={{
|
||||||
"& h1": {
|
"& h1": {
|
||||||
color: theme.palette.common.main,
|
color: theme.palette.primary.main,
|
||||||
fontWeight: 600,
|
fontWeight: 600,
|
||||||
fontSize: 22,
|
fontSize: 22,
|
||||||
},
|
},
|
||||||
@@ -85,21 +84,23 @@ const NewPasswordConfirmed = () => {
|
|||||||
</Typography>
|
</Typography>
|
||||||
</Box>
|
</Box>
|
||||||
<Button
|
<Button
|
||||||
level="primary"
|
variant="contained"
|
||||||
label="Continue"
|
color="primary"
|
||||||
onClick={() => navigate("/monitors")}
|
onClick={() => navigate("/monitors")}
|
||||||
sx={{
|
sx={{
|
||||||
width: "100%",
|
width: "100%",
|
||||||
maxWidth: 400,
|
maxWidth: 400,
|
||||||
}}
|
}}
|
||||||
/>
|
>
|
||||||
|
Continue
|
||||||
|
</Button>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Stack>
|
</Stack>
|
||||||
<Box textAlign="center" p={theme.spacing(12)}>
|
<Box textAlign="center" p={theme.spacing(12)}>
|
||||||
<Typography display="inline-block">Go back to —</Typography>
|
<Typography display="inline-block">Go back to —</Typography>
|
||||||
<Typography
|
<Typography
|
||||||
component="span"
|
component="span"
|
||||||
color={theme.palette.common.main}
|
color={theme.palette.primary.main}
|
||||||
ml={theme.spacing(2)}
|
ml={theme.spacing(2)}
|
||||||
onClick={handleNavigate}
|
onClick={handleNavigate}
|
||||||
sx={{ userSelect: "none" }}
|
sx={{ userSelect: "none" }}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import PropTypes from "prop-types";
|
|||||||
import { useState, useEffect, useRef } from "react";
|
import { useState, useEffect, useRef } from "react";
|
||||||
import { useNavigate } from "react-router-dom";
|
import { useNavigate } from "react-router-dom";
|
||||||
import { useTheme } from "@emotion/react";
|
import { useTheme } from "@emotion/react";
|
||||||
import { Box, Stack, Typography } from "@mui/material";
|
import { Box, Button, Stack, Typography } from "@mui/material";
|
||||||
import { useDispatch } from "react-redux";
|
import { useDispatch } from "react-redux";
|
||||||
import { credentials } from "../../../Validation/validation";
|
import { credentials } from "../../../Validation/validation";
|
||||||
import { createToast } from "../../../Utils/toastUtils";
|
import { createToast } from "../../../Utils/toastUtils";
|
||||||
@@ -13,11 +13,9 @@ import Logo from "../../../assets/icons/bwu-icon.svg?react";
|
|||||||
import Mail from "../../../assets/icons/mail.svg?react";
|
import Mail from "../../../assets/icons/mail.svg?react";
|
||||||
import ArrowBackRoundedIcon from "@mui/icons-material/ArrowBackRounded";
|
import ArrowBackRoundedIcon from "@mui/icons-material/ArrowBackRounded";
|
||||||
import Check from "../../../Components/Check/Check";
|
import Check from "../../../Components/Check/Check";
|
||||||
import Button from "../../../Components/Button";
|
|
||||||
import Field from "../../../Components/Inputs/Field";
|
import Field from "../../../Components/Inputs/Field";
|
||||||
import { networkService } from "../../../main";
|
import { networkService } from "../../../main";
|
||||||
import "../index.css";
|
import "../index.css";
|
||||||
import { logger } from "../../../Utils/Logger";
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Displays the initial landing page.
|
* Displays the initial landing page.
|
||||||
@@ -46,17 +44,22 @@ const LandingPage = ({ isSuperAdmin, onSignup }) => {
|
|||||||
</Box>
|
</Box>
|
||||||
<Box width="100%">
|
<Box width="100%">
|
||||||
<Button
|
<Button
|
||||||
level="secondary"
|
variant="outlined"
|
||||||
label="Sign up with Email"
|
color="info"
|
||||||
img={<Mail />}
|
|
||||||
onClick={onSignup}
|
onClick={onSignup}
|
||||||
sx={{
|
sx={{
|
||||||
width: "100%",
|
width: "100%",
|
||||||
"& svg": {
|
"& svg": {
|
||||||
mr: theme.spacing(4),
|
mr: theme.spacing(4),
|
||||||
|
"& path": {
|
||||||
|
stroke: theme.palette.other.icon,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}}
|
}}
|
||||||
/>
|
>
|
||||||
|
<Mail />
|
||||||
|
Sign up with Email
|
||||||
|
</Button>
|
||||||
</Box>
|
</Box>
|
||||||
<Box maxWidth={400}>
|
<Box maxWidth={400}>
|
||||||
<Typography className="tos-p">
|
<Typography className="tos-p">
|
||||||
@@ -180,26 +183,29 @@ const StepOne = ({ form, errors, onSubmit, onChange, onBack }) => {
|
|||||||
</Box>
|
</Box>
|
||||||
<Stack direction="row" justifyContent="space-between">
|
<Stack direction="row" justifyContent="space-between">
|
||||||
<Button
|
<Button
|
||||||
level="secondary"
|
variant="outlined"
|
||||||
label="Back"
|
color="info"
|
||||||
animate="slideLeft"
|
|
||||||
img={<ArrowBackRoundedIcon />}
|
|
||||||
onClick={onBack}
|
onClick={onBack}
|
||||||
sx={{
|
sx={{
|
||||||
px: theme.spacing(8),
|
px: theme.spacing(5),
|
||||||
"& svg.MuiSvgIcon-root": {
|
"& svg.MuiSvgIcon-root": {
|
||||||
mr: theme.spacing(2),
|
mr: theme.spacing(3),
|
||||||
},
|
},
|
||||||
}}
|
}}
|
||||||
props={{ tabIndex: -1 }}
|
props={{ tabIndex: -1 }}
|
||||||
/>
|
>
|
||||||
|
<ArrowBackRoundedIcon />
|
||||||
|
Back
|
||||||
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
level="primary"
|
variant="contained"
|
||||||
label="Continue"
|
color="primary"
|
||||||
onClick={onSubmit}
|
onClick={onSubmit}
|
||||||
disabled={(errors.firstName || errors.lastName) && true}
|
disabled={(errors.firstName || errors.lastName) && true}
|
||||||
sx={{ width: "30%" }}
|
sx={{ width: "30%" }}
|
||||||
/>
|
>
|
||||||
|
Continue
|
||||||
|
</Button>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Stack>
|
</Stack>
|
||||||
</>
|
</>
|
||||||
@@ -270,26 +276,29 @@ const StepTwo = ({ form, errors, onSubmit, onChange, onBack }) => {
|
|||||||
</Box>
|
</Box>
|
||||||
<Stack direction="row" justifyContent="space-between">
|
<Stack direction="row" justifyContent="space-between">
|
||||||
<Button
|
<Button
|
||||||
level="secondary"
|
variant="outlined"
|
||||||
label="Back"
|
color="info"
|
||||||
animate="slideLeft"
|
|
||||||
img={<ArrowBackRoundedIcon />}
|
|
||||||
onClick={onBack}
|
onClick={onBack}
|
||||||
sx={{
|
sx={{
|
||||||
px: theme.spacing(8),
|
px: theme.spacing(5),
|
||||||
"& svg.MuiSvgIcon-root": {
|
"& svg.MuiSvgIcon-root": {
|
||||||
mr: theme.spacing(2),
|
mr: theme.spacing(3),
|
||||||
},
|
},
|
||||||
}}
|
}}
|
||||||
props={{ tabIndex: -1 }}
|
props={{ tabIndex: -1 }}
|
||||||
/>
|
>
|
||||||
|
<ArrowBackRoundedIcon />
|
||||||
|
Back
|
||||||
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
level="primary"
|
variant="contained"
|
||||||
label="Continue"
|
color="primary"
|
||||||
onClick={onSubmit}
|
onClick={onSubmit}
|
||||||
disabled={errors.email && true}
|
disabled={errors.email && true}
|
||||||
sx={{ width: "30%" }}
|
sx={{ width: "30%" }}
|
||||||
/>
|
>
|
||||||
|
Continue
|
||||||
|
</Button>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Stack>
|
</Stack>
|
||||||
</>
|
</>
|
||||||
@@ -443,26 +452,29 @@ const StepThree = ({ form, errors, onSubmit, onChange, onBack }) => {
|
|||||||
</Box>
|
</Box>
|
||||||
<Stack direction="row" justifyContent="space-between">
|
<Stack direction="row" justifyContent="space-between">
|
||||||
<Button
|
<Button
|
||||||
level="secondary"
|
variant="outlined"
|
||||||
label="Back"
|
color="info"
|
||||||
animate="slideLeft"
|
|
||||||
img={<ArrowBackRoundedIcon />}
|
|
||||||
onClick={onBack}
|
onClick={onBack}
|
||||||
sx={{
|
sx={{
|
||||||
px: theme.spacing(8),
|
px: theme.spacing(5),
|
||||||
"& svg.MuiSvgIcon-root": {
|
"& svg.MuiSvgIcon-root": {
|
||||||
mr: theme.spacing(2),
|
mr: theme.spacing(3),
|
||||||
},
|
},
|
||||||
}}
|
}}
|
||||||
props={{ tabIndex: -1 }}
|
props={{ tabIndex: -1 }}
|
||||||
/>
|
>
|
||||||
|
<ArrowBackRoundedIcon />
|
||||||
|
Back
|
||||||
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
level="primary"
|
variant="contained"
|
||||||
label="Continue"
|
color="primary"
|
||||||
onClick={onSubmit}
|
onClick={onSubmit}
|
||||||
disabled={errors.email && true}
|
disabled={errors.email && true}
|
||||||
sx={{ width: "30%" }}
|
sx={{ width: "30%" }}
|
||||||
/>
|
>
|
||||||
|
Continue
|
||||||
|
</Button>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Stack>
|
</Stack>
|
||||||
</>
|
</>
|
||||||
@@ -644,7 +656,7 @@ const Register = ({ isSuperAdmin }) => {
|
|||||||
overflow="hidden"
|
overflow="hidden"
|
||||||
sx={{
|
sx={{
|
||||||
"& h1": {
|
"& h1": {
|
||||||
color: theme.palette.common.main,
|
color: theme.palette.primary.main,
|
||||||
fontWeight: 600,
|
fontWeight: 600,
|
||||||
fontSize: 30,
|
fontSize: 30,
|
||||||
},
|
},
|
||||||
@@ -731,7 +743,7 @@ const Register = ({ isSuperAdmin }) => {
|
|||||||
onClick={() => {
|
onClick={() => {
|
||||||
navigate("/login");
|
navigate("/login");
|
||||||
}}
|
}}
|
||||||
sx={{ userSelect: "none", color: theme.palette.common.main }}
|
sx={{ userSelect: "none", color: theme.palette.primary.main }}
|
||||||
>
|
>
|
||||||
Log In
|
Log In
|
||||||
</Typography>
|
</Typography>
|
||||||
|
|||||||
@@ -8,11 +8,11 @@ import { useState } from "react";
|
|||||||
import { credentials } from "../../Validation/validation";
|
import { credentials } from "../../Validation/validation";
|
||||||
import { useNavigate } from "react-router-dom";
|
import { useNavigate } from "react-router-dom";
|
||||||
import Check from "../../Components/Check/Check";
|
import Check from "../../Components/Check/Check";
|
||||||
import ButtonSpinner from "../../Components/ButtonSpinner";
|
|
||||||
import Field from "../../Components/Inputs/Field";
|
import Field from "../../Components/Inputs/Field";
|
||||||
import LockIcon from "../../assets/icons/lock-button-icon.svg?react";
|
import LockIcon from "../../assets/icons/lock-button-icon.svg?react";
|
||||||
import background from "../../assets/Images/background_pattern_decorative.png";
|
import background from "../../assets/Images/background_pattern_decorative.png";
|
||||||
import Logo from "../../assets/icons/bwu-icon.svg?react";
|
import Logo from "../../assets/icons/bwu-icon.svg?react";
|
||||||
|
import LoadingButton from "@mui/lab/LoadingButton";
|
||||||
import "./index.css";
|
import "./index.css";
|
||||||
|
|
||||||
const SetNewPassword = () => {
|
const SetNewPassword = () => {
|
||||||
@@ -109,7 +109,7 @@ const SetNewPassword = () => {
|
|||||||
overflow="hidden"
|
overflow="hidden"
|
||||||
sx={{
|
sx={{
|
||||||
"& h1": {
|
"& h1": {
|
||||||
color: theme.palette.common.main,
|
color: theme.palette.primary.main,
|
||||||
fontWeight: 600,
|
fontWeight: 600,
|
||||||
fontSize: 24,
|
fontSize: 24,
|
||||||
},
|
},
|
||||||
@@ -266,21 +266,23 @@ const SetNewPassword = () => {
|
|||||||
/>
|
/>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Box>
|
</Box>
|
||||||
<ButtonSpinner
|
<LoadingButton
|
||||||
disabled={Object.keys(errors).length !== 0}
|
variant="contained"
|
||||||
isLoading={isLoading}
|
color="primary"
|
||||||
|
loading={isLoading}
|
||||||
onClick={handleSubmit}
|
onClick={handleSubmit}
|
||||||
level="primary"
|
disabled={Object.keys(errors).length !== 0}
|
||||||
label="Reset password"
|
|
||||||
sx={{ width: "100%", maxWidth: 400 }}
|
sx={{ width: "100%", maxWidth: 400 }}
|
||||||
/>
|
>
|
||||||
|
Reset password
|
||||||
|
</LoadingButton>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Stack>
|
</Stack>
|
||||||
<Box textAlign="center" p={theme.spacing(12)}>
|
<Box textAlign="center" p={theme.spacing(12)}>
|
||||||
<Typography display="inline-block">Go back to —</Typography>
|
<Typography display="inline-block">Go back to —</Typography>
|
||||||
<Typography
|
<Typography
|
||||||
component="span"
|
component="span"
|
||||||
color={theme.palette.common.main}
|
color={theme.palette.primary.main}
|
||||||
ml={theme.spacing(2)}
|
ml={theme.spacing(2)}
|
||||||
onClick={() => navigate("/login")}
|
onClick={() => navigate("/login")}
|
||||||
sx={{ userSelect: "none" }}
|
sx={{ userSelect: "none" }}
|
||||||
|
|||||||
@@ -1,7 +1,12 @@
|
|||||||
import { useState, useEffect } from "react";
|
import { useState, useEffect } from "react";
|
||||||
import { useSelector } from "react-redux";
|
import { useSelector } from "react-redux";
|
||||||
import { ButtonGroup, Stack, Skeleton, Typography } from "@mui/material";
|
import {
|
||||||
import Button from "../../Components/Button";
|
ButtonGroup,
|
||||||
|
Stack,
|
||||||
|
Skeleton,
|
||||||
|
Typography,
|
||||||
|
Button,
|
||||||
|
} from "@mui/material";
|
||||||
import { networkService } from "../../main";
|
import { networkService } from "../../main";
|
||||||
import { useTheme } from "@emotion/react";
|
import { useTheme } from "@emotion/react";
|
||||||
import Select from "../../Components/Inputs/Select";
|
import Select from "../../Components/Inputs/Select";
|
||||||
@@ -78,11 +83,7 @@ const Incidents = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Stack
|
<Stack className="incidents" pt={theme.spacing(21)} gap={theme.spacing(12)}>
|
||||||
className="incidents"
|
|
||||||
pt={theme.spacing(21)}
|
|
||||||
gap={theme.spacing(12)}
|
|
||||||
>
|
|
||||||
{loading ? (
|
{loading ? (
|
||||||
<SkeletonLayout />
|
<SkeletonLayout />
|
||||||
) : (
|
) : (
|
||||||
@@ -114,38 +115,26 @@ const Incidents = () => {
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Button
|
<Button
|
||||||
level="secondary"
|
variant="group"
|
||||||
label="All"
|
filled={(filter === "all").toString()}
|
||||||
onClick={() => setFilter("all")}
|
onClick={() => setFilter("all")}
|
||||||
sx={{
|
>
|
||||||
backgroundColor:
|
All
|
||||||
filter === "all"
|
</Button>
|
||||||
? theme.palette.background.fill
|
|
||||||
: theme.palette.background.main,
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
<Button
|
<Button
|
||||||
level="secondary"
|
variant="group"
|
||||||
label="Down"
|
filled={(filter === "down").toString()}
|
||||||
onClick={() => setFilter("down")}
|
onClick={() => setFilter("down")}
|
||||||
sx={{
|
>
|
||||||
backgroundColor:
|
Down
|
||||||
filter === "down"
|
</Button>
|
||||||
? theme.palette.background.fill
|
|
||||||
: theme.palette.background.main,
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
<Button
|
<Button
|
||||||
level="secondary"
|
variant="group"
|
||||||
label="Cannot Resolve"
|
filled={(filter === "resolve").toString()}
|
||||||
onClick={() => setFilter("resolve")}
|
onClick={() => setFilter("resolve")}
|
||||||
sx={{
|
>
|
||||||
backgroundColor:
|
Cannot Resolve
|
||||||
filter === "resolve"
|
</Button>
|
||||||
? theme.palette.background.fill
|
|
||||||
: theme.palette.background.main,
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</ButtonGroup>
|
</ButtonGroup>
|
||||||
</Stack>
|
</Stack>
|
||||||
<IncidentTable
|
<IncidentTable
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import PropTypes from "prop-types";
|
import PropTypes from "prop-types";
|
||||||
import { Stack, Typography, Grid } from "@mui/material";
|
import { Stack, Typography, Grid, Button } from "@mui/material";
|
||||||
import Button from "../../Components/Button";
|
|
||||||
import { useTheme } from "@emotion/react";
|
import { useTheme } from "@emotion/react";
|
||||||
import Discord from "../../assets/icons/discord-icon.svg?react";
|
import Discord from "../../assets/icons/discord-icon.svg?react";
|
||||||
import Slack from "../../assets/icons/slack-icon.svg?react";
|
import Slack from "../../assets/icons/slack-icon.svg?react";
|
||||||
@@ -47,12 +46,14 @@ const IntegrationsComponent = ({ icon, header, info, onClick }) => {
|
|||||||
</Typography>
|
</Typography>
|
||||||
</Stack>
|
</Stack>
|
||||||
<Button
|
<Button
|
||||||
label="Add"
|
variant="contained"
|
||||||
level="primary"
|
color="primary"
|
||||||
onClick={onClick}
|
onClick={onClick}
|
||||||
sx={{ alignSelf: "center" }}
|
sx={{ alignSelf: "center" }}
|
||||||
disabled={true}
|
disabled={true}
|
||||||
/>
|
>
|
||||||
|
Add
|
||||||
|
</Button>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Grid>
|
</Grid>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import { Box, Stack, Typography } from "@mui/material";
|
import { Box, Button, Stack, Typography } from "@mui/material";
|
||||||
import "./index.css";
|
import "./index.css";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import Button from "../../../Components/Button";
|
|
||||||
import Back from "../../../assets/icons/left-arrow-long.svg?react";
|
import Back from "../../../assets/icons/left-arrow-long.svg?react";
|
||||||
import Select from "../../../Components/Inputs/Select";
|
import Select from "../../../Components/Inputs/Select";
|
||||||
import { AdapterDayjs } from "@mui/x-date-pickers/AdapterDayjs";
|
import { AdapterDayjs } from "@mui/x-date-pickers/AdapterDayjs";
|
||||||
@@ -215,7 +214,7 @@ const CreateNewMaintenanceWindow = () => {
|
|||||||
sx={{
|
sx={{
|
||||||
width: "fit-content",
|
width: "fit-content",
|
||||||
fontSize: "var(--env-var-font-size-small)",
|
fontSize: "var(--env-var-font-size-small)",
|
||||||
borderBottom: `1px dashed ${theme.palette.common.main}`,
|
borderBottom: `1px dashed ${theme.palette.primary.main}`,
|
||||||
paddingBottom: "4px",
|
paddingBottom: "4px",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
@@ -230,18 +229,17 @@ const CreateNewMaintenanceWindow = () => {
|
|||||||
<div className="create-maintenance-window">
|
<div className="create-maintenance-window">
|
||||||
<Stack gap={theme.spacing(10)}>
|
<Stack gap={theme.spacing(10)}>
|
||||||
<Button
|
<Button
|
||||||
id="btn-back"
|
variant="contained"
|
||||||
|
color="secondary"
|
||||||
sx={{
|
sx={{
|
||||||
width: "100px",
|
width: "100px",
|
||||||
height: "30px",
|
height: "30px",
|
||||||
gap: "10px",
|
gap: "10px",
|
||||||
backgroundColor: theme.palette.background.fill,
|
|
||||||
color: theme.palette.text.secondary,
|
|
||||||
}}
|
}}
|
||||||
label="Back"
|
>
|
||||||
level="tertiary"
|
<Back />
|
||||||
img={<Back />}
|
Back
|
||||||
/>
|
</Button>
|
||||||
<Box>
|
<Box>
|
||||||
<Typography
|
<Typography
|
||||||
sx={{
|
sx={{
|
||||||
@@ -278,26 +276,19 @@ const CreateNewMaintenanceWindow = () => {
|
|||||||
</Stack>
|
</Stack>
|
||||||
<Stack justifyContent="end" direction="row" marginTop={3}>
|
<Stack justifyContent="end" direction="row" marginTop={3}>
|
||||||
<Button
|
<Button
|
||||||
|
variant="text"
|
||||||
|
color="info"
|
||||||
sx={{
|
sx={{
|
||||||
"&:hover": {
|
"&:hover": {
|
||||||
backgroundColor: "transparent",
|
backgroundColor: "transparent",
|
||||||
boxShadow: "none",
|
|
||||||
},
|
},
|
||||||
}}
|
}}
|
||||||
level="tertiary"
|
>
|
||||||
label="Cancel"
|
Cancel
|
||||||
/>
|
</Button>
|
||||||
<Button
|
<Button variant="contained" color="primary" onClick={handleSubmit}>
|
||||||
sx={{
|
Create
|
||||||
"&:hover": {
|
</Button>
|
||||||
backgroundColor: "#1570EF",
|
|
||||||
boxShadow: "none",
|
|
||||||
},
|
|
||||||
}}
|
|
||||||
level="primary"
|
|
||||||
label="Create"
|
|
||||||
onClick={handleSubmit}
|
|
||||||
/>
|
|
||||||
</Stack>
|
</Stack>
|
||||||
</Stack>
|
</Stack>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { useNavigate, useParams } from "react-router";
|
|||||||
import { useTheme } from "@emotion/react";
|
import { useTheme } from "@emotion/react";
|
||||||
import { useDispatch, useSelector } from "react-redux";
|
import { useDispatch, useSelector } from "react-redux";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { Box, Modal, Stack, Typography } from "@mui/material";
|
import { Box, Button, Modal, Stack, Typography } from "@mui/material";
|
||||||
import { monitorValidation } from "../../../Validation/validation";
|
import { monitorValidation } from "../../../Validation/validation";
|
||||||
import { createToast } from "../../../Utils/toastUtils";
|
import { createToast } from "../../../Utils/toastUtils";
|
||||||
import { logger } from "../../../Utils/Logger";
|
import { logger } from "../../../Utils/Logger";
|
||||||
@@ -14,16 +14,17 @@ import {
|
|||||||
getUptimeMonitorsByTeamId,
|
getUptimeMonitorsByTeamId,
|
||||||
deleteUptimeMonitor,
|
deleteUptimeMonitor,
|
||||||
} from "../../../Features/UptimeMonitors/uptimeMonitorsSlice";
|
} from "../../../Features/UptimeMonitors/uptimeMonitorsSlice";
|
||||||
import Button from "../../../Components/Button";
|
|
||||||
import Field from "../../../Components/Inputs/Field";
|
import Field from "../../../Components/Inputs/Field";
|
||||||
import PauseCircleOutlineIcon from "@mui/icons-material/PauseCircleOutline";
|
import PauseCircleOutlineIcon from "@mui/icons-material/PauseCircleOutline";
|
||||||
|
import PlayCircleOutlineRoundedIcon from "@mui/icons-material/PlayCircleOutlineRounded";
|
||||||
import Select from "../../../Components/Inputs/Select";
|
import Select from "../../../Components/Inputs/Select";
|
||||||
import Checkbox from "../../../Components/Inputs/Checkbox";
|
import Checkbox from "../../../Components/Inputs/Checkbox";
|
||||||
import Breadcrumbs from "../../../Components/Breadcrumbs";
|
import Breadcrumbs from "../../../Components/Breadcrumbs";
|
||||||
import PulseDot from "../../../Components/Animated/PulseDot";
|
import PulseDot from "../../../Components/Animated/PulseDot";
|
||||||
import "./index.css";
|
|
||||||
import SkeletonLayout from "./skeleton";
|
import SkeletonLayout from "./skeleton";
|
||||||
import ButtonSpinner from "../../../Components/ButtonSpinner";
|
import LoadingButton from "@mui/lab/LoadingButton";
|
||||||
|
import "./index.css";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Parses a URL string and returns a URL object.
|
* Parses a URL string and returns a URL object.
|
||||||
*
|
*
|
||||||
@@ -248,27 +249,40 @@ const Configure = () => {
|
|||||||
ml: "auto",
|
ml: "auto",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<ButtonSpinner
|
<LoadingButton
|
||||||
isLoading={isLoading}
|
variant="contained"
|
||||||
level="tertiary"
|
color="secondary"
|
||||||
label={monitor?.isActive ? "Pause" : "Resume"}
|
loading={isLoading}
|
||||||
img={<PauseCircleOutlineIcon />}
|
|
||||||
sx={{
|
sx={{
|
||||||
backgroundColor: theme.palette.background.main,
|
backgroundColor: theme.palette.background.main,
|
||||||
px: theme.spacing(6),
|
px: theme.spacing(5),
|
||||||
mr: theme.spacing(6),
|
mr: theme.spacing(6),
|
||||||
|
"& svg": {
|
||||||
|
mr: theme.spacing(2),
|
||||||
|
},
|
||||||
}}
|
}}
|
||||||
onClick={handlePause}
|
onClick={handlePause}
|
||||||
/>
|
>
|
||||||
<ButtonSpinner
|
{monitor?.isActive ? (
|
||||||
isLoading={isLoading}
|
<>
|
||||||
level="error"
|
<PauseCircleOutlineIcon />
|
||||||
label="Remove"
|
Pause
|
||||||
sx={{
|
</>
|
||||||
px: theme.spacing(8),
|
) : (
|
||||||
}}
|
<>
|
||||||
|
<PlayCircleOutlineRoundedIcon />
|
||||||
|
Resume
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
</LoadingButton>
|
||||||
|
<Button
|
||||||
|
variant="contained"
|
||||||
|
color="error"
|
||||||
|
sx={{ px: theme.spacing(8) }}
|
||||||
onClick={() => setIsOpen(true)}
|
onClick={() => setIsOpen(true)}
|
||||||
/>
|
>
|
||||||
|
Remove
|
||||||
|
</Button>
|
||||||
</Box>
|
</Box>
|
||||||
</Stack>
|
</Stack>
|
||||||
<ConfigBox>
|
<ConfigBox>
|
||||||
@@ -375,13 +389,15 @@ const Configure = () => {
|
|||||||
</Stack>
|
</Stack>
|
||||||
</ConfigBox>
|
</ConfigBox>
|
||||||
<Stack direction="row" justifyContent="flex-end" mt="auto">
|
<Stack direction="row" justifyContent="flex-end" mt="auto">
|
||||||
<ButtonSpinner
|
<LoadingButton
|
||||||
isLoading={isLoading}
|
variant="contained"
|
||||||
level="primary"
|
color="primary"
|
||||||
label="Save"
|
loading={isLoading}
|
||||||
sx={{ px: theme.spacing(12) }}
|
sx={{ px: theme.spacing(12) }}
|
||||||
onClick={handleSubmit}
|
onClick={handleSubmit}
|
||||||
/>
|
>
|
||||||
|
Save
|
||||||
|
</LoadingButton>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Stack>
|
</Stack>
|
||||||
</>
|
</>
|
||||||
@@ -434,11 +450,20 @@ const Configure = () => {
|
|||||||
justifyContent="flex-end"
|
justifyContent="flex-end"
|
||||||
>
|
>
|
||||||
<Button
|
<Button
|
||||||
level="tertiary"
|
variant="text"
|
||||||
label="Cancel"
|
color="info"
|
||||||
onClick={() => setIsOpen(false)}
|
onClick={() => setIsOpen(false)}
|
||||||
/>
|
>
|
||||||
<Button level="error" label="Delete" onClick={handleRemove} />
|
Cancel
|
||||||
|
</Button>
|
||||||
|
<LoadingButton
|
||||||
|
variant="contained"
|
||||||
|
color="error"
|
||||||
|
loading={isLoading}
|
||||||
|
onClick={handleRemove}
|
||||||
|
>
|
||||||
|
Delete
|
||||||
|
</LoadingButton>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Modal>
|
</Modal>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { Box, ButtonGroup, Stack, Typography } from "@mui/material";
|
import { Box, Button, ButtonGroup, Stack, Typography } from "@mui/material";
|
||||||
import { useSelector, useDispatch } from "react-redux";
|
import { useSelector, useDispatch } from "react-redux";
|
||||||
import { monitorValidation } from "../../../Validation/validation";
|
import { monitorValidation } from "../../../Validation/validation";
|
||||||
import { createUptimeMonitor } from "../../../Features/UptimeMonitors/uptimeMonitorsSlice";
|
import { createUptimeMonitor } from "../../../Features/UptimeMonitors/uptimeMonitorsSlice";
|
||||||
@@ -9,7 +9,6 @@ import { createToast } from "../../../Utils/toastUtils";
|
|||||||
import { logger } from "../../../Utils/Logger";
|
import { logger } from "../../../Utils/Logger";
|
||||||
import { ConfigBox } from "../styled";
|
import { ConfigBox } from "../styled";
|
||||||
import Radio from "../../../Components/Inputs/Radio";
|
import Radio from "../../../Components/Inputs/Radio";
|
||||||
import Button from "../../../Components/Button";
|
|
||||||
import Field from "../../../Components/Inputs/Field";
|
import Field from "../../../Components/Inputs/Field";
|
||||||
import Select from "../../../Components/Inputs/Select";
|
import Select from "../../../Components/Inputs/Select";
|
||||||
import Checkbox from "../../../Components/Inputs/Checkbox";
|
import Checkbox from "../../../Components/Inputs/Checkbox";
|
||||||
@@ -232,29 +231,19 @@ const CreateMonitor = () => {
|
|||||||
{monitor.type === "http" ? (
|
{monitor.type === "http" ? (
|
||||||
<ButtonGroup sx={{ ml: "32px" }}>
|
<ButtonGroup sx={{ ml: "32px" }}>
|
||||||
<Button
|
<Button
|
||||||
level="secondary"
|
variant="group"
|
||||||
label="HTTPS"
|
filled={https.toString()}
|
||||||
onClick={() => setHttps(true)}
|
onClick={() => setHttps(true)}
|
||||||
sx={{
|
>
|
||||||
backgroundColor: https && theme.palette.background.fill,
|
HTTPS
|
||||||
borderColor: theme.palette.border.dark,
|
</Button>
|
||||||
"&:hover": {
|
|
||||||
borderColor: theme.palette.border.dark,
|
|
||||||
},
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
<Button
|
<Button
|
||||||
level="secondary"
|
variant="group"
|
||||||
label="HTTP"
|
filled={(!https).toString()}
|
||||||
onClick={() => setHttps(false)}
|
onClick={() => setHttps(false)}
|
||||||
sx={{
|
>
|
||||||
backgroundColor: !https && theme.palette.background.fill,
|
HTTP
|
||||||
borderColor: theme.palette.border.dark,
|
</Button>
|
||||||
"&:hover": {
|
|
||||||
borderColor: theme.palette.border.dark,
|
|
||||||
},
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</ButtonGroup>
|
</ButtonGroup>
|
||||||
) : (
|
) : (
|
||||||
""
|
""
|
||||||
@@ -354,12 +343,13 @@ const CreateMonitor = () => {
|
|||||||
</ConfigBox>
|
</ConfigBox>
|
||||||
<Stack direction="row" justifyContent="flex-end">
|
<Stack direction="row" justifyContent="flex-end">
|
||||||
<Button
|
<Button
|
||||||
id="create-monitor-btn"
|
variant="contained"
|
||||||
level="primary"
|
color="primary"
|
||||||
label="Create monitor"
|
|
||||||
onClick={handleCreateMonitor}
|
onClick={handleCreateMonitor}
|
||||||
disabled={Object.keys(errors).length !== 0 && true}
|
disabled={Object.keys(errors).length !== 0 && true}
|
||||||
/>
|
>
|
||||||
|
Create monitor
|
||||||
|
</Button>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Box>
|
</Box>
|
||||||
|
|||||||
@@ -1,6 +1,13 @@
|
|||||||
import PropTypes from "prop-types";
|
import PropTypes from "prop-types";
|
||||||
import { useEffect, useState, useCallback } from "react";
|
import { useEffect, useState, useCallback } from "react";
|
||||||
import { Box, Skeleton, Stack, Typography, useTheme } from "@mui/material";
|
import {
|
||||||
|
Box,
|
||||||
|
Button,
|
||||||
|
Skeleton,
|
||||||
|
Stack,
|
||||||
|
Typography,
|
||||||
|
useTheme,
|
||||||
|
} from "@mui/material";
|
||||||
import { useSelector } from "react-redux";
|
import { useSelector } from "react-redux";
|
||||||
import { useNavigate, useParams } from "react-router-dom";
|
import { useNavigate, useParams } from "react-router-dom";
|
||||||
import { networkService } from "../../../main";
|
import { networkService } from "../../../main";
|
||||||
@@ -11,7 +18,6 @@ import {
|
|||||||
} from "../../../Utils/timeUtils";
|
} from "../../../Utils/timeUtils";
|
||||||
import MonitorDetailsAreaChart from "../../../Components/Charts/MonitorDetailsAreaChart";
|
import MonitorDetailsAreaChart from "../../../Components/Charts/MonitorDetailsAreaChart";
|
||||||
import ButtonGroup from "@mui/material/ButtonGroup";
|
import ButtonGroup from "@mui/material/ButtonGroup";
|
||||||
import Button from "../../../Components/Button";
|
|
||||||
import SettingsIcon from "../../../assets/icons/settings-bold.svg?react";
|
import SettingsIcon from "../../../assets/icons/settings-bold.svg?react";
|
||||||
import PaginationTable from "./PaginationTable";
|
import PaginationTable from "./PaginationTable";
|
||||||
import Breadcrumbs from "../../../Components/Breadcrumbs";
|
import Breadcrumbs from "../../../Components/Breadcrumbs";
|
||||||
@@ -37,7 +43,7 @@ const StatBox = ({ title, value }) => {
|
|||||||
mb={theme.spacing(2)}
|
mb={theme.spacing(2)}
|
||||||
fontSize={14}
|
fontSize={14}
|
||||||
fontWeight={500}
|
fontWeight={500}
|
||||||
color={theme.palette.common.main}
|
color={theme.palette.primary.main}
|
||||||
sx={{
|
sx={{
|
||||||
"& span": {
|
"& span": {
|
||||||
color: theme.palette.text.accent,
|
color: theme.palette.text.accent,
|
||||||
@@ -237,28 +243,23 @@ const DetailsPage = ({ isAdmin }) => {
|
|||||||
</Box>
|
</Box>
|
||||||
{isAdmin && (
|
{isAdmin && (
|
||||||
<Button
|
<Button
|
||||||
level="tertiary"
|
variant="contained"
|
||||||
label="Configure"
|
color="secondary"
|
||||||
animate="rotate90"
|
|
||||||
img={
|
|
||||||
<SettingsIcon
|
|
||||||
style={{
|
|
||||||
minWidth: theme.spacing(10),
|
|
||||||
minHeight: theme.spacing(10),
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
}
|
|
||||||
onClick={() => navigate(`/monitors/configure/${monitorId}`)}
|
onClick={() => navigate(`/monitors/configure/${monitorId}`)}
|
||||||
sx={{
|
sx={{
|
||||||
ml: "auto",
|
ml: "auto",
|
||||||
alignSelf: "flex-end",
|
alignSelf: "flex-end",
|
||||||
backgroundColor: theme.palette.background.fill,
|
px: theme.spacing(5),
|
||||||
px: theme.spacing(6),
|
|
||||||
"& svg": {
|
"& svg": {
|
||||||
mr: theme.spacing(3),
|
mr: theme.spacing(3),
|
||||||
|
"& path": {
|
||||||
|
stroke: theme.palette.other.icon,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}}
|
}}
|
||||||
/>
|
>
|
||||||
|
<SettingsIcon /> Configure
|
||||||
|
</Button>
|
||||||
)}
|
)}
|
||||||
</Stack>
|
</Stack>
|
||||||
<Stack
|
<Stack
|
||||||
@@ -326,40 +327,28 @@ const DetailsPage = ({ isAdmin }) => {
|
|||||||
>
|
>
|
||||||
Response Times
|
Response Times
|
||||||
</Typography>
|
</Typography>
|
||||||
<ButtonGroup
|
<ButtonGroup>
|
||||||
sx={{
|
|
||||||
"& .MuiButtonBase-root": {
|
|
||||||
borderColor: theme.palette.border.light,
|
|
||||||
},
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<Button
|
<Button
|
||||||
level="secondary"
|
variant="group"
|
||||||
label="Day"
|
filled={(dateRange === "day").toString()}
|
||||||
onClick={() => setDateRange("day")}
|
onClick={() => setDateRange("day")}
|
||||||
sx={{
|
>
|
||||||
backgroundColor:
|
Day
|
||||||
dateRange === "day" && theme.palette.background.fill,
|
</Button>
|
||||||
}}
|
|
||||||
/>
|
|
||||||
<Button
|
<Button
|
||||||
level="secondary"
|
variant="group"
|
||||||
label="Week"
|
filled={(dateRange === "week").toString()}
|
||||||
onClick={() => setDateRange("week")}
|
onClick={() => setDateRange("week")}
|
||||||
sx={{
|
>
|
||||||
backgroundColor:
|
Week
|
||||||
dateRange === "week" && theme.palette.background.fill,
|
</Button>
|
||||||
}}
|
|
||||||
/>
|
|
||||||
<Button
|
<Button
|
||||||
level="secondary"
|
variant="group"
|
||||||
label="Month"
|
filled={(dateRange === "month").toString()}
|
||||||
onClick={() => setDateRange("month")}
|
onClick={() => setDateRange("month")}
|
||||||
sx={{
|
>
|
||||||
backgroundColor:
|
Month
|
||||||
dateRange === "month" && theme.palette.background.fill,
|
</Button>
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</ButtonGroup>
|
</ButtonGroup>
|
||||||
</Stack>
|
</Stack>
|
||||||
<Box
|
<Box
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import { useTheme } from "@emotion/react";
|
|||||||
import { useNavigate } from "react-router-dom";
|
import { useNavigate } from "react-router-dom";
|
||||||
import { createToast } from "../../../Utils/toastUtils";
|
import { createToast } from "../../../Utils/toastUtils";
|
||||||
import {
|
import {
|
||||||
|
Button,
|
||||||
IconButton,
|
IconButton,
|
||||||
Menu,
|
Menu,
|
||||||
MenuItem,
|
MenuItem,
|
||||||
@@ -16,7 +17,6 @@ import {
|
|||||||
getUptimeMonitorsByTeamId,
|
getUptimeMonitorsByTeamId,
|
||||||
} from "../../../Features/UptimeMonitors/uptimeMonitorsSlice";
|
} from "../../../Features/UptimeMonitors/uptimeMonitorsSlice";
|
||||||
import Settings from "../../../assets/icons/settings-bold.svg?react";
|
import Settings from "../../../assets/icons/settings-bold.svg?react";
|
||||||
import Button from "../../../Components/Button";
|
|
||||||
import PropTypes from "prop-types";
|
import PropTypes from "prop-types";
|
||||||
|
|
||||||
const ActionsMenu = ({ monitor, isAdmin }) => {
|
const ActionsMenu = ({ monitor, isAdmin }) => {
|
||||||
@@ -189,21 +189,25 @@ const ActionsMenu = ({ monitor, isAdmin }) => {
|
|||||||
justifyContent="flex-end"
|
justifyContent="flex-end"
|
||||||
>
|
>
|
||||||
<Button
|
<Button
|
||||||
level="tertiary"
|
variant="text"
|
||||||
label="Cancel"
|
color="info"
|
||||||
onClick={(e) => {
|
onClick={(e) => {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
setIsOpen(false);
|
setIsOpen(false);
|
||||||
}}
|
}}
|
||||||
/>
|
>
|
||||||
|
Cancel
|
||||||
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
level="error"
|
variant="contained"
|
||||||
label="Delete"
|
color="error"
|
||||||
onClick={(e) => {
|
onClick={(e) => {
|
||||||
e.stopPropagation(e);
|
e.stopPropagation(e);
|
||||||
handleRemove(e);
|
handleRemove(e);
|
||||||
}}
|
}}
|
||||||
/>
|
>
|
||||||
|
Delete
|
||||||
|
</Button>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Modal>
|
</Modal>
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import { Stack, Typography } from "@mui/material";
|
import { Button, Stack, Typography } from "@mui/material";
|
||||||
import { useTheme } from "@emotion/react";
|
import { useTheme } from "@emotion/react";
|
||||||
import Button from "../../../Components/Button";
|
|
||||||
import { useNavigate } from "react-router-dom";
|
import { useNavigate } from "react-router-dom";
|
||||||
import PropTypes from "prop-types";
|
import PropTypes from "prop-types";
|
||||||
|
|
||||||
@@ -25,13 +24,15 @@ const Fallback = ({ isAdmin }) => {
|
|||||||
</Typography>
|
</Typography>
|
||||||
{isAdmin && (
|
{isAdmin && (
|
||||||
<Button
|
<Button
|
||||||
level="primary"
|
variant="contained"
|
||||||
label="Create your first monitor"
|
color="primary"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
navigate("/monitors/create");
|
navigate("/monitors/create");
|
||||||
}}
|
}}
|
||||||
sx={{ mt: theme.spacing(12) }}
|
sx={{ mt: theme.spacing(12) }}
|
||||||
/>
|
>
|
||||||
|
Create your first monitor
|
||||||
|
</Button>
|
||||||
)}
|
)}
|
||||||
</Stack>
|
</Stack>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -3,10 +3,9 @@ import { useEffect } from "react";
|
|||||||
import { useSelector, useDispatch } from "react-redux";
|
import { useSelector, useDispatch } from "react-redux";
|
||||||
import { getUptimeMonitorsByTeamId } from "../../../Features/UptimeMonitors/uptimeMonitorsSlice";
|
import { getUptimeMonitorsByTeamId } from "../../../Features/UptimeMonitors/uptimeMonitorsSlice";
|
||||||
import { useNavigate } from "react-router-dom";
|
import { useNavigate } from "react-router-dom";
|
||||||
import Button from "../../../Components/Button";
|
|
||||||
import { useTheme } from "@emotion/react";
|
import { useTheme } from "@emotion/react";
|
||||||
import BasicTable from "../../../Components/BasicTable";
|
import BasicTable from "../../../Components/BasicTable";
|
||||||
import { Box, Stack, Typography } from "@mui/material";
|
import { Box, Button, Stack, Typography } from "@mui/material";
|
||||||
import PropTypes from "prop-types";
|
import PropTypes from "prop-types";
|
||||||
import SkeletonLayout from "./skeleton";
|
import SkeletonLayout from "./skeleton";
|
||||||
import Fallback from "./fallback";
|
import Fallback from "./fallback";
|
||||||
@@ -77,13 +76,15 @@ const Monitors = ({ isAdmin }) => {
|
|||||||
<Greeting type="uptime" />
|
<Greeting type="uptime" />
|
||||||
{monitorState.monitors?.length !== 0 && (
|
{monitorState.monitors?.length !== 0 && (
|
||||||
<Button
|
<Button
|
||||||
level="primary"
|
variant="contained"
|
||||||
label="Create monitor"
|
color="primary"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
navigate("/monitors/create");
|
navigate("/monitors/create");
|
||||||
}}
|
}}
|
||||||
sx={{ fontWeight: 500 }}
|
sx={{ fontWeight: 500 }}
|
||||||
/>
|
>
|
||||||
|
Create monitor
|
||||||
|
</Button>
|
||||||
)}
|
)}
|
||||||
</Stack>
|
</Stack>
|
||||||
</Box>
|
</Box>
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
import Button from "../../Components/Button";
|
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import PropTypes from "prop-types";
|
import PropTypes from "prop-types";
|
||||||
import NotFoundSvg from "../../../src/assets/Images/sushi_404.svg";
|
import NotFoundSvg from "../../../src/assets/Images/sushi_404.svg";
|
||||||
import { Stack, Typography } from "@mui/material";
|
import { Button, Stack, Typography } from "@mui/material";
|
||||||
import { useNavigate } from "react-router";
|
import { useNavigate } from "react-router";
|
||||||
import { useTheme } from "@emotion/react";
|
import { useTheme } from "@emotion/react";
|
||||||
|
|
||||||
@@ -48,11 +47,13 @@ const NotFound = ({ title = DefaultValue.title, desc = DefaultValue.desc }) => {
|
|||||||
</Typography>
|
</Typography>
|
||||||
<Typography fontSize={13}>{desc}</Typography>
|
<Typography fontSize={13}>{desc}</Typography>
|
||||||
<Button
|
<Button
|
||||||
label="Go to the main dashboard"
|
variant="contained"
|
||||||
level="primary"
|
color="primary"
|
||||||
sx={{ mt: theme.spacing(10) }}
|
sx={{ mt: theme.spacing(10) }}
|
||||||
onClick={() => navigate("/")}
|
onClick={() => navigate("/")}
|
||||||
/>
|
>
|
||||||
|
Go to the main dashboard
|
||||||
|
</Button>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Stack>
|
</Stack>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { useTheme } from "@emotion/react";
|
import { useTheme } from "@emotion/react";
|
||||||
import { Box, Modal, Skeleton, Stack, Typography } from "@mui/material";
|
import { Box, Button, Modal, Skeleton, Stack, Typography } from "@mui/material";
|
||||||
import { useDispatch, useSelector } from "react-redux";
|
import { useDispatch, useSelector } from "react-redux";
|
||||||
import { useNavigate, useParams } from "react-router";
|
import { useNavigate, useParams } from "react-router";
|
||||||
import {
|
import {
|
||||||
@@ -11,7 +11,6 @@ import {
|
|||||||
import { monitorValidation } from "../../../Validation/validation";
|
import { monitorValidation } from "../../../Validation/validation";
|
||||||
import { createToast } from "../../../Utils/toastUtils";
|
import { createToast } from "../../../Utils/toastUtils";
|
||||||
import { logger } from "../../../Utils/Logger";
|
import { logger } from "../../../Utils/Logger";
|
||||||
import Button from "../../../Components/Button";
|
|
||||||
import Field from "../../../Components/Inputs/Field";
|
import Field from "../../../Components/Inputs/Field";
|
||||||
import Select from "../../../Components/Inputs/Select";
|
import Select from "../../../Components/Inputs/Select";
|
||||||
import Checkbox from "../../../Components/Inputs/Checkbox";
|
import Checkbox from "../../../Components/Inputs/Checkbox";
|
||||||
@@ -197,29 +196,33 @@ const PageSpeedConfigure = () => {
|
|||||||
</Box>
|
</Box>
|
||||||
<Box alignSelf="flex-end" ml="auto">
|
<Box alignSelf="flex-end" ml="auto">
|
||||||
<Button
|
<Button
|
||||||
level="tertiary"
|
variant="contained"
|
||||||
label="Pause"
|
color="secondary"
|
||||||
animate="rotate180"
|
|
||||||
img={<PauseCircleOutlineIcon />}
|
|
||||||
sx={{
|
sx={{
|
||||||
backgroundColor: theme.palette.background.fill,
|
|
||||||
pl: theme.spacing(4),
|
pl: theme.spacing(4),
|
||||||
pr: theme.spacing(6),
|
pr: theme.spacing(6),
|
||||||
"& svg": {
|
"& svg": {
|
||||||
mr: theme.spacing(2),
|
mr: theme.spacing(2),
|
||||||
|
"& path": {
|
||||||
|
stroke: theme.palette.other.icon,
|
||||||
|
strokeWidth: 0.1,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}}
|
}}
|
||||||
/>
|
>
|
||||||
|
<PauseCircleOutlineIcon />
|
||||||
|
Pause
|
||||||
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
level="error"
|
variant="contained"
|
||||||
label="Remove"
|
color="error"
|
||||||
|
onClick={() => setIsOpen(true)}
|
||||||
sx={{
|
sx={{
|
||||||
boxShadow: "none",
|
|
||||||
px: theme.spacing(8),
|
|
||||||
ml: theme.spacing(6),
|
ml: theme.spacing(6),
|
||||||
}}
|
}}
|
||||||
onClick={() => setIsOpen(true)}
|
>
|
||||||
/>
|
Remove
|
||||||
|
</Button>
|
||||||
</Box>
|
</Box>
|
||||||
</Stack>
|
</Stack>
|
||||||
<Stack
|
<Stack
|
||||||
@@ -321,11 +324,13 @@ const PageSpeedConfigure = () => {
|
|||||||
<Stack direction="row" justifyContent="flex-end" mt="auto">
|
<Stack direction="row" justifyContent="flex-end" mt="auto">
|
||||||
<Button
|
<Button
|
||||||
type="submit"
|
type="submit"
|
||||||
level="primary"
|
variant="contained"
|
||||||
label="Save"
|
color="primary"
|
||||||
onClick={handleSave}
|
onClick={handleSave}
|
||||||
sx={{ px: theme.spacing(12), mt: theme.spacing(12) }}
|
sx={{ px: theme.spacing(12) }}
|
||||||
/>
|
>
|
||||||
|
Save
|
||||||
|
</Button>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Stack>
|
</Stack>
|
||||||
</>
|
</>
|
||||||
@@ -376,11 +381,15 @@ const PageSpeedConfigure = () => {
|
|||||||
justifyContent="flex-end"
|
justifyContent="flex-end"
|
||||||
>
|
>
|
||||||
<Button
|
<Button
|
||||||
level="tertiary"
|
variant="text"
|
||||||
label="Cancel"
|
color="info"
|
||||||
onClick={() => setIsOpen(false)}
|
onClick={() => setIsOpen(false)}
|
||||||
/>
|
>
|
||||||
<Button level="error" label="Delete" onClick={handleRemove} />
|
Cancel
|
||||||
|
</Button>
|
||||||
|
<Button variant="contained" color="error" onClick={handleRemove}>
|
||||||
|
Delete
|
||||||
|
</Button>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Modal>
|
</Modal>
|
||||||
|
|||||||
@@ -22,6 +22,7 @@
|
|||||||
.create-page-speed .section-disabled {
|
.create-page-speed .section-disabled {
|
||||||
opacity: 0.4;
|
opacity: 0.4;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
|
margin-right: -5px;
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
user-select: none;
|
user-select: none;
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
|
|||||||
@@ -1,11 +1,10 @@
|
|||||||
import { Box, Stack, Typography } from "@mui/material";
|
import { Box, Button, Stack, Typography } from "@mui/material";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { useTheme } from "@emotion/react";
|
import { useTheme } from "@emotion/react";
|
||||||
import { useDispatch, useSelector } from "react-redux";
|
import { useDispatch, useSelector } from "react-redux";
|
||||||
import { useNavigate } from "react-router";
|
import { useNavigate } from "react-router";
|
||||||
import Field from "../../../Components/Inputs/Field";
|
import Field from "../../../Components/Inputs/Field";
|
||||||
import Select from "../../../Components/Inputs/Select";
|
import Select from "../../../Components/Inputs/Select";
|
||||||
import Button from "../../../Components/Button";
|
|
||||||
import Checkbox from "../../../Components/Inputs/Checkbox";
|
import Checkbox from "../../../Components/Inputs/Checkbox";
|
||||||
import { monitorValidation } from "../../../Validation/validation";
|
import { monitorValidation } from "../../../Validation/validation";
|
||||||
import { createToast } from "../../../Utils/toastUtils";
|
import { createToast } from "../../../Utils/toastUtils";
|
||||||
@@ -229,11 +228,13 @@ const CreatePageSpeed = () => {
|
|||||||
<Stack direction="row" justifyContent="flex-end" mt="auto">
|
<Stack direction="row" justifyContent="flex-end" mt="auto">
|
||||||
<Button
|
<Button
|
||||||
type="submit"
|
type="submit"
|
||||||
level="primary"
|
variant="contained"
|
||||||
label="Create"
|
color="primary"
|
||||||
onClick={handleCreate}
|
onClick={handleCreate}
|
||||||
sx={{ px: theme.spacing(12), mt: theme.spacing(12) }}
|
sx={{ px: theme.spacing(12), mt: theme.spacing(12) }}
|
||||||
/>
|
>
|
||||||
|
Create
|
||||||
|
</Button>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Stack>
|
</Stack>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import PropTypes from "prop-types";
|
import PropTypes from "prop-types";
|
||||||
import { Box, Skeleton, Stack, Typography } from "@mui/material";
|
import { Box, Button, Skeleton, Stack, Typography } from "@mui/material";
|
||||||
import { PieChart } from "@mui/x-charts/PieChart";
|
import { PieChart } from "@mui/x-charts/PieChart";
|
||||||
import { useDrawingArea } from "@mui/x-charts";
|
import { useDrawingArea } from "@mui/x-charts";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
@@ -12,7 +12,6 @@ import {
|
|||||||
} from "../../../Utils/timeUtils";
|
} from "../../../Utils/timeUtils";
|
||||||
import { logger } from "../../../Utils/Logger";
|
import { logger } from "../../../Utils/Logger";
|
||||||
import { networkService } from "../../../main";
|
import { networkService } from "../../../main";
|
||||||
import Button from "../../../Components/Button";
|
|
||||||
import SettingsIcon from "../../../assets/icons/settings-bold.svg?react";
|
import SettingsIcon from "../../../assets/icons/settings-bold.svg?react";
|
||||||
import LastCheckedIcon from "../../../assets/icons/calendar-check.svg?react";
|
import LastCheckedIcon from "../../../assets/icons/calendar-check.svg?react";
|
||||||
import ClockIcon from "../../../assets/icons/maintenance.svg?react";
|
import ClockIcon from "../../../assets/icons/maintenance.svg?react";
|
||||||
@@ -43,7 +42,7 @@ const StatBox = ({ icon, title, value }) => {
|
|||||||
<Box>
|
<Box>
|
||||||
<Typography
|
<Typography
|
||||||
variant="h6"
|
variant="h6"
|
||||||
color={theme.palette.common.main}
|
color={theme.palette.primary.main}
|
||||||
mb={theme.spacing(6)}
|
mb={theme.spacing(6)}
|
||||||
>
|
>
|
||||||
{title}
|
{title}
|
||||||
@@ -398,28 +397,24 @@ const PageSpeedDetails = () => {
|
|||||||
</Typography>
|
</Typography>
|
||||||
</Box>
|
</Box>
|
||||||
<Button
|
<Button
|
||||||
level="tertiary"
|
variant="contained"
|
||||||
label="Configure"
|
color="secondary"
|
||||||
animate="rotate90"
|
|
||||||
img={
|
|
||||||
<SettingsIcon
|
|
||||||
style={{
|
|
||||||
width: theme.spacing(10),
|
|
||||||
height: theme.spacing(10),
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
}
|
|
||||||
onClick={() => navigate(`/pagespeed/configure/${monitorId}`)}
|
onClick={() => navigate(`/pagespeed/configure/${monitorId}`)}
|
||||||
sx={{
|
sx={{
|
||||||
ml: "auto",
|
ml: "auto",
|
||||||
alignSelf: "flex-end",
|
alignSelf: "flex-end",
|
||||||
backgroundColor: theme.palette.background.fill,
|
px: theme.spacing(5),
|
||||||
px: theme.spacing(6),
|
|
||||||
"& svg": {
|
"& svg": {
|
||||||
mr: "6px",
|
mr: theme.spacing(3),
|
||||||
|
"& path": {
|
||||||
|
stroke: theme.palette.other.icon,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}}
|
}}
|
||||||
/>
|
>
|
||||||
|
<SettingsIcon />
|
||||||
|
Configure
|
||||||
|
</Button>
|
||||||
</Stack>
|
</Stack>
|
||||||
<Stack
|
<Stack
|
||||||
direction="row"
|
direction="row"
|
||||||
@@ -592,7 +587,7 @@ const PageSpeedDetails = () => {
|
|||||||
<Typography
|
<Typography
|
||||||
component="span"
|
component="span"
|
||||||
sx={{
|
sx={{
|
||||||
color: theme.palette.common.main,
|
color: theme.palette.primary.main,
|
||||||
fontWeight: 500,
|
fontWeight: 500,
|
||||||
textDecoration: "underline",
|
textDecoration: "underline",
|
||||||
cursor: "pointer",
|
cursor: "pointer",
|
||||||
@@ -627,7 +622,7 @@ const PageSpeedDetails = () => {
|
|||||||
<Typography
|
<Typography
|
||||||
component="span"
|
component="span"
|
||||||
sx={{
|
sx={{
|
||||||
color: theme.palette.common.main,
|
color: theme.palette.primary.main,
|
||||||
fontWeight: 500,
|
fontWeight: 500,
|
||||||
textDecoration: "underline",
|
textDecoration: "underline",
|
||||||
cursor: "pointer",
|
cursor: "pointer",
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { Box, Grid, Skeleton, Stack, Typography } from "@mui/material";
|
import { Box, Button, Grid, Skeleton, Stack, Typography } from "@mui/material";
|
||||||
import { useEffect } from "react";
|
import { useEffect } from "react";
|
||||||
import { useTheme } from "@emotion/react";
|
import { useTheme } from "@emotion/react";
|
||||||
import { formatDate, formatDurationRounded } from "../../Utils/timeUtils";
|
import { formatDate, formatDurationRounded } from "../../Utils/timeUtils";
|
||||||
@@ -8,7 +8,6 @@ import { getPageSpeedByTeamId } from "../../Features/PageSpeedMonitor/pageSpeedM
|
|||||||
import PageSpeedIcon from "../../assets/icons/page-speed.svg?react";
|
import PageSpeedIcon from "../../assets/icons/page-speed.svg?react";
|
||||||
import Fallback from "../../Components/Fallback";
|
import Fallback from "../../Components/Fallback";
|
||||||
import "./index.css";
|
import "./index.css";
|
||||||
import Button from "../../Components/Button";
|
|
||||||
import { useNavigate } from "react-router";
|
import { useNavigate } from "react-router";
|
||||||
import { getLastChecked } from "../../Utils/monitorUtils";
|
import { getLastChecked } from "../../Utils/monitorUtils";
|
||||||
import PropTypes from "prop-types";
|
import PropTypes from "prop-types";
|
||||||
@@ -52,7 +51,7 @@ const Card = ({ data }) => {
|
|||||||
<Typography
|
<Typography
|
||||||
component="h2"
|
component="h2"
|
||||||
mb={theme.spacing(2)}
|
mb={theme.spacing(2)}
|
||||||
color={theme.palette.common.main}
|
color={theme.palette.primary.main}
|
||||||
>
|
>
|
||||||
{data.name}
|
{data.name}
|
||||||
</Typography>
|
</Typography>
|
||||||
@@ -196,10 +195,12 @@ const PageSpeed = ({ isAdmin }) => {
|
|||||||
>
|
>
|
||||||
<Greeting type="pagespeed" />
|
<Greeting type="pagespeed" />
|
||||||
<Button
|
<Button
|
||||||
level="primary"
|
variant="contained"
|
||||||
label="Create new"
|
color="primary"
|
||||||
onClick={() => navigate("/pagespeed/create")}
|
onClick={() => navigate("/pagespeed/create")}
|
||||||
/>
|
>
|
||||||
|
Create new
|
||||||
|
</Button>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Box>
|
</Box>
|
||||||
<Grid container spacing={theme.spacing(12)}>
|
<Grid container spacing={theme.spacing(12)}>
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
import { useTheme } from "@emotion/react";
|
import { useTheme } from "@emotion/react";
|
||||||
import { Box, Stack, styled, Typography } from "@mui/material";
|
import { Box, Button, Stack, styled, Typography } from "@mui/material";
|
||||||
import Button from "../../Components/Button";
|
|
||||||
import ButtonSpinner from "../../Components/ButtonSpinner";
|
|
||||||
import Field from "../../Components/Inputs/Field";
|
import Field from "../../Components/Inputs/Field";
|
||||||
import Link from "../../Components/Link";
|
import Link from "../../Components/Link";
|
||||||
import Select from "../../Components/Inputs/Select";
|
import Select from "../../Components/Inputs/Select";
|
||||||
@@ -11,6 +9,7 @@ import { useDispatch, useSelector } from "react-redux";
|
|||||||
import { createToast } from "../../Utils/toastUtils";
|
import { createToast } from "../../Utils/toastUtils";
|
||||||
import { deleteMonitorChecksByTeamId } from "../../Features/UptimeMonitors/uptimeMonitorsSlice";
|
import { deleteMonitorChecksByTeamId } from "../../Features/UptimeMonitors/uptimeMonitorsSlice";
|
||||||
import PropTypes from "prop-types";
|
import PropTypes from "prop-types";
|
||||||
|
import LoadingButton from "@mui/lab/LoadingButton";
|
||||||
const Settings = ({ isAdmin }) => {
|
const Settings = ({ isAdmin }) => {
|
||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
const { user, authToken } = useSelector((state) => state.auth);
|
const { user, authToken } = useSelector((state) => state.auth);
|
||||||
@@ -125,13 +124,15 @@ const Settings = ({ isAdmin }) => {
|
|||||||
/>
|
/>
|
||||||
<Box>
|
<Box>
|
||||||
<Typography>Clear all stats. This is irreversible.</Typography>
|
<Typography>Clear all stats. This is irreversible.</Typography>
|
||||||
<ButtonSpinner
|
<LoadingButton
|
||||||
isLoading={isLoading}
|
variant="contained"
|
||||||
level="error"
|
color="error"
|
||||||
label="Clear all stats"
|
loading={isLoading}
|
||||||
onClick={handleClearStats}
|
onClick={handleClearStats}
|
||||||
sx={{ mt: theme.spacing(4) }}
|
sx={{ mt: theme.spacing(4) }}
|
||||||
/>
|
>
|
||||||
|
Clear all stats
|
||||||
|
</LoadingButton>
|
||||||
</Box>
|
</Box>
|
||||||
</Stack>
|
</Stack>
|
||||||
</ConfigBox>
|
</ConfigBox>
|
||||||
@@ -156,10 +157,12 @@ const Settings = ({ isAdmin }) => {
|
|||||||
</ConfigBox>
|
</ConfigBox>
|
||||||
<Stack direction="row" justifyContent="flex-end">
|
<Stack direction="row" justifyContent="flex-end">
|
||||||
<Button
|
<Button
|
||||||
level="primary"
|
variant="contained"
|
||||||
label="Save"
|
color="primary"
|
||||||
sx={{ px: theme.spacing(12), mt: theme.spacing(20) }}
|
sx={{ px: theme.spacing(12), mt: theme.spacing(20) }}
|
||||||
/>
|
>
|
||||||
|
Save
|
||||||
|
</Button>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Box>
|
</Box>
|
||||||
|
|||||||
@@ -24,13 +24,14 @@ const darkTheme = createTheme({
|
|||||||
typography: { fontFamily: fontFamilyDefault, fontSize: 13 },
|
typography: { fontFamily: fontFamilyDefault, fontSize: 13 },
|
||||||
palette: {
|
palette: {
|
||||||
mode: "dark",
|
mode: "dark",
|
||||||
common: { main: "#1570ef" },
|
primary: { main: "#1570ef" },
|
||||||
|
secondary: { main: "#2e2e2e" },
|
||||||
text: text,
|
text: text,
|
||||||
background: background,
|
background: background,
|
||||||
border: border,
|
border: border,
|
||||||
info: {
|
info: {
|
||||||
text: text.primary,
|
text: text.primary,
|
||||||
main: text.primary,
|
main: text.secondary,
|
||||||
bg: background.main,
|
bg: background.main,
|
||||||
light: background.main,
|
light: background.main,
|
||||||
border: border.light,
|
border: border.light,
|
||||||
@@ -46,6 +47,7 @@ const darkTheme = createTheme({
|
|||||||
main: "#d32f2f",
|
main: "#d32f2f",
|
||||||
light: "#1e1e1e",
|
light: "#1e1e1e",
|
||||||
bg: "#27272a",
|
bg: "#27272a",
|
||||||
|
dark: "#932020",
|
||||||
border: "#f04438",
|
border: "#f04438",
|
||||||
},
|
},
|
||||||
warning: {
|
warning: {
|
||||||
@@ -63,29 +65,52 @@ const darkTheme = createTheme({
|
|||||||
fill: "#18181a",
|
fill: "#18181a",
|
||||||
grid: "#454546",
|
grid: "#454546",
|
||||||
},
|
},
|
||||||
// TO BE REMOVED //
|
|
||||||
primary: {
|
|
||||||
main: "#1570ef",
|
|
||||||
},
|
|
||||||
secondary: {
|
|
||||||
main: "#e6e6e6",
|
|
||||||
},
|
|
||||||
tertiary: {
|
|
||||||
main: "#e6e6e6",
|
|
||||||
},
|
|
||||||
// ----------------- //
|
|
||||||
},
|
},
|
||||||
spacing: 2,
|
spacing: 2,
|
||||||
components: {
|
components: {
|
||||||
MuiButtonBase: {
|
MuiButton: {
|
||||||
defaultProps: {
|
defaultProps: {
|
||||||
disableRipple: true,
|
disableRipple: true,
|
||||||
},
|
},
|
||||||
|
styleOverrides: {
|
||||||
|
root: ({ theme }) => ({
|
||||||
|
variants: [
|
||||||
|
{
|
||||||
|
props: (props) => props.variant === "group",
|
||||||
|
style: {
|
||||||
|
color: theme.palette.secondary.contrastText,
|
||||||
|
backgroundColor: theme.palette.background.main,
|
||||||
|
border: 1,
|
||||||
|
borderStyle: "solid",
|
||||||
|
borderColor: theme.palette.border.light,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
props: (props) =>
|
||||||
|
props.variant === "group" && props.filled === "true",
|
||||||
|
style: {
|
||||||
|
backgroundColor: theme.palette.secondary.main,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
fontWeight: 400,
|
||||||
|
borderRadius: 4,
|
||||||
|
boxShadow: "none",
|
||||||
|
textTransform: "none",
|
||||||
|
"&:focus": {
|
||||||
|
outline: "none",
|
||||||
|
},
|
||||||
|
"&:hover": {
|
||||||
|
boxShadow: "none",
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
},
|
||||||
},
|
},
|
||||||
MuiIconButton: {
|
MuiIconButton: {
|
||||||
styleOverrides: {
|
styleOverrides: {
|
||||||
root: {
|
root: {
|
||||||
padding: 4,
|
padding: 4,
|
||||||
|
transition: "none",
|
||||||
"&:hover": {
|
"&:hover": {
|
||||||
backgroundColor: background.fill,
|
backgroundColor: background.fill,
|
||||||
},
|
},
|
||||||
@@ -114,6 +139,13 @@ const darkTheme = createTheme({
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
MuiListItemButton: {
|
||||||
|
styleOverrides: {
|
||||||
|
root: {
|
||||||
|
transition: "none",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
MuiMenuItem: {
|
MuiMenuItem: {
|
||||||
styleOverrides: {
|
styleOverrides: {
|
||||||
root: {
|
root: {
|
||||||
|
|||||||
@@ -22,16 +22,17 @@ const shadow =
|
|||||||
const lightTheme = createTheme({
|
const lightTheme = createTheme({
|
||||||
typography: { fontFamily: fontFamilyDefault, fontSize: 13 },
|
typography: { fontFamily: fontFamilyDefault, fontSize: 13 },
|
||||||
palette: {
|
palette: {
|
||||||
common: { main: "#1570ef" },
|
primary: { main: "#1570EF" },
|
||||||
|
secondary: { main: "#F4F4F4", dark: "#e3e3e3", contrastText: "#475467" },
|
||||||
text: text,
|
text: text,
|
||||||
background: background,
|
background: background,
|
||||||
border: border,
|
border: border,
|
||||||
info: {
|
info: {
|
||||||
text: "#475467",
|
text: text.primary,
|
||||||
main: "#475467",
|
main: text.tertiary,
|
||||||
bg: "#ffffff",
|
bg: background.main,
|
||||||
light: "#ffffff",
|
light: background.main,
|
||||||
border: "#D0D5DD",
|
border: border.dark,
|
||||||
},
|
},
|
||||||
success: {
|
success: {
|
||||||
text: "#079455",
|
text: "#079455",
|
||||||
@@ -61,29 +62,52 @@ const lightTheme = createTheme({
|
|||||||
fill: "#e3e3e3",
|
fill: "#e3e3e3",
|
||||||
grid: "#a2a3a3",
|
grid: "#a2a3a3",
|
||||||
},
|
},
|
||||||
// TO BE REMOVED //
|
|
||||||
primary: {
|
|
||||||
main: "#1570EF",
|
|
||||||
},
|
|
||||||
secondary: {
|
|
||||||
main: "#475467",
|
|
||||||
},
|
|
||||||
tertiary: {
|
|
||||||
main: "#475467",
|
|
||||||
},
|
|
||||||
// ----------------- //
|
|
||||||
},
|
},
|
||||||
spacing: 2,
|
spacing: 2,
|
||||||
components: {
|
components: {
|
||||||
MuiButtonBase: {
|
MuiButton: {
|
||||||
defaultProps: {
|
defaultProps: {
|
||||||
disableRipple: true,
|
disableRipple: true,
|
||||||
},
|
},
|
||||||
|
styleOverrides: {
|
||||||
|
root: ({ theme }) => ({
|
||||||
|
variants: [
|
||||||
|
{
|
||||||
|
props: (props) => props.variant === "group",
|
||||||
|
style: {
|
||||||
|
color: theme.palette.secondary.contrastText,
|
||||||
|
backgroundColor: theme.palette.background.main,
|
||||||
|
border: 1,
|
||||||
|
borderStyle: "solid",
|
||||||
|
borderColor: theme.palette.border.light,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
props: (props) =>
|
||||||
|
props.variant === "group" && props.filled === "true",
|
||||||
|
style: {
|
||||||
|
backgroundColor: theme.palette.secondary.main,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
fontWeight: 400,
|
||||||
|
borderRadius: 4,
|
||||||
|
boxShadow: "none",
|
||||||
|
textTransform: "none",
|
||||||
|
"&:focus": {
|
||||||
|
outline: "none",
|
||||||
|
},
|
||||||
|
"&:hover": {
|
||||||
|
boxShadow: "none",
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
},
|
||||||
},
|
},
|
||||||
MuiIconButton: {
|
MuiIconButton: {
|
||||||
styleOverrides: {
|
styleOverrides: {
|
||||||
root: {
|
root: {
|
||||||
padding: 4,
|
padding: 4,
|
||||||
|
transition: "none",
|
||||||
"&:hover": {
|
"&:hover": {
|
||||||
backgroundColor: background.fill,
|
backgroundColor: background.fill,
|
||||||
},
|
},
|
||||||
@@ -110,6 +134,13 @@ const lightTheme = createTheme({
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
MuiListItemButton: {
|
||||||
|
styleOverrides: {
|
||||||
|
root: {
|
||||||
|
transition: "none",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
MuiMenuItem: {
|
MuiMenuItem: {
|
||||||
styleOverrides: {
|
styleOverrides: {
|
||||||
root: {
|
root: {
|
||||||
|
|||||||
Reference in new issue
Block a user