({program, selectProgram, setSelectProgram})
| 155 | } |
| 156 | |
| 157 | export function ProgramButton({program, selectProgram, setSelectProgram}) { |
| 158 | const theme = useTheme(); |
| 159 | const darkMode = theme.palette.mode === 'dark'; |
| 160 | const metadata = React.useContext(MetadataContext); |
| 161 | return ( |
| 162 | <ListItemButton |
| 163 | className='ProgramItem' |
| 164 | selected={program.ProgramID === selectProgram} |
| 165 | component={Link} |
| 166 | onClick={() => setSelectProgram(program.ProgramID)} |
| 167 | to={`${programsProgramPath(program.ProgramID)}${window.location.search}`} |
| 168 | sx={{ |
| 169 | pl: "3rem", |
| 170 | "&::before": { |
| 171 | background: darkMode ? grey[700] : grey[300], |
| 172 | }, |
| 173 | "&.Mui-selected": { |
| 174 | "&::before": { |
| 175 | background: (theme) => theme.palette.primary.main, |
| 176 | } |
| 177 | } |
| 178 | }} |
| 179 | key={program.ProgramID} |
| 180 | > |
| 181 | <ListItemText primary={program.Program} |
| 182 | secondary={program.TargetApplicantMajor.join('/')}/> |
| 183 | <StarButton programID={program.ProgramID} metadata={metadata}/> |
| 184 | </ListItemButton> |
| 185 | ) |
| 186 | } |
| 187 | |
| 188 | export function getQuery(loaderData) { |
| 189 | return { |
nothing calls this directly
no test coverage detected