2021-02-24 11:03:18 +01:00
|
|
|
import React from 'react';
|
2021-03-30 15:14:02 +02:00
|
|
|
import { NavLink } from 'react-router-dom';
|
2021-05-18 12:59:48 +02:00
|
|
|
import { Paper, Tabs, Tab } from '@material-ui/core';
|
2021-03-30 15:14:02 +02:00
|
|
|
|
|
|
|
const navLinkStyle = {
|
|
|
|
display: 'flex',
|
|
|
|
justifyContent: 'center',
|
|
|
|
alignItems: 'center',
|
|
|
|
width: '100%',
|
|
|
|
textDecoration: 'none',
|
|
|
|
color: 'inherit',
|
|
|
|
padding: '0.8rem 1.5rem',
|
|
|
|
};
|
|
|
|
|
|
|
|
const activeNavLinkStyle = {
|
|
|
|
fontWeight: 'bold',
|
|
|
|
borderRadius: '3px',
|
|
|
|
padding: '0.8rem 1.5rem',
|
|
|
|
};
|
|
|
|
|
2021-05-18 12:59:48 +02:00
|
|
|
function AdminMenu({ history }) {
|
2021-04-16 11:31:47 +02:00
|
|
|
const { location } = history;
|
|
|
|
const { pathname } = location;
|
2021-02-24 11:03:18 +01:00
|
|
|
return (
|
2021-04-16 11:31:47 +02:00
|
|
|
<Paper style={{ marginBottom: '1rem' }}>
|
2021-05-18 12:59:48 +02:00
|
|
|
<Tabs centered value={pathname}>
|
|
|
|
<Tab
|
|
|
|
value="/admin/users"
|
|
|
|
label={
|
|
|
|
<NavLink
|
|
|
|
to="/admin/users"
|
|
|
|
activeStyle={activeNavLinkStyle}
|
|
|
|
style={navLinkStyle}
|
|
|
|
>
|
2021-04-16 11:31:47 +02:00
|
|
|
<span>Users</span>
|
2021-05-18 12:59:48 +02:00
|
|
|
</NavLink>
|
|
|
|
}
|
|
|
|
></Tab>
|
|
|
|
<Tab
|
|
|
|
value="/admin/api"
|
|
|
|
label={
|
|
|
|
<NavLink
|
|
|
|
to="/admin/api"
|
|
|
|
activeStyle={activeNavLinkStyle}
|
|
|
|
style={navLinkStyle}
|
|
|
|
>
|
|
|
|
API Access
|
|
|
|
</NavLink>
|
|
|
|
}
|
|
|
|
></Tab>
|
|
|
|
<Tab
|
|
|
|
value="/admin/auth"
|
|
|
|
label={
|
|
|
|
<NavLink
|
|
|
|
to="/admin/auth"
|
|
|
|
activeStyle={activeNavLinkStyle}
|
|
|
|
style={navLinkStyle}
|
|
|
|
>
|
2021-08-23 12:16:38 +02:00
|
|
|
Single Sign-On
|
2021-05-18 12:59:48 +02:00
|
|
|
</NavLink>
|
2021-04-16 11:31:47 +02:00
|
|
|
}
|
2021-05-18 12:59:48 +02:00
|
|
|
></Tab>
|
2021-04-16 11:31:47 +02:00
|
|
|
</Tabs>
|
|
|
|
</Paper>
|
2021-02-24 11:03:18 +01:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
export default AdminMenu;
|