MCPcopy Create free account
hub / github.com/OpenSIST/OpenSIST.github.io / SideBar

Function SideBar

src/Components/ProgramPage/SideBar/SideBar.jsx:21–63  ·  view source on GitHub ↗
({loaderData})

Source from the content-addressed store, hash-verified

19}, {});
20
21export default function SideBar({loaderData}) {
22 const univProgramList = loaderData.programs;
23 return (
24 <MetadataContext.Provider value={loaderData.metadata}>
25 <CollapseSideBar
26 sx={{
27 '& .MuiDrawer-paper': {
28 bgcolor: (theme) => theme.palette.surface,
29 width: '250px',
30 height: 'calc(100vh - 120px)',
31 p: '20px',
32 mt: '10px',
33 gap: '10px',
34 }
35 }}
36 >
37 <SearchBar query={getQuery(loaderData)} pageName='program'/>
38 <Box sx={{display: 'flex', alignItems: 'center', justifyContent: 'space-between', px: '2px'}}>
39 <Typography variant='caption' sx={{color: 'text.secondary', fontWeight: 600, letterSpacing: '0.04em'}}>
40 学校列表
41 </Typography>
42 <Box sx={{display: 'flex', gap: '2px'}}>
43 <Form action='/programs/new'>
44 <Tooltip title='添加新项目' arrow>
45 <IconButton type='submit' size='small' sx={{color: 'text.secondary'}}>
46 <Add fontSize='small'/>
47 </IconButton>
48 </Tooltip>
49 </Form>
50 <Form method='post'>
51 <Tooltip title='刷新项目列表' arrow>
52 <IconButton type='submit' size='small' sx={{color: 'text.secondary'}}>
53 <Refresh fontSize='small'/>
54 </IconButton>
55 </Tooltip>
56 </Form>
57 </Box>
58 </Box>
59 <UnivProgramList univProgramList={univProgramList}/>
60 </CollapseSideBar>
61 </MetadataContext.Provider>
62 );
63}
64
65export function UnivProgramList({univProgramList, ButtonComponent = ProgramButton}) {
66 const [selectProgram, setSelectProgram] = React.useState(null);

Callers

nothing calls this directly

Calls 1

getQueryFunction · 0.85

Tested by

no test coverage detected