Skip to content

Commit 39c729f

Browse files
committed
fix: finished styling
Signed-off-by: Alejandro Parcet <[email protected]>
1 parent 1deda44 commit 39c729f

File tree

4 files changed

+16
-17
lines changed

4 files changed

+16
-17
lines changed

node/src/components/navigation/Header.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { HelpOutline, InfoOutline } from "@mui/icons-material";
2-
import { Box, Typography, styled } from "@mui/material";
2+
import { Box, Typography, styled, useTheme } from "@mui/material";
33
import CustomTooltip from "../utils/CustomTooltip";
44

55
const HeaderContainer = styled("div", {
@@ -44,6 +44,7 @@ const types: { [key in HeaderTypes]: TypographyVariant } = {
4444

4545
function Header(props: HeaderProps) {
4646
const { tabTitle, infoText, ExtendedInfoText, headerType, helpContents, fontWeight } = props;
47+
const theme = useTheme();
4748
return (
4849
<HeaderContainer headerType={headerType}>
4950
<Box flex={1} display="flex" alignItems="center">
@@ -58,29 +59,29 @@ function Header(props: HeaderProps) {
5859
{infoText && infoText.length > 0 && (
5960
<CustomTooltip title={infoText} ExtendedTootlip={ExtendedInfoText} placement="right" arrow>
6061
<InfoOutline
61-
sx={theme => ({
62+
sx={{
6263
color: theme.palette.primary.light,
6364
backgroundColor: theme.palette.background.default,
6465
borderRadius: "50%",
6566
padding: "2px",
6667
marginLeft: "8px",
6768
marginBottom: "2px",
6869
fontSize: "24px",
69-
})}
70+
}}
7071
/>
7172
</CustomTooltip>
7273
)}
7374
</Box>
7475
{helpContents && (
7576
<CustomTooltip title={helpContents} placement="right" arrow>
7677
<HelpOutline
77-
sx={theme => ({
78+
sx={{
7879
color: theme.palette.primary.light,
7980
backgroundColor: theme.palette.background.default,
8081
borderRadius: "50%",
8182
padding: "2px",
8283
fontSize: "32px",
83-
})}
84+
}}
8485
/>
8586
</CustomTooltip>
8687
)}

node/src/components/plots/MOGAParetoTable.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -187,11 +187,7 @@ function MogaParetoTable({ tableData, hovered, setHovered }: MogaParetoTableProp
187187

188188
return (
189189
<>
190-
<Header
191-
tabTitle="Pareto-Optimal MOGA Samples"
192-
headerType="subTitle"
193-
ExtendedInfoText="Explore the pareto-optimal solutions."
194-
/>
190+
<Header tabTitle="Pareto-Optimal MOGA Samples" headerType="subTitle" infoText="Explore the pareto-optimal solutions" />
195191
<DataGrid
196192
rows={data?.rows || []}
197193
columns={columns}

node/src/components/sampling/JobSampling.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { InfoOutline } from "@mui/icons-material";
2-
import { Accordion, Button, AccordionDetails } from "@mui/material";
2+
import { Accordion, Button, AccordionDetails, useTheme } from "@mui/material";
33
import React, { useState } from "react";
44
import CustomTooltip from "../utils/CustomTooltip";
55
import AdaptExtedSamplingDocument from "../documents/AdaptExtendSamplingDocument";
@@ -23,6 +23,7 @@ interface JobSamplingProps {
2323
export function JobSampling(props: JobSamplingProps) {
2424
const { loading, setLoading, progress, setProgress, jobProgress, setJobProgress, colsFetched, jobsFetched, selectedFunction } =
2525
props;
26+
const theme = useTheme();
2627
const [jobPanelOpen, setJobPanelOpen] = useState<boolean>(false);
2728

2829
return (
@@ -51,13 +52,13 @@ export function JobSampling(props: JobSamplingProps) {
5152
arrow
5253
>
5354
<InfoOutline
54-
sx={theme => ({
55+
sx={{
5556
color: loading ? theme.palette.grey[400] : theme.palette.primary.light,
5657
backgroundColor: loading ? theme.palette.grey[200] : theme.palette.background.default,
5758
borderRadius: "50%",
5859
padding: "2px",
5960
marginLeft: "8px",
60-
})}
61+
}}
6162
/>
6263
</CustomTooltip>
6364
</Button>

node/src/components/sampling/RunSamplingButton.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Button, CircularProgress } from "@mui/material";
1+
import { Button, CircularProgress, useTheme } from "@mui/material";
22
import { toast } from "react-toastify";
33
import { useServiceContext } from "../../context/ServiceContext";
44
import CustomTooltip from "../utils/CustomTooltip";
@@ -18,8 +18,9 @@ const tooltipMessage = {
1818
};
1919

2020
export function RunSamplingButton(props: RunSamplingButtonProps) {
21-
const { permissions } = useServiceContext();
2221
const { handleRunSampling, disabled } = props;
22+
const theme = useTheme();
23+
const { permissions } = useServiceContext();
2324
const { launchingSampling, setLaunchingSampling, setRunningSampling } = useSamplingContext();
2425
const simplifiedHost = getSimplifiedHost();
2526

@@ -52,12 +53,12 @@ export function RunSamplingButton(props: RunSamplingButtonProps) {
5253
variant="contained"
5354
onClick={handleRunSamplingWithErrorHandling}
5455
disabled={launchingSampling || disabled || permissions !== "WRITE"}
55-
sx={theme => ({
56+
sx={{
5657
"&:disabled": {
5758
backgroundColor: launchingSampling ? theme.palette.grey[100] : undefined,
5859
color: launchingSampling ? theme.palette.primary.contrastText : undefined,
5960
},
60-
})}
61+
}}
6162
>
6263
{launchingSampling ? (
6364
<>

0 commit comments

Comments
 (0)