diff --git a/client/src/components/Content.tsx b/client/src/components/Content.tsx index c04f6a43dc73837e3ac8d2b1b0af3ca9e3eb0dc7..1b0a23b069a75c342508eed0e03a7e5b2d0a360f 100644 --- a/client/src/components/Content.tsx +++ b/client/src/components/Content.tsx @@ -2,7 +2,12 @@ import { Box, Container } from '@material-ui/core'; import { Redirect, Route, Switch } from 'react-router-dom'; import { GroupAdmin } from './admin/GroupAdmin'; +import { GroupDocuments } from './admin/GroupDocuments'; import { GroupInfo } from './group/GroupInfo'; +import { GroupItems } from './admin/GroupItems'; +import { GroupMembers } from './admin/GroupMembers'; +import { GroupRentals } from './admin/GroupRentals'; +import { GroupStorages } from './admin/GroupStorages'; import { LoggedInHome } from './home/LoggedInHome'; import { LoggedOutHome } from './home/LoggedOutHome'; import { NotAuthorized } from './utils/NotAuthorized'; @@ -23,6 +28,11 @@ export const Content: React.FC = () => { <SwitchComponentByAuth isLoggedIn={<OwnProfile />} notLoggedIn={<NotAuthorized />} /> </Route> <Route path="/group/:id/info" component={GroupInfo} /> + <Route path="/group/:id/admin/members" component={GroupMembers} /> + <Route path="/group/:id/admin/rentals" component={GroupRentals} /> + <Route path="/group/:id/admin/documents" component={GroupDocuments} /> + <Route path="/group/:id/admin/storages" component={GroupStorages} /> + <Route path="/group/:id/admin/items" component={GroupItems} /> <Route path="/group/:id/admin" component={GroupAdmin} /> <Route exact path="/"> <SwitchComponentByAuth isLoggedIn={<LoggedInHome />} notLoggedIn={<LoggedOutHome />} /> diff --git a/client/src/components/admin/GroupAdmin.tsx b/client/src/components/admin/GroupAdmin.tsx index 35c707c5d80b2f5f21b86194376265ac0fccb708..c2151954c5b99b6cfc25c3b782ebebad18289f6e 100644 --- a/client/src/components/admin/GroupAdmin.tsx +++ b/client/src/components/admin/GroupAdmin.tsx @@ -30,7 +30,10 @@ export const GroupAdmin: React.FC = () => { </Typography> <Typography align="center" variant="subtitle1"> {/* TODO link to actual group */} - <StyledLink to={`/group/1/admin/members/unaccepted`} style={{ color: theme.palette.primary.dark }}> + <StyledLink + to={`/group/1/admin/members?role=applicant`} + style={{ color: theme.palette.primary.dark }} + > Bírálás </StyledLink> </Typography> @@ -45,7 +48,7 @@ export const GroupAdmin: React.FC = () => { </Typography> <Typography align="center" variant="subtitle1"> {/* TODO link to actual group */} - <StyledLink to={`/group/1/admin/rentals/active`} style={{ color: theme.palette.primary.dark }}> + <StyledLink to={`/group/1/admin/rentals?state=active`} style={{ color: theme.palette.primary.dark }}> Kezelés </StyledLink> </Typography> @@ -122,6 +125,18 @@ export const GroupAdmin: React.FC = () => { </Card> </StyledLink> </Grid> + <Grid item xs={12}> + {/* TODO link to actual group */} + <StyledLink to="/group/1/admin/rentals"> + <Card> + <CardContent> + <Typography align="center" variant="subtitle1"> + Kölcsönzések + </Typography> + </CardContent> + </Card> + </StyledLink> + </Grid> </Grid> </Grid> </Grid> diff --git a/client/src/components/admin/GroupDocuments.tsx b/client/src/components/admin/GroupDocuments.tsx new file mode 100644 index 0000000000000000000000000000000000000000..92f288914125b5546e06f1e3cb0fac5c80b6741c --- /dev/null +++ b/client/src/components/admin/GroupDocuments.tsx @@ -0,0 +1,11 @@ +import React from 'react'; +import { useLocation } from 'react-router-dom'; + +function useQuery() { + return new URLSearchParams(useLocation().search); +} + +export const GroupDocuments: React.FC = () => { + const query = useQuery(); + return <>ordered by = {query.get('order_by') || 'none'}</>; +}; diff --git a/client/src/components/admin/GroupItems.tsx b/client/src/components/admin/GroupItems.tsx new file mode 100644 index 0000000000000000000000000000000000000000..e990b136297ab001526779b5d4d84f071c2f230c --- /dev/null +++ b/client/src/components/admin/GroupItems.tsx @@ -0,0 +1,4 @@ +import React from 'react'; +export const GroupItems: React.FC = () => { + return <>items</>; +}; diff --git a/client/src/components/admin/GroupMembers.tsx b/client/src/components/admin/GroupMembers.tsx new file mode 100644 index 0000000000000000000000000000000000000000..9efab89439665a68a7b82eb9550c576d1f661d23 --- /dev/null +++ b/client/src/components/admin/GroupMembers.tsx @@ -0,0 +1,11 @@ +import React from 'react'; +import { useLocation } from 'react-router-dom'; + +function useQuery() { + return new URLSearchParams(useLocation().search); +} + +export const GroupMembers: React.FC = () => { + const query = useQuery(); + return <>filtered role = {query.get('role') || 'none'}</>; +}; diff --git a/client/src/components/admin/GroupRentals.tsx b/client/src/components/admin/GroupRentals.tsx new file mode 100644 index 0000000000000000000000000000000000000000..824d7374a872df5f2fbce155d667fac2bac89892 --- /dev/null +++ b/client/src/components/admin/GroupRentals.tsx @@ -0,0 +1,11 @@ +import React from 'react'; +import { useLocation } from 'react-router-dom'; + +function useQuery() { + return new URLSearchParams(useLocation().search); +} + +export const GroupRentals: React.FC = () => { + const query = useQuery(); + return <>filtered state = {query.get('state') || 'none'}</>; +}; diff --git a/client/src/components/admin/GroupStorages.tsx b/client/src/components/admin/GroupStorages.tsx new file mode 100644 index 0000000000000000000000000000000000000000..f926adbdd98d376d198f33c644ef9a2f06e5fb62 --- /dev/null +++ b/client/src/components/admin/GroupStorages.tsx @@ -0,0 +1,5 @@ +import React from 'react'; + +export const GroupStorages: React.FC = () => { + return <>storages</>; +};