Skip to content

Commit 5fee458

Browse files
Merge remote-tracking branch 'origin/dev' into dev
2 parents da033b2 + 8dafee8 commit 5fee458

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,6 @@
7171
},
7272
"devDependencies": {
7373
"@babel/plugin-proposal-private-property-in-object": "7.21.0",
74-
"webpack": "5.89.0"
74+
"webpack": "5.94.0"
7575
}
7676
}

src/Components/ProgramPage/ProgramContent/StarButton.jsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
import { StarRounded, StarBorderRounded } from "@mui/icons-material";
2-
import { IconButton, Tooltip } from "@mui/material";
2+
import { IconButton, Tooltip, useTheme } from "@mui/material";
33
import { Form } from "react-router-dom";
44

55
const StarButton = ({programID, metaData}) => {
6+
const theme = useTheme()
7+
const darkMode = theme.palette.mode === "dark"
68
const starred = metaData.ProgramCollection && metaData.ProgramCollection.includes(programID)
9+
const color = darkMode ? "#ff9f0a" : "#ff9500"
710

811
return <Form method='post' style={{display: 'flex'}}>
912
<Tooltip title={starred ? "取消收藏该项目" : "收藏该项目"} arrow>
1013
<IconButton type="submit" name="ActionType" value={starred ? "UnStar" : "Star"}>
11-
{starred ? <StarRounded/> : <StarBorderRounded/>}
14+
{starred ? <StarRounded style= {{color: color}}/> : <StarBorderRounded/>}
1215
</IconButton>
1316
</Tooltip>
1417
</Form>

0 commit comments

Comments
 (0)