feat: updating texts
This commit is contained in:
1 parent
36bbf5aba0
commit
db86753701
54 files changed
+530
-341
No files matched your search
@@ -251,7 +251,7 @@ const BasicTable = ({ data, paginated, reversed, table, emptyMessage = "No data"
|
||||
px={theme.spacing(4)}
|
||||
sx={{
|
||||
"& p": {
|
||||
color: theme.palette.text.tertiary,
|
||||
color: theme.palette.primary.contrastText.tertiary,
|
||||
},
|
||||
}}
|
||||
>
|
||||
@@ -305,9 +305,9 @@ const BasicTable = ({ data, paginated, reversed, table, emptyMessage = "No data"
|
||||
}}
|
||||
sx={{
|
||||
mt: theme.spacing(6),
|
||||
color: theme.palette.text.secondary,
|
||||
color: theme.palette.primary.contrastText.secondary,
|
||||
"& svg path": {
|
||||
stroke: theme.palette.text.tertiary,
|
||||
stroke: theme.palette.primary.contrastText.tertiary,
|
||||
strokeWidth: 1.3,
|
||||
},
|
||||
"& .MuiSelect-select": {
|
||||
|
||||
@@ -52,7 +52,7 @@ const Breadcrumbs = ({ list }) => {
|
||||
opacity: 0.8,
|
||||
textTransform: "capitalize",
|
||||
"&, &:hover": {
|
||||
color: theme.palette.text.tertiary,
|
||||
color: theme.palette.primary.contrastText.tertiary,
|
||||
},
|
||||
}}
|
||||
>
|
||||
|
||||
@@ -124,12 +124,12 @@ const BarChart = ({ checks = [] }) => {
|
||||
},
|
||||
"& .MuiTooltip-tooltip p": {
|
||||
fontSize: 12,
|
||||
color: theme.palette.text.tertiary,
|
||||
color: theme.palette.primary.contrastText.tertiary,
|
||||
fontWeight: 500,
|
||||
},
|
||||
"& .MuiTooltip-tooltip span": {
|
||||
fontSize: 11,
|
||||
color: theme.palette.text.tertiary,
|
||||
color: theme.palette.primary.contrastText.tertiary,
|
||||
fontWeight: 600,
|
||||
},
|
||||
},
|
||||
|
||||
@@ -36,7 +36,7 @@ const CustomToolTip = ({ active, payload, label }) => {
|
||||
>
|
||||
<Typography
|
||||
sx={{
|
||||
color: theme.palette.text.tertiary,
|
||||
color: theme.palette.primary.contrastText.tertiary,
|
||||
fontSize: 12,
|
||||
fontWeight: 500,
|
||||
}}
|
||||
@@ -58,7 +58,7 @@ const CustomToolTip = ({ active, payload, label }) => {
|
||||
ml={theme.spacing(3)}
|
||||
sx={{
|
||||
"& span": {
|
||||
color: theme.palette.text.tertiary,
|
||||
color: theme.palette.primary.contrastText.tertiary,
|
||||
fontSize: 11,
|
||||
fontWeight: 500,
|
||||
},
|
||||
@@ -114,7 +114,7 @@ const CustomTick = ({ x, y, payload, index }) => {
|
||||
x={x}
|
||||
y={y + 10}
|
||||
textAnchor="middle"
|
||||
fill={theme.palette.text.tertiary}
|
||||
fill={theme.palette.primary.contrastText.tertiary}
|
||||
fontSize={11}
|
||||
fontWeight={400}
|
||||
>
|
||||
|
||||
@@ -23,7 +23,7 @@ export const TzTick = ({ x, y, payload, index }) => {
|
||||
x={x}
|
||||
y={y + 10}
|
||||
textAnchor="middle"
|
||||
fill={theme.palette.text.tertiary}
|
||||
fill={theme.palette.primary.contrastText.tertiary}
|
||||
fontSize={11}
|
||||
fontWeight={400}
|
||||
>
|
||||
@@ -57,7 +57,7 @@ export const PercentTick = ({ x, y, payload, index }) => {
|
||||
x={x - 20}
|
||||
y={y}
|
||||
textAnchor="middle"
|
||||
fill={theme.palette.text.tertiary}
|
||||
fill={theme.palette.primary.contrastText.tertiary}
|
||||
fontSize={11}
|
||||
fontWeight={400}
|
||||
>
|
||||
@@ -128,7 +128,7 @@ export const InfrastructureTooltip = ({
|
||||
>
|
||||
<Typography
|
||||
sx={{
|
||||
color: theme.palette.text.tertiary,
|
||||
color: theme.palette.primary.contrastText.tertiary,
|
||||
fontSize: 12,
|
||||
fontWeight: 500,
|
||||
}}
|
||||
@@ -150,7 +150,7 @@ export const InfrastructureTooltip = ({
|
||||
ml={theme.spacing(3)}
|
||||
sx={{
|
||||
"& span": {
|
||||
color: theme.palette.text.tertiary,
|
||||
color: theme.palette.primary.contrastText.tertiary,
|
||||
fontSize: 11,
|
||||
fontWeight: 500,
|
||||
},
|
||||
@@ -208,7 +208,7 @@ export const TemperatureTooltip = ({ active, payload, label, keys, dotColor }) =
|
||||
>
|
||||
<Typography
|
||||
sx={{
|
||||
color: theme.palette.text.tertiary,
|
||||
color: theme.palette.primary.contrastText.tertiary,
|
||||
fontSize: 12,
|
||||
fontWeight: 500,
|
||||
}}
|
||||
@@ -227,7 +227,7 @@ export const TemperatureTooltip = ({ active, payload, label, keys, dotColor }) =
|
||||
ml={theme.spacing(3)}
|
||||
sx={{
|
||||
"& span": {
|
||||
color: theme.palette.text.tertiary,
|
||||
color: theme.palette.primary.contrastText.tertiary,
|
||||
fontSize: 11,
|
||||
fontWeight: 500,
|
||||
},
|
||||
|
||||
@@ -49,7 +49,10 @@ const Check = ({ text, noHighlightText, variant = "info", outlined = false }) =>
|
||||
<Typography
|
||||
component="span"
|
||||
sx={{
|
||||
color: variant === "info" ? theme.palette.text.tertiary : colors[variant],
|
||||
color:
|
||||
variant === "info"
|
||||
? theme.palette.primary.contrastText.tertiary
|
||||
: colors[variant],
|
||||
opacity: 0.8,
|
||||
}}
|
||||
>
|
||||
|
||||
@@ -28,10 +28,10 @@ const ConfigBox = styled(Stack)(({ theme }) => ({
|
||||
paddingLeft: theme.spacing(18),
|
||||
},
|
||||
"& h1, & h2": {
|
||||
color: theme.palette.text.secondary,
|
||||
color: theme.palette.primary.contrastText.secondary,
|
||||
},
|
||||
"& p": {
|
||||
color: theme.palette.text.tertiary,
|
||||
color: theme.palette.primary.contrastText.tertiary,
|
||||
},
|
||||
}));
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ const GenericDialog = ({ title, description, open, onClose, theme, children }) =
|
||||
id={titleId}
|
||||
component="h2"
|
||||
fontSize={16}
|
||||
color={theme.palette.text.primary}
|
||||
color={theme.palette.primary.contrastText.main}
|
||||
fontWeight={600}
|
||||
>
|
||||
{title}
|
||||
@@ -45,7 +45,7 @@ const GenericDialog = ({ title, description, open, onClose, theme, children }) =
|
||||
{description && (
|
||||
<Typography
|
||||
id={descriptionId}
|
||||
color={theme.palette.text.tertiary}
|
||||
color={theme.palette.primary.contrastText.tertiary}
|
||||
>
|
||||
{description}
|
||||
</Typography>
|
||||
|
||||
@@ -54,7 +54,7 @@ const Fallback = ({ title, checks, link = "/", isAdmin, vowelStart = false }) =>
|
||||
<Typography
|
||||
component="h1"
|
||||
marginY={theme.spacing(4)}
|
||||
color={theme.palette.text.tertiary}
|
||||
color={theme.palette.primary.contrastText.tertiary}
|
||||
>
|
||||
{vowelStart ? "An" : "A"} {title} is used to:
|
||||
</Typography>
|
||||
|
||||
@@ -59,7 +59,7 @@ const IconBox = styled(Box)(
|
||||
width: svgWidth,
|
||||
height: svgHeight,
|
||||
"& path": {
|
||||
stroke: theme.palette.text.tertiary,
|
||||
stroke: theme.palette.primary.contrastText.tertiary,
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
@@ -94,10 +94,10 @@ const Checkbox = ({
|
||||
},
|
||||
"& span.MuiTypography-root": {
|
||||
fontSize: 13,
|
||||
color: theme.palette.text.tertiary,
|
||||
color: theme.palette.primary.contrastText.tertiary,
|
||||
},
|
||||
".MuiFormControlLabel-label.Mui-disabled": {
|
||||
color: theme.palette.text.tertiary,
|
||||
color: theme.palette.primary.contrastText.tertiary,
|
||||
opacity: 0.25,
|
||||
},
|
||||
}}
|
||||
|
||||
@@ -94,7 +94,7 @@ const ImageField = ({ id, src, loading, onChange }) => {
|
||||
</IconButton>
|
||||
<Typography
|
||||
component="h2"
|
||||
color={theme.palette.text.tertiary}
|
||||
color={theme.palette.primary.contrastText.tertiary}
|
||||
>
|
||||
<Typography
|
||||
component="span"
|
||||
@@ -108,7 +108,7 @@ const ImageField = ({ id, src, loading, onChange }) => {
|
||||
</Typography>
|
||||
<Typography
|
||||
component="p"
|
||||
color={theme.palette.text.tertiary}
|
||||
color={theme.palette.primary.contrastText.tertiary}
|
||||
sx={{ opacity: 0.6 }}
|
||||
>
|
||||
(maximum size: 3MB)
|
||||
@@ -117,7 +117,7 @@ const ImageField = ({ id, src, loading, onChange }) => {
|
||||
</Box>
|
||||
<Typography
|
||||
component="p"
|
||||
color={theme.palette.text.tertiary}
|
||||
color={theme.palette.primary.contrastText.tertiary}
|
||||
sx={{ opacity: 0.6 }}
|
||||
>
|
||||
Supported formats: JPG, PNG
|
||||
|
||||
@@ -43,7 +43,7 @@ const Radio = (props) => {
|
||||
height: 16,
|
||||
boxShadow: `inset 0 0 0 1px ${theme.palette.secondary.main}`,
|
||||
"&:not(.Mui-checked)": {
|
||||
boxShadow: `inset 0 0 0 1px ${theme.palette.text.primary}70`, // Use theme text color for the outline
|
||||
boxShadow: `inset 0 0 0 1px ${theme.palette.primary.contrastText.main}70`, // Use theme text color for the outline
|
||||
},
|
||||
mt: theme.spacing(0.5),
|
||||
}}
|
||||
@@ -56,7 +56,7 @@ const Radio = (props) => {
|
||||
<Typography
|
||||
component="h6"
|
||||
mt={theme.spacing(1)}
|
||||
color={theme.palette.text.secondary}
|
||||
color={theme.palette.primary.contrastText.secondary}
|
||||
>
|
||||
{props.desc}
|
||||
</Typography>
|
||||
|
||||
@@ -27,7 +27,7 @@ const SearchAdornment = () => {
|
||||
width: 16,
|
||||
height: 16,
|
||||
"& path": {
|
||||
stroke: theme.palette.text.tertiary,
|
||||
stroke: theme.palette.primary.contrastText.tertiary,
|
||||
strokeWidth: 1.2,
|
||||
},
|
||||
},
|
||||
@@ -80,7 +80,7 @@ const Search = ({
|
||||
<Typography
|
||||
component="h3"
|
||||
fontSize={"var(--env-var-font-size-medium)"}
|
||||
color={theme.palette.text.secondary}
|
||||
color={theme.palette.primary.contrastText.secondary}
|
||||
fontWeight={500}
|
||||
>
|
||||
{label}
|
||||
@@ -157,7 +157,7 @@ const Search = ({
|
||||
sx: {
|
||||
"& ul": { p: 2 },
|
||||
"& li.MuiAutocomplete-option": {
|
||||
color: theme.palette.text.secondary,
|
||||
color: theme.palette.primary.contrastText.secondary,
|
||||
px: 4,
|
||||
borderRadius: theme.shape.borderRadius,
|
||||
},
|
||||
|
||||
@@ -54,11 +54,11 @@ const Select = ({
|
||||
const theme = useTheme();
|
||||
const itemStyles = {
|
||||
fontSize: "var(--env-var-font-size-medium)",
|
||||
color: theme.palette.text.tertiary,
|
||||
color: theme.palette.primary.contrastText.tertiary,
|
||||
borderRadius: theme.shape.borderRadius,
|
||||
margin: theme.spacing(2),
|
||||
};
|
||||
|
||||
|
||||
return (
|
||||
<Stack
|
||||
gap={theme.spacing(labelControlSpacing)}
|
||||
@@ -67,7 +67,7 @@ const Select = ({
|
||||
{label && (
|
||||
<Typography
|
||||
component="h3"
|
||||
color={theme.palette.text.secondary}
|
||||
color={theme.palette.primary.contrastText.secondary}
|
||||
fontWeight={500}
|
||||
fontSize={13}
|
||||
>
|
||||
|
||||
@@ -20,7 +20,7 @@ export const HttpAdornment = ({ https }) => {
|
||||
<Typography
|
||||
component="h5"
|
||||
paddingRight={"var(--env-var-spacing-1-minus)"}
|
||||
color={theme.palette.text.secondary}
|
||||
color={theme.palette.primary.contrastText.secondary}
|
||||
sx={{ lineHeight: 1, opacity: 0.8 }}
|
||||
>
|
||||
{https ? "https" : "http"}://
|
||||
|
||||
@@ -101,7 +101,7 @@ const TextInput = forwardRef(
|
||||
<Typography
|
||||
component="h3"
|
||||
fontSize={"var(--env-var-font-size-medium)"}
|
||||
color={theme.palette.text.secondary}
|
||||
color={theme.palette.primary.contrastText.secondary}
|
||||
fontWeight={500}
|
||||
>
|
||||
{label}
|
||||
|
||||
@@ -31,8 +31,8 @@ const BaseLabel = ({ label, styles, children }) => {
|
||||
className="label"
|
||||
sx={{
|
||||
borderRadius: borderRadius,
|
||||
border: `1px solid ${theme.palette.text.tertiary}`,
|
||||
color: theme.palette.text.tertiary,
|
||||
border: `1px solid ${theme.palette.primary.contrastText.tertiary}`,
|
||||
color: theme.palette.primary.contrastText.tertiary,
|
||||
padding: padding,
|
||||
...styles,
|
||||
}}
|
||||
@@ -141,7 +141,7 @@ const StatusLabel = ({ status, text, customStyles }) => {
|
||||
borderColor: theme.palette.warning.light,
|
||||
},
|
||||
pending: {
|
||||
dotColor: theme.palette.text.secondary,
|
||||
dotColor: theme.palette.primary.contrastText.secondary,
|
||||
bgColor: theme.palette.background.main,
|
||||
borderColor: theme.palette.border.dark,
|
||||
},
|
||||
|
||||
@@ -16,22 +16,22 @@ const Link = ({ level, label, url }) => {
|
||||
const levelConfig = {
|
||||
primary: {},
|
||||
secondary: {
|
||||
color: theme.palette.text.secondary,
|
||||
color: theme.palette.primary.contrastText.secondary,
|
||||
sx: {
|
||||
":hover": {
|
||||
color: theme.palette.text.secondary,
|
||||
color: theme.palette.primary.contrastText.secondary,
|
||||
},
|
||||
},
|
||||
},
|
||||
tertiary: {
|
||||
color: theme.palette.text.tertiary,
|
||||
color: theme.palette.primary.contrastText.tertiary,
|
||||
sx: {
|
||||
textDecoration: "underline",
|
||||
textDecorationStyle: "dashed",
|
||||
textDecorationColor: theme.palette.primary.main,
|
||||
textUnderlineOffset: "1px",
|
||||
":hover": {
|
||||
color: theme.palette.text.tertiary,
|
||||
color: theme.palette.primary.contrastText.tertiary,
|
||||
textDecorationColor: theme.palette.primary.main,
|
||||
backgroundColor: theme.palette.background.fill,
|
||||
},
|
||||
|
||||
@@ -90,7 +90,7 @@ const ProgressUpload = ({ icon, label, size, progress = 0, onClick, error }) =>
|
||||
{error}
|
||||
</Typography>
|
||||
) : (
|
||||
<Box color={theme.palette.text.tertiary}>
|
||||
<Box color={theme.palette.primary.contrastText.tertiary}>
|
||||
<Typography
|
||||
component="h2"
|
||||
mb={theme.spacing(1.5)}
|
||||
|
||||
@@ -173,10 +173,10 @@ function Sidebar() {
|
||||
backgroundColor: theme.palette.background.accent,
|
||||
},
|
||||
"& .MuiList-root svg path": {
|
||||
stroke: theme.palette.text.tertiary,
|
||||
stroke: theme.palette.primary.contrastText.tertiary,
|
||||
},
|
||||
"& p, & span, & .MuiListSubheader-root": {
|
||||
color: theme.palette.text.secondary,
|
||||
color: theme.palette.primary.contrastText.secondary,
|
||||
},
|
||||
}}
|
||||
>
|
||||
@@ -231,7 +231,7 @@ function Sidebar() {
|
||||
width: theme.spacing(8),
|
||||
height: theme.spacing(8),
|
||||
"& path": {
|
||||
stroke: theme.palette.text.secondary,
|
||||
stroke: theme.palette.primary.contrastText.secondary,
|
||||
},
|
||||
},
|
||||
"&:focus": { outline: "none" },
|
||||
@@ -490,7 +490,7 @@ function Sidebar() {
|
||||
backgroundColor: theme.palette.other.line,
|
||||
},
|
||||
"&.selected-path::after": {
|
||||
backgroundColor: theme.palette.text.tertiary,
|
||||
backgroundColor: theme.palette.primary.contrastText.tertiary,
|
||||
transform: "scale(1.2)",
|
||||
},
|
||||
}}
|
||||
@@ -573,7 +573,7 @@ function Sidebar() {
|
||||
mr: "-8px",
|
||||
"&:focus": { outline: "none" },
|
||||
alignSelf: "center",
|
||||
padding: '10px',
|
||||
padding: "10px",
|
||||
|
||||
"& svg": {
|
||||
width: "22px",
|
||||
|
||||
@@ -43,15 +43,15 @@ const StatBox = ({ heading, subHeading, sx }) => {
|
||||
"& h2": {
|
||||
fontSize: 13,
|
||||
fontWeight: 500,
|
||||
color: theme.palette.text.secondary,
|
||||
color: theme.palette.primary.contrastText.secondary,
|
||||
textTransform: "uppercase",
|
||||
},
|
||||
"& p": {
|
||||
fontSize: 18,
|
||||
color: theme.palette.text.primary,
|
||||
color: theme.palette.primary.contrastText.main,
|
||||
marginTop: theme.spacing(2),
|
||||
"& span": {
|
||||
color: theme.palette.text.tertiary,
|
||||
color: theme.palette.primary.contrastText.tertiary,
|
||||
marginLeft: theme.spacing(2),
|
||||
fontSize: 15,
|
||||
},
|
||||
|
||||
@@ -28,8 +28,7 @@ const PasswordPanel = () => {
|
||||
const theme = useTheme();
|
||||
const dispatch = useDispatch();
|
||||
|
||||
|
||||
const SPACING_GAP = theme.spacing(12);
|
||||
const SPACING_GAP = theme.spacing(12);
|
||||
|
||||
//redux state
|
||||
const { authToken, isLoading } = useSelector((state) => state.auth);
|
||||
@@ -116,7 +115,7 @@ const PasswordPanel = () => {
|
||||
value="password"
|
||||
sx={{
|
||||
"& h1, & input": {
|
||||
color: theme.palette.text.tertiary,
|
||||
color: theme.palette.primary.contrastText.tertiary,
|
||||
},
|
||||
}}
|
||||
>
|
||||
@@ -126,8 +125,7 @@ const PasswordPanel = () => {
|
||||
noValidate
|
||||
spellCheck="false"
|
||||
gap={theme.spacing(26)}
|
||||
maxWidth={"80ch"} // Keep maxWidth
|
||||
|
||||
maxWidth={"80ch"} // Keep maxWidth
|
||||
>
|
||||
<TextInput
|
||||
type="text"
|
||||
@@ -142,7 +140,7 @@ const PasswordPanel = () => {
|
||||
direction="row"
|
||||
justifyContent={"flex-start"}
|
||||
alignItems={"center"}
|
||||
gap={SPACING_GAP}
|
||||
gap={SPACING_GAP}
|
||||
flexWrap={"wrap"}
|
||||
>
|
||||
<Typography
|
||||
@@ -167,7 +165,7 @@ const PasswordPanel = () => {
|
||||
<Stack
|
||||
direction="row"
|
||||
alignItems={"flex-start"}
|
||||
gap={SPACING_GAP}
|
||||
gap={SPACING_GAP}
|
||||
flexWrap={"wrap"}
|
||||
>
|
||||
<Typography
|
||||
@@ -193,7 +191,7 @@ const PasswordPanel = () => {
|
||||
<Stack
|
||||
direction="row"
|
||||
alignItems={"flex-start"}
|
||||
gap={SPACING_GAP}
|
||||
gap={SPACING_GAP}
|
||||
flexWrap={"wrap"}
|
||||
>
|
||||
<Typography
|
||||
@@ -255,4 +253,4 @@ PasswordPanel.propTypes = {
|
||||
// No props are being passed to this component, hence no specific PropTypes are defined.
|
||||
};
|
||||
|
||||
export default PasswordPanel;
|
||||
export default PasswordPanel;
|
||||
@@ -29,7 +29,7 @@ import Dialog from "../../Dialog";
|
||||
const ProfilePanel = () => {
|
||||
const theme = useTheme();
|
||||
const dispatch = useDispatch();
|
||||
|
||||
|
||||
const SPACING_GAP = theme.spacing(12);
|
||||
|
||||
//redux state
|
||||
@@ -216,7 +216,7 @@ const ProfilePanel = () => {
|
||||
value="profile"
|
||||
sx={{
|
||||
"& h1, & p, & input": {
|
||||
color: theme.palette.text.tertiary,
|
||||
color: theme.palette.primary.contrastText.tertiary,
|
||||
},
|
||||
}}
|
||||
>
|
||||
@@ -225,9 +225,12 @@ const ProfilePanel = () => {
|
||||
className="edit-profile-form"
|
||||
noValidate
|
||||
spellCheck="false"
|
||||
gap={SPACING_GAP}
|
||||
gap={SPACING_GAP}
|
||||
>
|
||||
<Stack direction="row" gap={SPACING_GAP}>
|
||||
<Stack
|
||||
direction="row"
|
||||
gap={SPACING_GAP}
|
||||
>
|
||||
<Box flex={0.9}>
|
||||
<Typography component="h1">First name</Typography>
|
||||
</Box>
|
||||
@@ -242,7 +245,10 @@ const ProfilePanel = () => {
|
||||
flex={1}
|
||||
/>
|
||||
</Stack>
|
||||
<Stack direction="row" gap={SPACING_GAP}>
|
||||
<Stack
|
||||
direction="row"
|
||||
gap={SPACING_GAP}
|
||||
>
|
||||
<Box flex={0.9}>
|
||||
<Typography component="h1">Last name</Typography>
|
||||
</Box>
|
||||
@@ -257,7 +263,10 @@ const ProfilePanel = () => {
|
||||
flex={1}
|
||||
/>
|
||||
</Stack>
|
||||
<Stack direction="row" gap={SPACING_GAP}>
|
||||
<Stack
|
||||
direction="row"
|
||||
gap={SPACING_GAP}
|
||||
>
|
||||
<Stack flex={0.9}>
|
||||
<Typography component="h1">Email</Typography>
|
||||
<Typography
|
||||
@@ -277,7 +286,10 @@ const ProfilePanel = () => {
|
||||
flex={1}
|
||||
/>
|
||||
</Stack>
|
||||
<Stack direction="row" gap={SPACING_GAP}>
|
||||
<Stack
|
||||
direction="row"
|
||||
gap={SPACING_GAP}
|
||||
>
|
||||
<Stack flex={0.9}>
|
||||
<Typography component="h1">Your photo</Typography>
|
||||
<Typography
|
||||
|
||||
@@ -91,7 +91,7 @@ const TeamPanel = () => {
|
||||
id: idx,
|
||||
data: (
|
||||
<Stack>
|
||||
<Typography color={theme.palette.text.secondary}>
|
||||
<Typography color={theme.palette.primary.contrastText.secondary}>
|
||||
{member.firstName + " " + member.lastName}
|
||||
</Typography>
|
||||
<Typography>
|
||||
@@ -190,7 +190,7 @@ const TeamPanel = () => {
|
||||
value="team"
|
||||
sx={{
|
||||
"& h1": {
|
||||
color: theme.palette.text.tertiary,
|
||||
color: theme.palette.primary.contrastText.tertiary,
|
||||
},
|
||||
"& .MuiTable-root .MuiTableBody-root .MuiTableCell-root, & .MuiTable-root p + p":
|
||||
{
|
||||
|
||||
@@ -35,12 +35,12 @@ const SunAndMoonIcon = () => {
|
||||
cx="12"
|
||||
cy="12"
|
||||
r="6"
|
||||
fill={theme.palette.text.secondary}
|
||||
fill={theme.palette.primary.contrastText.secondary}
|
||||
mask="url(#moon-mask)"
|
||||
/>
|
||||
<g
|
||||
className="sun-beams"
|
||||
stroke={theme.palette.text.secondary}
|
||||
stroke={theme.palette.primary.contrastText.secondary}
|
||||
>
|
||||
<line
|
||||
x1="12"
|
||||
|
||||
@@ -84,7 +84,7 @@ const Account = ({ open = "profile" }) => {
|
||||
tabIndex={index}
|
||||
sx={{
|
||||
fontSize: 13,
|
||||
color: theme.palette.text.tertiary,
|
||||
color: theme.palette.primary.contrastText.tertiary,
|
||||
textTransform: "none",
|
||||
minWidth: "fit-content",
|
||||
minHeight: 0,
|
||||
|
||||
@@ -77,7 +77,7 @@ const LandingPage = ({ isSuperAdmin, onSignup }) => {
|
||||
}}
|
||||
sx={{
|
||||
"&:hover": {
|
||||
color: theme.palette.text.tertiary,
|
||||
color: theme.palette.primary.contrastText.tertiary,
|
||||
},
|
||||
}}
|
||||
>
|
||||
@@ -95,7 +95,7 @@ const LandingPage = ({ isSuperAdmin, onSignup }) => {
|
||||
}}
|
||||
sx={{
|
||||
"&:hover": {
|
||||
color: theme.palette.text.tertiary,
|
||||
color: theme.palette.primary.contrastText.tertiary,
|
||||
},
|
||||
}}
|
||||
>
|
||||
|
||||
@@ -16,7 +16,7 @@ const Empty = ({ styles, mode }) => {
|
||||
</Box>
|
||||
<Typography
|
||||
textAlign="center"
|
||||
color={theme.palette.text.secondary}
|
||||
color={theme.palette.primary.contrastText.secondary}
|
||||
>
|
||||
No incidents recorded yet.
|
||||
</Typography>
|
||||
|
||||
@@ -159,7 +159,7 @@ const IncidentTable = ({ monitors, selectedMonitor, filter }) => {
|
||||
</Box>
|
||||
<Typography
|
||||
textAlign="center"
|
||||
color={theme.palette.text.secondary}
|
||||
color={theme.palette.primary.contrastText.secondary}
|
||||
>
|
||||
The monitor you have selected has no recorded incidents yet.
|
||||
</Typography>
|
||||
@@ -185,7 +185,7 @@ const IncidentTable = ({ monitors, selectedMonitor, filter }) => {
|
||||
"YYYY-MM-DD HH:mm:ss A",
|
||||
uiTimezone
|
||||
);
|
||||
|
||||
|
||||
return (
|
||||
<TableRow key={check._id}>
|
||||
<TableCell>{monitors[check.monitorId]?.name}</TableCell>
|
||||
|
||||
@@ -84,7 +84,7 @@ const Incidents = () => {
|
||||
<Typography
|
||||
display="inline-block"
|
||||
component="h1"
|
||||
color={theme.palette.text.secondary}
|
||||
color={theme.palette.primary.contrastText.secondary}
|
||||
>
|
||||
Incidents for
|
||||
</Typography>
|
||||
|
||||
@@ -19,7 +19,7 @@ const Empty = ({ styles }) => {
|
||||
<Typography variant="h2">Your infrastructure dashboard will show here</Typography>
|
||||
<Typography
|
||||
textAlign="center"
|
||||
color={theme.palette.text.secondary}
|
||||
color={theme.palette.primary.contrastText.secondary}
|
||||
>
|
||||
Hang tight! Data is loading
|
||||
</Typography>
|
||||
|
||||
@@ -98,9 +98,9 @@ function Pagination({
|
||||
},
|
||||
}}
|
||||
sx={{
|
||||
color: theme.palette.text.secondary,
|
||||
color: theme.palette.primary.contrastText.secondary,
|
||||
"& svg path": {
|
||||
stroke: theme.palette.text.tertiary,
|
||||
stroke: theme.palette.primary.contrastText.tertiary,
|
||||
strokeWidth: 1.3,
|
||||
},
|
||||
"& .MuiSelect-select": {
|
||||
|
||||
@@ -229,7 +229,7 @@ function Infrastructure() {
|
||||
<Box
|
||||
component="span"
|
||||
className="current-monitors-counter"
|
||||
color={theme.palette.text.primary}
|
||||
color={theme.palette.primary.contrastText.main}
|
||||
border={1}
|
||||
borderColor={theme.palette.border.light}
|
||||
backgroundColor={theme.palette.background.accent}
|
||||
|
||||
@@ -126,7 +126,7 @@ const Integrations = () => {
|
||||
gap={theme.spacing(2)}
|
||||
sx={{
|
||||
"& h1, & p": {
|
||||
color: theme.palette.text.secondary,
|
||||
color: theme.palette.primary.contrastText.secondary,
|
||||
},
|
||||
}}
|
||||
>
|
||||
|
||||
@@ -329,9 +329,9 @@ const MaintenanceTable = ({
|
||||
}}
|
||||
sx={{
|
||||
mt: theme.spacing(6),
|
||||
color: theme.palette.text.secondary,
|
||||
color: theme.palette.primary.contrastText.secondary,
|
||||
"& svg path": {
|
||||
stroke: theme.palette.text.tertiary,
|
||||
stroke: theme.palette.primary.contrastText.tertiary,
|
||||
strokeWidth: 1.3,
|
||||
},
|
||||
"& .MuiSelect-select": {
|
||||
|
||||
@@ -249,7 +249,7 @@ const PageSpeedConfigure = () => {
|
||||
width: 4,
|
||||
height: 4,
|
||||
borderRadius: "50%",
|
||||
backgroundColor: theme.palette.text.tertiary,
|
||||
backgroundColor: theme.palette.primary.contrastText.tertiary,
|
||||
opacity: 0.8,
|
||||
left: -10,
|
||||
top: "50%",
|
||||
|
||||
@@ -179,7 +179,7 @@ const CreatePageSpeed = () => {
|
||||
className="create-monitor"
|
||||
sx={{
|
||||
"& h1": {
|
||||
color: theme.palette.text.primary,
|
||||
color: theme.palette.primary.contrastText.main,
|
||||
},
|
||||
}}
|
||||
>
|
||||
@@ -207,7 +207,7 @@ const CreatePageSpeed = () => {
|
||||
component="span"
|
||||
fontSize="inherit"
|
||||
fontWeight="inherit"
|
||||
color={theme.palette.text.secondary}
|
||||
color={theme.palette.primary.contrastText.secondary}
|
||||
>
|
||||
PageSpeed monitor
|
||||
</Typography>
|
||||
|
||||
@@ -64,7 +64,7 @@ const CustomToolTip = ({ active, payload, label, config }) => {
|
||||
>
|
||||
<Typography
|
||||
sx={{
|
||||
color: theme.palette.text.tertiary,
|
||||
color: theme.palette.primary.contrastText.tertiary,
|
||||
fontSize: 12,
|
||||
fontWeight: 500,
|
||||
}}
|
||||
@@ -86,7 +86,7 @@ const CustomToolTip = ({ active, payload, label, config }) => {
|
||||
mt={theme.spacing(1)}
|
||||
sx={{
|
||||
"& span": {
|
||||
color: theme.palette.text.tertiary,
|
||||
color: theme.palette.primary.contrastText.tertiary,
|
||||
fontSize: 11,
|
||||
fontWeight: 500,
|
||||
},
|
||||
@@ -186,7 +186,7 @@ const CustomTick = ({ x, y, payload, index }) => {
|
||||
x={x}
|
||||
y={y + 8}
|
||||
textAnchor="middle"
|
||||
fill={theme.palette.text.tertiary}
|
||||
fill={theme.palette.primary.contrastText.tertiary}
|
||||
fontSize={11}
|
||||
fontWeight={400}
|
||||
>
|
||||
|
||||
@@ -151,7 +151,7 @@ const PageSpeedDetails = () => {
|
||||
width: 4,
|
||||
height: 4,
|
||||
borderRadius: "50%",
|
||||
backgroundColor: theme.palette.text.tertiary,
|
||||
backgroundColor: theme.palette.primary.contrastText.tertiary,
|
||||
opacity: 0.8,
|
||||
left: -9,
|
||||
top: "50%",
|
||||
@@ -410,7 +410,7 @@ const PageSpeedDetails = () => {
|
||||
component="span"
|
||||
fontSize={14}
|
||||
fontWeight={500}
|
||||
color={theme.palette.text.primary}
|
||||
color={theme.palette.primary.contrastText.main}
|
||||
>
|
||||
{value}
|
||||
<Typography
|
||||
|
||||
@@ -12,11 +12,11 @@ export const ChartBox = styled(Stack)(({ theme }) => ({
|
||||
borderBottomRightRadius: 16,
|
||||
backgroundColor: theme.palette.background.main,
|
||||
"& h2": {
|
||||
color: theme.palette.text.secondary,
|
||||
color: theme.palette.primary.contrastText.secondary,
|
||||
fontSize: 15,
|
||||
fontWeight: 500,
|
||||
},
|
||||
"& p": { color: theme.palette.text.tertiary },
|
||||
"& p": { color: theme.palette.primary.contrastText.tertiary },
|
||||
"& > :nth-of-type(1)": {
|
||||
gridColumn: 1,
|
||||
gridRow: 1,
|
||||
|
||||
@@ -33,7 +33,7 @@ const CustomToolTip = ({ payload }) => {
|
||||
>
|
||||
<Typography
|
||||
sx={{
|
||||
color: theme.palette.text.tertiary,
|
||||
color: theme.palette.primary.contrastText.tertiary,
|
||||
fontSize: 12,
|
||||
fontWeight: 500,
|
||||
}}
|
||||
@@ -52,7 +52,7 @@ const CustomToolTip = ({ payload }) => {
|
||||
mt={theme.spacing(1)}
|
||||
sx={{
|
||||
"& span": {
|
||||
color: theme.palette.text.tertiary,
|
||||
color: theme.palette.primary.contrastText.tertiary,
|
||||
fontSize: 11,
|
||||
fontWeight: 500,
|
||||
},
|
||||
@@ -299,7 +299,7 @@ const Card = ({ monitor }) => {
|
||||
<Typography
|
||||
component="span"
|
||||
fontSize={12}
|
||||
color={theme.palette.text.primary}
|
||||
color={theme.palette.primary.contrastText.main}
|
||||
>
|
||||
{time}{" "}
|
||||
</Typography>
|
||||
|
||||
@@ -113,7 +113,7 @@ const PageSpeed = () => {
|
||||
<Box
|
||||
component="span"
|
||||
className="current-monitors-counter"
|
||||
color={theme.palette.text.primary}
|
||||
color={theme.palette.primary.contrastText.main}
|
||||
border={1}
|
||||
borderColor={theme.palette.border.light}
|
||||
backgroundColor={theme.palette.background.accent}
|
||||
|
||||
@@ -276,7 +276,7 @@ const Configure = () => {
|
||||
width: 4,
|
||||
height: 4,
|
||||
borderRadius: "50%",
|
||||
backgroundColor: theme.palette.text.tertiary,
|
||||
backgroundColor: theme.palette.primary.contrastText.tertiary,
|
||||
opacity: 0.8,
|
||||
left: -10,
|
||||
top: "50%",
|
||||
@@ -307,7 +307,7 @@ const Configure = () => {
|
||||
width: 22,
|
||||
height: 22,
|
||||
"& path": {
|
||||
stroke: theme.palette.text.tertiary,
|
||||
stroke: theme.palette.primary.contrastText.tertiary,
|
||||
strokeWidth: 1.7,
|
||||
},
|
||||
},
|
||||
|
||||
@@ -174,7 +174,7 @@ const DetailsPage = () => {
|
||||
width: 4,
|
||||
height: 4,
|
||||
borderRadius: "50%",
|
||||
backgroundColor: theme.palette.text.tertiary,
|
||||
backgroundColor: theme.palette.primary.contrastText.tertiary,
|
||||
opacity: 0.8,
|
||||
left: -9,
|
||||
top: "50%",
|
||||
@@ -204,7 +204,7 @@ const DetailsPage = () => {
|
||||
"& svg": {
|
||||
mr: theme.spacing(3),
|
||||
"& path": {
|
||||
stroke: theme.palette.text.tertiary,
|
||||
stroke: theme.palette.primary.contrastText.tertiary,
|
||||
},
|
||||
},
|
||||
}}
|
||||
@@ -242,7 +242,7 @@ const DetailsPage = () => {
|
||||
<Typography
|
||||
component="span"
|
||||
fontSize={13}
|
||||
color={theme.palette.text.primary}
|
||||
color={theme.palette.primary.contrastText.main}
|
||||
>
|
||||
{certificateExpiry}
|
||||
</Typography>
|
||||
@@ -316,7 +316,7 @@ const DetailsPage = () => {
|
||||
position="absolute"
|
||||
top="100%"
|
||||
fontSize={11}
|
||||
color={theme.palette.text.tertiary}
|
||||
color={theme.palette.primary.contrastText.tertiary}
|
||||
>
|
||||
{formatDateWithTz(
|
||||
hoveredUptimeData._id,
|
||||
@@ -373,7 +373,7 @@ const DetailsPage = () => {
|
||||
position="absolute"
|
||||
top="100%"
|
||||
fontSize={11}
|
||||
color={theme.palette.text.tertiary}
|
||||
color={theme.palette.primary.contrastText.tertiary}
|
||||
>
|
||||
{formatDateWithTz(
|
||||
hoveredIncidentsData._id,
|
||||
@@ -426,7 +426,7 @@ const DetailsPage = () => {
|
||||
</IconBox>
|
||||
<Typography
|
||||
component="h2"
|
||||
color={theme.palette.text.secondary}
|
||||
color={theme.palette.primary.contrastText.secondary}
|
||||
>
|
||||
History
|
||||
</Typography>
|
||||
|
||||
@@ -12,16 +12,16 @@ export const ChartBox = styled(Stack)(({ theme }) => ({
|
||||
borderRadius: 4,
|
||||
backgroundColor: theme.palette.background.main,
|
||||
"& h2": {
|
||||
color: theme.palette.text.secondary,
|
||||
color: theme.palette.primary.contrastText.secondary,
|
||||
fontSize: 15,
|
||||
fontWeight: 500,
|
||||
},
|
||||
"& .MuiBox-root:not(.area-tooltip) p": {
|
||||
color: theme.palette.text.tertiary,
|
||||
color: theme.palette.primary.contrastText.tertiary,
|
||||
fontSize: 13,
|
||||
},
|
||||
"& .MuiBox-root > span": {
|
||||
color: theme.palette.text.primary,
|
||||
color: theme.palette.primary.contrastText.main,
|
||||
fontSize: 20,
|
||||
"& span": {
|
||||
opacity: 0.8,
|
||||
@@ -37,7 +37,7 @@ export const ChartBox = styled(Stack)(({ theme }) => ({
|
||||
alignItems: "center",
|
||||
},
|
||||
"& tspan, & text": {
|
||||
fill: theme.palette.text.tertiary,
|
||||
fill: theme.palette.primary.contrastText.tertiary,
|
||||
},
|
||||
"& path": {
|
||||
transition: "fill 300ms ease, stroke-width 400ms ease",
|
||||
|
||||
@@ -30,7 +30,7 @@ const CurrentMonitoring = ({ totalMonitors, monitors, isAdmin, handlePause }) =>
|
||||
|
||||
<Box
|
||||
className="current-monitors-counter"
|
||||
color={theme.palette.text.primary}
|
||||
color={theme.palette.primary.contrastText.main}
|
||||
border={1}
|
||||
borderColor={theme.palette.border.light}
|
||||
backgroundColor={theme.palette.background.accent}
|
||||
|
||||
@@ -73,7 +73,7 @@ const StatusBox = ({ title, value }) => {
|
||||
textTransform="uppercase"
|
||||
fontSize={15}
|
||||
letterSpacing={0.5}
|
||||
color={theme.palette.text.secondary}
|
||||
color={theme.palette.primary.contrastText.secondary}
|
||||
mb={theme.spacing(8)}
|
||||
sx={{ opacity: 0.6 }}
|
||||
>
|
||||
@@ -93,7 +93,7 @@ const StatusBox = ({ title, value }) => {
|
||||
component="span"
|
||||
fontSize={20}
|
||||
fontWeight={300}
|
||||
color={theme.palette.text.secondary}
|
||||
color={theme.palette.primary.contrastText.secondary}
|
||||
sx={{ opacity: 0.3 }}
|
||||
>
|
||||
#
|
||||
|
||||
@@ -21,7 +21,7 @@ const Fallback = ({ isAdmin }) => {
|
||||
border={1}
|
||||
borderRadius={theme.shape.borderRadius}
|
||||
borderColor={theme.palette.border.light}
|
||||
color={theme.palette.text.secondary}
|
||||
color={theme.palette.primary.contrastText.secondary}
|
||||
>
|
||||
<Box pb={theme.spacing(20)}>
|
||||
{mode === "light" ? <PlaceholderLight /> : <PlaceholderDark />}
|
||||
|
||||
@@ -253,4 +253,131 @@ const semanticColors = {
|
||||
},
|
||||
},
|
||||
};
|
||||
export { typographyLevels, semanticColors as colors };
|
||||
|
||||
const newColors = {
|
||||
offWhite: "#FEFEFE",
|
||||
offBlack: "#131315",
|
||||
gray300: "#E3E3E3",
|
||||
gray600: "#A2A3A3",
|
||||
blueGray50: "#E8F0FE",
|
||||
blueGray500: "#475467",
|
||||
blueGray600: "#344054",
|
||||
blueGray800: "#1C2130",
|
||||
gray200: "#E3E3E3",
|
||||
gray500: "#A2A3A3",
|
||||
blueBlueWave: "#1570EF",
|
||||
green100: "#8CFFCB",
|
||||
green200: "#4B9B77",
|
||||
green400: "#079455",
|
||||
green700: "#19543A",
|
||||
orange100: "#FFE5CC",
|
||||
orange400: "#FD8F22",
|
||||
orange600: "#9B734B",
|
||||
orange700: "#694016",
|
||||
red100: "#F9C2C2",
|
||||
red400: "#D92020",
|
||||
red600: "#9B4B4B",
|
||||
red700: "#791515",
|
||||
};
|
||||
|
||||
const newSemanticColors = {
|
||||
accent: {
|
||||
main: {
|
||||
light: newColors.blueBlueWave,
|
||||
dark: newColors.blueBlueWave,
|
||||
},
|
||||
contrastText: {
|
||||
light: newColors.offWhite,
|
||||
dark: newColors.offWhite,
|
||||
},
|
||||
},
|
||||
primary: {
|
||||
main: {
|
||||
light: newColors.offWhite,
|
||||
dark: newColors.offBlack,
|
||||
},
|
||||
contrastText: {
|
||||
main: {
|
||||
light: newColors.blueGray800,
|
||||
dark: newColors.blueGray50,
|
||||
},
|
||||
secondary: {
|
||||
light: newColors.blueGray600,
|
||||
dark: newColors.gray300,
|
||||
},
|
||||
tertiary: {
|
||||
light: newColors.blueGray500,
|
||||
dark: newColors.gray500,
|
||||
},
|
||||
},
|
||||
},
|
||||
/* For success, warning and error, contrastText works wll with main, and with the theme primary main color. Accent is to be used in graphs */
|
||||
success: {
|
||||
main: {
|
||||
light: newColors.green700,
|
||||
dark: newColors.green100,
|
||||
},
|
||||
contrastText: {
|
||||
light: newColors.green100,
|
||||
dark: newColors.green700,
|
||||
},
|
||||
accent: {
|
||||
light: newColors.green400,
|
||||
dark: newColors.green200,
|
||||
},
|
||||
},
|
||||
error: {
|
||||
main: {
|
||||
light: newColors.red700,
|
||||
dark: newColors.red100,
|
||||
},
|
||||
contrastText: {
|
||||
light: newColors.red100,
|
||||
dark: newColors.red700,
|
||||
},
|
||||
accent: {
|
||||
light: newColors.red400,
|
||||
dark: newColors.red600,
|
||||
},
|
||||
},
|
||||
warning: {
|
||||
main: {
|
||||
light: newColors.orange700,
|
||||
dark: newColors.orange100,
|
||||
},
|
||||
contrastText: {
|
||||
light: newColors.orange100,
|
||||
dark: newColors.orange700,
|
||||
},
|
||||
accent: {
|
||||
light: newColors.orange400,
|
||||
dark: newColors.orange600,
|
||||
},
|
||||
},
|
||||
gradient: {
|
||||
color1: {
|
||||
light: paletteColors.gray90,
|
||||
dark: paletteColors.gray890,
|
||||
},
|
||||
color2: {
|
||||
light: paletteColors.gray80,
|
||||
dark: paletteColors.gray880,
|
||||
},
|
||||
color3: {
|
||||
light: paletteColors.gray70,
|
||||
dark: paletteColors.gray870,
|
||||
},
|
||||
color4: {
|
||||
light: paletteColors.gray60,
|
||||
dark: paletteColors.gray860,
|
||||
},
|
||||
color5: {
|
||||
light: paletteColors.gray50,
|
||||
dark: paletteColors.gray850,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
/* TODO proximo passo: quebrar o projeto */
|
||||
|
||||
export { typographyLevels, semanticColors as colors, newSemanticColors };
|
||||
+129
-104
@@ -1,111 +1,31 @@
|
||||
import { createTheme } from "@mui/material";
|
||||
import { baseTheme } from "./globalTheme";
|
||||
import { colors } from "./constants";
|
||||
import { colors, newSemanticColors } from "./constants";
|
||||
|
||||
const {
|
||||
primary,
|
||||
secondary,
|
||||
success,
|
||||
error,
|
||||
warning,
|
||||
neutral,
|
||||
gradient: {
|
||||
color1: { dark: color1 },
|
||||
color2: { dark: color2 },
|
||||
color3: { dark: color3 },
|
||||
color4: { dark: color4 },
|
||||
color5: { dark: color5 },
|
||||
},
|
||||
background,
|
||||
text,
|
||||
border,
|
||||
unresolved,
|
||||
other,
|
||||
} = colors;
|
||||
function extractThemeColors(themeType, colorObject) {
|
||||
if (!["light", "dark"].includes(themeType)) {
|
||||
throw new Error('Invalid theme type. Use "light" or "dark".');
|
||||
}
|
||||
|
||||
const palette = {
|
||||
action: {
|
||||
disabled: border.dark.disabled,
|
||||
},
|
||||
primary: { main: primary.main.dark },
|
||||
secondary: {
|
||||
main: secondary.main.dark,
|
||||
contrastText: secondary.contrastText.dark,
|
||||
light: secondary.dark.dark,
|
||||
dark: secondary.dark.dark,
|
||||
},
|
||||
success: {
|
||||
main: success.main.dark,
|
||||
contrastText: success.contrastText.dark,
|
||||
light: success.light.dark,
|
||||
dark: success.dark.dark,
|
||||
},
|
||||
error: {
|
||||
main: error.main.dark,
|
||||
contrastText: error.contrastText.dark,
|
||||
light: error.light.dark,
|
||||
dark: error.dark.dark,
|
||||
},
|
||||
warning: {
|
||||
main: warning.main.dark,
|
||||
light: warning.light.dark,
|
||||
contrastText: warning.contrastText.dark,
|
||||
dark: warning.dark.dark,
|
||||
},
|
||||
neutral: {
|
||||
contrastText: neutral.contrastText.dark,
|
||||
},
|
||||
/* From this part on, try to create semantic structure, not feature based structure */
|
||||
percentage: {
|
||||
uptimePoor: error.main.dark,
|
||||
uptimeFair: warning.contrastText.dark,
|
||||
uptimeGood: warning.main.dark /* Change for a success color? ?*/,
|
||||
uptimeExcellent: success.main.dark,
|
||||
},
|
||||
unresolved: {
|
||||
main: unresolved.main.dark,
|
||||
light: unresolved.light.dark,
|
||||
bg: unresolved.bg.dark,
|
||||
},
|
||||
divider: border.light.dark,
|
||||
other: {
|
||||
icon: text.secondary.dark,
|
||||
line: border.light.dark,
|
||||
fill: background.accent.dark,
|
||||
grid: other.grid.dark,
|
||||
autofill: secondary.main.dark,
|
||||
},
|
||||
gradient: {
|
||||
color1,
|
||||
color2,
|
||||
color3,
|
||||
color4,
|
||||
color5,
|
||||
},
|
||||
text: {
|
||||
primary: text.primary.dark,
|
||||
secondary: text.secondary.dark,
|
||||
tertiary: text.tertiary.dark,
|
||||
accent: text.accent.dark,
|
||||
},
|
||||
background: {
|
||||
main: background.main.dark,
|
||||
alt: background.alt.dark,
|
||||
fill: background.fill.dark,
|
||||
accent: background.accent.dark,
|
||||
},
|
||||
border: {
|
||||
light: border.light.dark,
|
||||
dark: border.dark.dark,
|
||||
},
|
||||
info: {
|
||||
text: text.primary.dark,
|
||||
main: text.secondary.dark,
|
||||
bg: background.main.dark,
|
||||
light: background.main.dark,
|
||||
border: border.light.dark,
|
||||
},
|
||||
};
|
||||
const extract = (obj) => {
|
||||
if (typeof obj !== "object" || obj === null) {
|
||||
return obj;
|
||||
}
|
||||
|
||||
if ("light" in obj && "dark" in obj) {
|
||||
return obj[themeType]; // Return the value for the specified theme
|
||||
}
|
||||
|
||||
// Reduce the object, keeping only the extracted themeType values
|
||||
return Object.keys(obj).reduce((acc, key) => {
|
||||
acc[key] = extract(obj[key]);
|
||||
return acc;
|
||||
}, {});
|
||||
};
|
||||
|
||||
return extract(colorObject);
|
||||
}
|
||||
const palette = extractThemeColors("dark", newSemanticColors);
|
||||
|
||||
const darkTheme = createTheme({
|
||||
palette,
|
||||
@@ -113,3 +33,108 @@ const darkTheme = createTheme({
|
||||
});
|
||||
|
||||
export default darkTheme;
|
||||
|
||||
// const {
|
||||
// primary,
|
||||
// secondary,
|
||||
// success,
|
||||
// error,
|
||||
// warning,
|
||||
// neutral,
|
||||
// gradient: {
|
||||
// color1: { dark: color1 },
|
||||
// color2: { dark: color2 },
|
||||
// color3: { dark: color3 },
|
||||
// color4: { dark: color4 },
|
||||
// color5: { dark: color5 },
|
||||
// },
|
||||
// background,
|
||||
// text,
|
||||
// border,
|
||||
// unresolved,
|
||||
// other,
|
||||
// } = colors;
|
||||
|
||||
// const palette = {
|
||||
// action: {
|
||||
// disabled: border.dark.disabled,
|
||||
// },
|
||||
// primary: { main: primary.main.dark },
|
||||
// secondary: {
|
||||
// main: secondary.main.dark,
|
||||
// contrastText: secondary.contrastText.dark,
|
||||
// light: secondary.dark.dark,
|
||||
// dark: secondary.dark.dark,
|
||||
// },
|
||||
// success: {
|
||||
// main: success.main.dark,
|
||||
// contrastText: success.contrastText.dark,
|
||||
// light: success.light.dark,
|
||||
// dark: success.dark.dark,
|
||||
// },
|
||||
// error: {
|
||||
// main: error.main.dark,
|
||||
// contrastText: error.contrastText.dark,
|
||||
// light: error.light.dark,
|
||||
// dark: error.dark.dark,
|
||||
// },
|
||||
// warning: {
|
||||
// main: warning.main.dark,
|
||||
// light: warning.light.dark,
|
||||
// contrastText: warning.contrastText.dark,
|
||||
// dark: warning.dark.dark,
|
||||
// },
|
||||
// neutral: {
|
||||
// contrastText: neutral.contrastText.dark,
|
||||
// },
|
||||
// /* From this part on, try to create semantic structure, not feature based structure */
|
||||
// percentage: {
|
||||
// uptimePoor: error.main.dark,
|
||||
// uptimeFair: warning.contrastText.dark,
|
||||
// uptimeGood: warning.main.dark /* Change for a success color? ?*/,
|
||||
// uptimeExcellent: success.main.dark,
|
||||
// },
|
||||
// unresolved: {
|
||||
// main: unresolved.main.dark,
|
||||
// light: unresolved.light.dark,
|
||||
// bg: unresolved.bg.dark,
|
||||
// },
|
||||
// divider: border.light.dark,
|
||||
// other: {
|
||||
// icon: text.secondary.dark,
|
||||
// line: border.light.dark,
|
||||
// fill: background.accent.dark,
|
||||
// grid: other.grid.dark,
|
||||
// autofill: secondary.main.dark,
|
||||
// },
|
||||
// gradient: {
|
||||
// color1,
|
||||
// color2,
|
||||
// color3,
|
||||
// color4,
|
||||
// color5,
|
||||
// },
|
||||
// text: {
|
||||
// primary: text.primary.dark,
|
||||
// secondary: text.secondary.dark,
|
||||
// tertiary: text.tertiary.dark,
|
||||
// accent: text.accent.dark,
|
||||
// },
|
||||
// background: {
|
||||
// main: background.main.dark,
|
||||
// alt: background.alt.dark,
|
||||
// fill: background.fill.dark,
|
||||
// accent: background.accent.dark,
|
||||
// },
|
||||
// border: {
|
||||
// light: border.light.dark,
|
||||
// dark: border.dark.dark,
|
||||
// },
|
||||
// info: {
|
||||
// text: text.primary.dark,
|
||||
// main: text.secondary.dark,
|
||||
// bg: background.main.dark,
|
||||
// light: background.main.dark,
|
||||
// border: border.light.dark,
|
||||
// },
|
||||
// };
|
||||
@@ -13,22 +13,22 @@ const baseTheme = (palette) => ({
|
||||
fontSize: 14,
|
||||
h1: {
|
||||
fontSize: typographyLevels.xl,
|
||||
color: palette.text.primary,
|
||||
color: palette.primary.contrastText.main,
|
||||
fontWeight: 500,
|
||||
},
|
||||
h2: {
|
||||
fontSize: typographyLevels.l,
|
||||
color: palette.text.secondary,
|
||||
color: palette.primary.contrastText.secondary,
|
||||
fontWeight: 400,
|
||||
},
|
||||
body1: {
|
||||
fontSize: typographyLevels.m,
|
||||
color: palette.text.tertiary,
|
||||
color: palette.primary.contrastText.tertiary,
|
||||
fontWeight: 400,
|
||||
},
|
||||
body2: {
|
||||
fontSize: typographyLevels.s,
|
||||
color: palette.text.tertiary,
|
||||
color: palette.primary.contrastText.tertiary,
|
||||
fontWeight: 400,
|
||||
},
|
||||
},
|
||||
@@ -97,7 +97,7 @@ const baseTheme = (palette) => ({
|
||||
"&.MuiLoadingButton-root": {
|
||||
"&:disabled": {
|
||||
backgroundColor: theme.palette.secondary.main,
|
||||
color: theme.palette.text.primary,
|
||||
color: theme.palette.primary.contrastText.main,
|
||||
},
|
||||
},
|
||||
"&.MuiLoadingButton-loading": {
|
||||
@@ -160,7 +160,7 @@ const baseTheme = (palette) => ({
|
||||
borderRadius: 4,
|
||||
backgroundColor: "inherit",
|
||||
padding: "4px 6px",
|
||||
color: theme.palette.text.secondary,
|
||||
color: theme.palette.primary.contrastText.secondary,
|
||||
fontSize: 13,
|
||||
margin: 2,
|
||||
minWidth: 100,
|
||||
@@ -193,7 +193,7 @@ const baseTheme = (palette) => ({
|
||||
borderStyle: "solid",
|
||||
borderColor: theme.palette.border.light,
|
||||
"& button": {
|
||||
color: theme.palette.text.tertiary,
|
||||
color: theme.palette.primary.contrastText.tertiary,
|
||||
borderRadius: 4,
|
||||
},
|
||||
"& li:first-of-type button, & li:last-of-type button": {
|
||||
@@ -232,7 +232,7 @@ const baseTheme = (palette) => ({
|
||||
minHeight: "var(--env-var-height-2)",
|
||||
fontSize: "var(--env-var-font-size-medium)",
|
||||
fontWeight: 400,
|
||||
color: palette.text.secondary,
|
||||
color: palette.primary.contrastText.secondary,
|
||||
"&.Mui-disabled": {
|
||||
opacity: 0.3,
|
||||
WebkitTextFillColor: "unset",
|
||||
@@ -241,7 +241,7 @@ const baseTheme = (palette) => ({
|
||||
"& .MuiInputBase-input:-webkit-autofill": {
|
||||
transition: "background-color 5000s ease-in-out 0s",
|
||||
WebkitBoxShadow: `0 0 0px 1000px ${theme.palette.background.main} inset`,
|
||||
WebkitTextFillColor: theme.palette.text.primary,
|
||||
WebkitTextFillColor: theme.palette.primary.contrastText.main,
|
||||
},
|
||||
"& .MuiInputBase-input.MuiOutlinedInput-input": {
|
||||
padding: "0 var(--env-var-spacing-1-minus) !important",
|
||||
|
||||
@@ -1,118 +1,31 @@
|
||||
import { createTheme } from "@mui/material";
|
||||
import { baseTheme } from "./globalTheme";
|
||||
import { colors } from "./constants";
|
||||
import { colors, newSemanticColors } from "./constants";
|
||||
|
||||
/*
|
||||
TODO
|
||||
Next step: check if all keys here are being used in the codebase. e.g.: Search codebase for palette.primary; also check for destructuring palette ('= theme.palette')
|
||||
*/
|
||||
function extractThemeColors(themeType, colorObject) {
|
||||
if (!["light", "dark"].includes(themeType)) {
|
||||
throw new Error('Invalid theme type. Use "light" or "dark".');
|
||||
}
|
||||
|
||||
const {
|
||||
primary,
|
||||
secondary,
|
||||
success,
|
||||
error,
|
||||
warning,
|
||||
neutral,
|
||||
gradient: {
|
||||
color1: { light: color1 },
|
||||
color2: { light: color2 },
|
||||
color3: { light: color3 },
|
||||
color4: { light: color4 },
|
||||
color5: { light: color5 },
|
||||
},
|
||||
background,
|
||||
text,
|
||||
border,
|
||||
unresolved,
|
||||
other,
|
||||
} = colors;
|
||||
const extract = (obj) => {
|
||||
if (typeof obj !== "object" || obj === null) {
|
||||
return obj;
|
||||
}
|
||||
|
||||
const palette = {
|
||||
/* TODO check if we need the addition of a new color gray150 for this. Also, this color would probably fit for primary contrastText */
|
||||
action: {
|
||||
disabled: border.light.disabled,
|
||||
},
|
||||
primary: { main: primary.main.light },
|
||||
secondary: {
|
||||
main: secondary.main.light,
|
||||
contrastText: secondary.contrastText.light,
|
||||
light: secondary.dark.light,
|
||||
dark: secondary.dark.light,
|
||||
},
|
||||
success: {
|
||||
main: success.main.light,
|
||||
contrastText: success.contrastText.light,
|
||||
light: success.light.light,
|
||||
dark: success.dark.light,
|
||||
},
|
||||
error: {
|
||||
main: error.main.light,
|
||||
contrastText: error.contrastText.light,
|
||||
light: error.light.light,
|
||||
dark: error.dark.light,
|
||||
},
|
||||
warning: {
|
||||
main: warning.main.light,
|
||||
light: warning.light.light,
|
||||
contrastText: warning.contrastText.light,
|
||||
dark: warning.dark.light,
|
||||
},
|
||||
neutral: {
|
||||
contrastText: neutral.contrastText.light,
|
||||
},
|
||||
/* From this part on, try to create semantic structure, not feature based structure */
|
||||
percentage: {
|
||||
uptimePoor: error.main.light,
|
||||
uptimeFair: warning.contrastText.light,
|
||||
uptimeGood: warning.main.light /* Change for a success color? */,
|
||||
uptimeExcellent: success.main.light,
|
||||
},
|
||||
unresolved: {
|
||||
main: unresolved.main.light,
|
||||
light: unresolved.light.light,
|
||||
bg: unresolved.bg.light,
|
||||
},
|
||||
divider: border.light.light,
|
||||
other: {
|
||||
icon: other.icon.light,
|
||||
line: other.line.light,
|
||||
fill: secondary.dark.light,
|
||||
grid: other.grid.light,
|
||||
autofill: other.autofill.light,
|
||||
},
|
||||
gradient: {
|
||||
color1,
|
||||
color2,
|
||||
color3,
|
||||
color4,
|
||||
color5,
|
||||
},
|
||||
text: {
|
||||
primary: text.primary.light,
|
||||
secondary: text.secondary.light,
|
||||
tertiary: text.tertiary.light,
|
||||
accent: text.accent.light,
|
||||
},
|
||||
background: {
|
||||
main: background.main.light,
|
||||
alt: background.alt.light,
|
||||
fill: background.fill.light,
|
||||
accent: background.accent.light,
|
||||
},
|
||||
border: {
|
||||
light: border.light.light,
|
||||
dark: border.dark.light,
|
||||
},
|
||||
info: {
|
||||
text: text.primary.light,
|
||||
main: text.tertiary.light,
|
||||
bg: background.main.light,
|
||||
light: background.main.light,
|
||||
border: border.dark.light,
|
||||
},
|
||||
};
|
||||
if ("light" in obj && "dark" in obj) {
|
||||
return obj[themeType]; // Return the value for the specified theme
|
||||
}
|
||||
|
||||
// Reduce the object, keeping only the extracted themeType values
|
||||
return Object.keys(obj).reduce((acc, key) => {
|
||||
acc[key] = extract(obj[key]);
|
||||
return acc;
|
||||
}, {});
|
||||
};
|
||||
|
||||
return extract(colorObject);
|
||||
}
|
||||
const palette = extractThemeColors("light", newSemanticColors);
|
||||
/* TODO I figured out we could have just one theme by passing mode as parameter for theme function. Implement later */
|
||||
const lightTheme = createTheme({
|
||||
palette,
|
||||
@@ -120,3 +33,114 @@ const lightTheme = createTheme({
|
||||
});
|
||||
|
||||
export default lightTheme;
|
||||
|
||||
/*
|
||||
TODO
|
||||
Next step: check if all keys here are being used in the codebase. e.g.: Search codebase for palette.primary; also check for destructuring palette ('= theme.palette')
|
||||
*/
|
||||
|
||||
// const {
|
||||
// primary,
|
||||
// secondary,
|
||||
// success,
|
||||
// error,
|
||||
// warning,
|
||||
// neutral,
|
||||
// gradient: {
|
||||
// color1: { light: color1 },
|
||||
// color2: { light: color2 },
|
||||
// color3: { light: color3 },
|
||||
// color4: { light: color4 },
|
||||
// color5: { light: color5 },
|
||||
// },
|
||||
// background,
|
||||
// text,
|
||||
// border,
|
||||
// unresolved,
|
||||
// other,
|
||||
// } = colors;
|
||||
|
||||
// const palette = {
|
||||
// /* TODO check if we need the addition of a new color gray150 for this. Also, this color would probably fit for primary contrastText */
|
||||
// action: {
|
||||
// disabled: border.light.disabled,
|
||||
// },
|
||||
// primary: { main: primary.main.light },
|
||||
// secondary: {
|
||||
// main: secondary.main.light,
|
||||
// contrastText: secondary.contrastText.light,
|
||||
// light: secondary.dark.light,
|
||||
// dark: secondary.dark.light,
|
||||
// },
|
||||
// success: {
|
||||
// main: success.main.light,
|
||||
// contrastText: success.contrastText.light,
|
||||
// light: success.light.light,
|
||||
// dark: success.dark.light,
|
||||
// },
|
||||
// error: {
|
||||
// main: error.main.light,
|
||||
// contrastText: error.contrastText.light,
|
||||
// light: error.light.light,
|
||||
// dark: error.dark.light,
|
||||
// },
|
||||
// warning: {
|
||||
// main: warning.main.light,
|
||||
// light: warning.light.light,
|
||||
// contrastText: warning.contrastText.light,
|
||||
// dark: warning.dark.light,
|
||||
// },
|
||||
// neutral: {
|
||||
// contrastText: neutral.contrastText.light,
|
||||
// },
|
||||
// /* From this part on, try to create semantic structure, not feature based structure */
|
||||
// percentage: {
|
||||
// uptimePoor: error.main.light,
|
||||
// uptimeFair: warning.contrastText.light,
|
||||
// uptimeGood: warning.main.light /* Change for a success color? */,
|
||||
// uptimeExcellent: success.main.light,
|
||||
// },
|
||||
// unresolved: {
|
||||
// main: unresolved.main.light,
|
||||
// light: unresolved.light.light,
|
||||
// bg: unresolved.bg.light,
|
||||
// },
|
||||
// divider: border.light.light,
|
||||
// other: {
|
||||
// icon: other.icon.light,
|
||||
// line: other.line.light,
|
||||
// fill: secondary.dark.light,
|
||||
// grid: other.grid.light,
|
||||
// autofill: other.autofill.light,
|
||||
// },
|
||||
// gradient: {
|
||||
// color1,
|
||||
// color2,
|
||||
// color3,
|
||||
// color4,
|
||||
// color5,
|
||||
// },
|
||||
// text: {
|
||||
// primary: text.primary.light,
|
||||
// secondary: text.secondary.light,
|
||||
// tertiary: text.tertiary.light,
|
||||
// accent: text.accent.light,
|
||||
// },
|
||||
// background: {
|
||||
// main: background.main.light,
|
||||
// alt: background.alt.light,
|
||||
// fill: background.fill.light,
|
||||
// accent: background.accent.light,
|
||||
// },
|
||||
// border: {
|
||||
// light: border.light.light,
|
||||
// dark: border.dark.light,
|
||||
// },
|
||||
// info: {
|
||||
// text: text.primary.light,
|
||||
// main: text.tertiary.light,
|
||||
// bg: background.main.light,
|
||||
// light: background.main.light,
|
||||
// border: border.dark.light,
|
||||
// },
|
||||
// };
|
||||
@@ -170,7 +170,7 @@ const Greeting = ({ type = "" }) => {
|
||||
component="span"
|
||||
fontSize="inherit"
|
||||
fontWeight="inherit"
|
||||
color={theme.palette.text.secondary}
|
||||
color={theme.palette.primary.contrastText.secondary}
|
||||
>
|
||||
{firstName} {emoji}
|
||||
</Typography>
|
||||
|
||||
Reference in new issue
Block a user