2020-08-03 16:49:40 +02:00
|
|
|
import React from 'react';
|
2020-08-04 15:15:08 +02:00
|
|
|
import { Switch, Route } from 'react-router-dom';
|
2021-04-29 13:51:12 +02:00
|
|
|
import { useGlobalContext, NotFound } from '@strapi/helper-plugin';
|
2020-08-04 13:07:55 +02:00
|
|
|
import pluginId from '../../pluginId';
|
2020-08-03 16:49:40 +02:00
|
|
|
|
2020-08-04 15:15:08 +02:00
|
|
|
import ProtectedRolesListPage from './ProtectedListPage';
|
2020-08-04 13:07:55 +02:00
|
|
|
import ProtectedRolesEditPage from './ProtectedEditPage';
|
|
|
|
|
import ProtectedRolesCreatePage from './ProtectedCreatePage';
|
|
|
|
|
|
|
|
|
|
const Roles = () => {
|
|
|
|
|
const { settingsBaseURL } = useGlobalContext();
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<Switch>
|
|
|
|
|
<Route
|
|
|
|
|
path={`${settingsBaseURL}/${pluginId}/roles/new`}
|
|
|
|
|
component={ProtectedRolesCreatePage}
|
|
|
|
|
exact
|
|
|
|
|
/>
|
|
|
|
|
<Route
|
|
|
|
|
path={`${settingsBaseURL}/${pluginId}/roles/:id`}
|
|
|
|
|
component={ProtectedRolesEditPage}
|
|
|
|
|
exact
|
|
|
|
|
/>
|
2020-08-04 15:15:08 +02:00
|
|
|
<Route
|
|
|
|
|
path={`${settingsBaseURL}/${pluginId}/roles`}
|
|
|
|
|
component={ProtectedRolesListPage}
|
|
|
|
|
exact
|
|
|
|
|
/>
|
2020-08-04 13:07:55 +02:00
|
|
|
<Route path="" component={NotFound} />
|
|
|
|
|
</Switch>
|
|
|
|
|
);
|
2020-08-03 16:49:40 +02:00
|
|
|
};
|
|
|
|
|
|
2020-08-04 13:07:55 +02:00
|
|
|
export default Roles;
|