Replaced hardcoded values with theme variables

This commit is contained in:
Daniel Cojocea committed 2024-08-19 19:28:58 -04:00
1 parent 720913dcd3
commit 3c5882f687
3 files changed
+15 -13

No files matched your search

+2 -1
View File
@@ -177,10 +177,11 @@
} }
.pagination-dropdown li { .pagination-dropdown li {
font-size: var(--env-var-font-size-medium); font-size: var(--env-var-font-size-medium);
color: var(--env-var-color-2);
padding: 4px; padding: 4px;
} }
.pagination-dropdown li.Mui-selected, .pagination-dropdown li.Mui-selected,
.pagination-dropdown li.Mui-selected.Mui-focusVisible, .pagination-dropdown li.Mui-selected.Mui-focusVisible,
.pagination-dropdown li.Mui-selected:hover { .pagination-dropdown li.Mui-selected:hover {
background-color: #f4f4f4; background-color: #f4f4f4;
} }
+10 -8
View File
@@ -1,5 +1,6 @@
import PropTypes from "prop-types"; import PropTypes from "prop-types";
import { useState, useEffect } from "react"; import { useState, useEffect } from "react";
import { useTheme } from "@emotion/react";
import { import {
TableContainer, TableContainer,
Paper, Paper,
@@ -20,7 +21,6 @@ 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 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).
* *
@@ -50,7 +50,7 @@ const TablePaginationActions = (props) => {
}; };
return ( return (
<Box sx={{ flexShrink: 0, ml: "25px" }}> <Box sx={{ flexShrink: 0, ml: "24px" }}>
<Button <Button
level="secondary" level="secondary"
label="" label=""
@@ -141,8 +141,7 @@ const TablePaginationActions = (props) => {
*/ */
const BasicTable = ({ data, paginated, reversed, rows = 5 }) => { const BasicTable = ({ data, paginated, reversed, rows = 5 }) => {
// Add headers to props validation const theme = useTheme();
const [page, setPage] = useState(0); const [page, setPage] = useState(0);
const [rowsPerPage, setRowsPerPage] = useState(rows); const [rowsPerPage, setRowsPerPage] = useState(rows);
@@ -243,14 +242,17 @@ const BasicTable = ({ data, paginated, reversed, rows = 5 }) => {
inputProps: { id: "pagination-dropdown" }, inputProps: { id: "pagination-dropdown" },
IconComponent: SelectorVertical, IconComponent: SelectorVertical,
sx: { sx: {
ml: "8px", ml: theme.gap.small,
mr: "25px", mr: theme.gap.large,
minWidth: "50px", minWidth: theme.gap.xl,
textAlign: "left", textAlign: "left",
"&.Mui-focused > div": { backgroundColor: "white" }, "&.Mui-focused > div": {
backgroundColor: theme.palette.otherColors.white,
},
}, },
}, },
}} }}
sx={{ mt: theme.gap.medium }}
/> />
</Stack> </Stack>
</> </>
+3 -4
View File
@@ -436,8 +436,7 @@ const Monitors = () => {
<ServerStatus title="Down" value={down} state="down" /> <ServerStatus title="Down" value={down} state="down" />
<ServerStatus title="Paused" value={0} state="pause" /> <ServerStatus title="Paused" value={0} state="pause" />
</Stack> </Stack>
<Stack <Box
gap={theme.gap.large}
p={theme.gap.lgplus} p={theme.gap.lgplus}
border={1} border={1}
borderColor={theme.palette.otherColors.graishWhite} borderColor={theme.palette.otherColors.graishWhite}
@@ -446,7 +445,7 @@ const Monitors = () => {
borderRadius: `${theme.shape.borderRadius}px`, borderRadius: `${theme.shape.borderRadius}px`,
}} }}
> >
<Stack direction="row" alignItems="center"> <Stack direction="row" alignItems="center" mb={theme.gap.large}>
<Typography component="h2">Current monitors</Typography> <Typography component="h2">Current monitors</Typography>
<Box className="current-monitors-counter"> <Box className="current-monitors-counter">
{monitorState.monitors.length} {monitorState.monitors.length}
@@ -454,7 +453,7 @@ const Monitors = () => {
{/* TODO - add search bar */} {/* TODO - add search bar */}
</Stack> </Stack>
<BasicTable data={data} paginated={true} /> <BasicTable data={data} paginated={true} />
</Stack>{" "} </Box>
</> </>
)} )}
</> </>