Skip to content

Commit f4e5656

Browse files
committed
fix: add more components to theme.js to add github copilot suggested
1 parent 7034472 commit f4e5656

18 files changed

Lines changed: 69 additions & 28 deletions

DashAI/front/src/components/generative/GenerativeChat.jsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { Box, Divider, IconButton, Typography } from "@mui/material";
2+
import { useTheme } from "@mui/material/styles";
23
import React from "react";
34
import InfoIcon from "@mui/icons-material/Info";
45
import ArrowRightAltIcon from "@mui/icons-material/ArrowRightAlt";
@@ -21,6 +22,7 @@ import JobQueueWidget from "../jobs/JobQueueWidget";
2122
import { getRunStatus } from "../../utils/runStatus";
2223

2324
export default function GenerativeChat({ sessionId, taskName, paramsVersion }) {
25+
const theme = useTheme();
2426
const [history, setHistory] = useState([]);
2527
const [messages, setMessages] = useState([]);
2628
const [messagesWithHistory, setMessagesWithHistory] = useState([]);
@@ -251,11 +253,11 @@ export default function GenerativeChat({ sessionId, taskName, paramsVersion }) {
251253
width: "8px",
252254
},
253255
"&::-webkit-scrollbar-thumb": {
254-
backgroundColor: "ui.border",
256+
backgroundColor: theme.palette.ui.border,
255257
borderRadius: "4px",
256258
},
257259
"&::-webkit-scrollbar-thumb:hover": {
258-
backgroundColor: "action.hover",
260+
backgroundColor: theme.palette.ui.hover,
259261
},
260262
}}
261263
>

DashAI/front/src/components/generative/MessageContent.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export function MessageContent({ messages, isUser, isWaiting }) {
99
return (
1010
<Paper
1111
sx={{
12-
backgroundColor: "ui.box",
12+
backgroundColor: theme.palette.ui.box,
1313
color: "text.primary",
1414
padding: theme.spacing(1.5, 2),
1515
maxWidth: "100%",

DashAI/front/src/components/generative/SessionBar.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ export default function SessionBar({
150150
<Box
151151
sx={{
152152
ml: 1,
153-
bgcolor: "ui.border",
153+
bgcolor: theme.palette.ui.border,
154154
color: "text.primary",
155155
borderRadius: "50%",
156156
width: 20,

DashAI/front/src/components/generative/SessionBarHeader.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export default function SessionBarHeader() {
1515
variant="h6"
1616
sx={{
1717
fontWeight: "bold",
18-
"& span": { color: "accent.main" },
18+
"& span": { color: theme.palette.accent.main },
1919
}}
2020
>
2121
<span>D</span>a<span>sh</span>

DashAI/front/src/components/generative/SessionList.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,11 @@ export default function SessionList({
4949
width: "6px",
5050
},
5151
"&::-webkit-scrollbar-thumb": {
52-
backgroundColor: "ui.border",
52+
backgroundColor: theme.palette.ui.border,
5353
borderRadius: "3px",
5454
},
5555
"&::-webkit-scrollbar-thumb:hover": {
56-
backgroundColor: "action.hover",
56+
backgroundColor: theme.palette.ui.hover,
5757
},
5858
overflowY: "auto",
5959
flex: 1,
@@ -105,7 +105,7 @@ export default function SessionList({
105105
<Box
106106
sx={{
107107
ml: 1,
108-
bgcolor: "ui.border",
108+
bgcolor: theme.palette.ui.border,
109109
color: "text.primary",
110110
borderRadius: "50%",
111111
width: 20,

DashAI/front/src/components/notebooks/RightBar.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -380,10 +380,10 @@ export default function RightBar({ notebook, onToggle }) {
380380
"& .MuiToggleButton-root": {
381381
color: "text.secondary",
382382
border: "1px solid",
383-
borderColor: "ui.border",
383+
borderColor: theme.palette.ui.border,
384384
"&.Mui-selected": {
385-
bgcolor: "ui.border",
386-
color: "accent.main",
385+
bgcolor: theme.palette.ui.border,
386+
color: theme.palette.accent.main,
387387
},
388388
},
389389
}}

DashAI/front/src/components/notebooks/dataset/header/HeaderBox.jsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
import React from "react";
22
import { Box, Typography, Tooltip } from "@mui/material";
3+
import { useTheme } from "@mui/material/styles";
34

45
export function HeaderBox({ title, value, IconComponent, iconColor, bgColor }) {
6+
const theme = useTheme();
57
return (
68
<Box
79
sx={{
810
minWidth: "140px",
911
height: "100%",
1012
flex: "1 1 0",
1113
borderRadius: 2,
12-
bgcolor: "ui.box",
14+
bgcolor: theme.palette.ui.box,
1315
display: "flex",
1416
flexDirection: "column",
1517
justifyContent: "center",

DashAI/front/src/components/notebooks/dataset/tabs/CategoricalTab.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export const CategoricalTab = ({ categoricalStats }) => {
2323
<Box display="flex" flexDirection="column" gap={4}>
2424
{Object.entries(categoricalStats).map(([column, stats]) => (
2525
<Card key={column} sx={{ borderRadius: 2 }}>
26-
<CardContent sx={{ bgcolor: "ui.box" }}>
26+
<CardContent sx={{ bgcolor: theme.palette.ui.box }}>
2727
{/* Header */}
2828
<Box display="flex" alignItems="center" mb={2}>
2929
<TitleIcon sx={{ color: "primary.main", mr: 1 }} />

DashAI/front/src/components/notebooks/dataset/tabs/NumericTab.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export const NumericTab = ({ numericStats }) => {
1414
<Box display="flex" flexDirection="column" gap={4}>
1515
{Object.entries(numericStats).map(([column, stats]) => (
1616
<Card key={column} sx={{ borderRadius: 2 }}>
17-
<CardContent sx={{ bgcolor: "ui.box" }}>
17+
<CardContent sx={{ bgcolor: theme.palette.ui.box }}>
1818
{/* Title */}
1919
<Box display="flex" alignItems="center" mb={2}>
2020
<TrendingUpIcon sx={{ color: "primary.main", mr: 1 }} />

DashAI/front/src/components/notebooks/dataset/tabs/OverviewTab.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ const OverviewTab = ({
6161
</Card>
6262
{/* Missing Values Overview */}
6363
<Card>
64-
<CardContent sx={{ bgcolor: "ui.box" }}>
64+
<CardContent sx={{ bgcolor: theme.palette.ui.box }}>
6565
<Typography variant="h6" gutterBottom>
6666
Missing Values Overview
6767
</Typography>
@@ -95,7 +95,7 @@ const OverviewTab = ({
9595

9696
{/* Column Types Distribution */}
9797
<Card>
98-
<CardContent sx={{ bgcolor: "ui.box" }}>
98+
<CardContent sx={{ bgcolor: theme.palette.ui.box }}>
9999
<Typography variant="h6" gutterBottom>
100100
Column Types Distribution
101101
</Typography>
@@ -107,7 +107,7 @@ const OverviewTab = ({
107107
sx={{
108108
p: 2,
109109
textAlign: "center",
110-
bgcolor: "ui.disabled",
110+
bgcolor: theme.palette.ui.disabled,
111111
borderRadius: 2,
112112
}}
113113
>

0 commit comments

Comments
 (0)