File tree Expand file tree Collapse file tree
src/Components/ProgramPage/ProgramContent Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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}
Original file line number Diff line number Diff line change 11import { StarRounded , StarBorderRounded } from "@mui/icons-material" ;
2- import { IconButton , Tooltip } from "@mui/material" ;
2+ import { IconButton , Tooltip , useTheme } from "@mui/material" ;
33import { Form } from "react-router-dom" ;
44
55const 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 >
You can’t perform that action at this time.
0 commit comments