Versión 0.1.5 - Se agrega basename
This commit is contained in:
parent
e020420014
commit
58d69e85b2
4 changed files with 21 additions and 5 deletions
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@chimera-pe/react-saas",
|
||||
"version": "0.1.4",
|
||||
"version": "0.1.5",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
|
|
|
@ -10,7 +10,7 @@ import Idioma from "./Idioma";
|
|||
import Tema from "./Tema";
|
||||
import MainRouter from "./MainRouter";
|
||||
|
||||
const InicializarInner = ({devURL,children}) => {
|
||||
const InicializarInner = ({devURL,basename,children}) => {
|
||||
const aplicacion = useSelector(store => store.aplicacion);
|
||||
|
||||
return (
|
||||
|
@ -27,7 +27,11 @@ const InicializarInner = ({devURL,children}) => {
|
|||
<Error titulo={"saas.inicializar.error.titulo"} texto={"saas.inicializar.error.mensaje"} />
|
||||
:
|
||||
<>
|
||||
<MainRouter devURL={devURL} requiereLogin={aplicacion.instancia.requiereLogin}>
|
||||
<MainRouter
|
||||
devURL={devURL}
|
||||
requiereLogin={aplicacion.instancia.requiereLogin}
|
||||
basename={basename}
|
||||
>
|
||||
{children}
|
||||
</MainRouter>
|
||||
<Notificacion />
|
||||
|
@ -39,6 +43,7 @@ const InicializarInner = ({devURL,children}) => {
|
|||
|
||||
InicializarInner.propTypes={
|
||||
devURL: PropTypes.string,
|
||||
basename: PropTypes.string,
|
||||
children: PropTypes.element.isRequired
|
||||
};
|
||||
|
||||
|
@ -48,6 +53,7 @@ const Inicializar = ({
|
|||
devAuthURL,
|
||||
messages,
|
||||
idiomaDefecto,
|
||||
basename,
|
||||
children
|
||||
}) => {
|
||||
const dispatch = useDispatch();
|
||||
|
@ -73,6 +79,7 @@ Inicializar.propTypes={
|
|||
devAuthURL: PropTypes.string,
|
||||
messages: PropTypes.object.isRequired,
|
||||
idiomaDefecto: PropTypes.string,
|
||||
basename: PropTypes.string,
|
||||
children: PropTypes.element.isRequired
|
||||
};
|
||||
|
||||
|
|
|
@ -22,8 +22,13 @@ RequiereAuth.propTypes={
|
|||
children: PropTypes.element.isRequired
|
||||
};
|
||||
|
||||
const MainRouter = ({devURL,requiereLogin,children}) => (
|
||||
<BrowserRouter>
|
||||
const MainRouter = ({
|
||||
devURL,
|
||||
requiereLogin,
|
||||
basename,
|
||||
children
|
||||
}) => (
|
||||
<BrowserRouter basename={basename}>
|
||||
<Routes>
|
||||
<Route path="/login" element={<Login devURL={devURL} />} />
|
||||
<Route
|
||||
|
@ -42,6 +47,7 @@ const MainRouter = ({devURL,requiereLogin,children}) => (
|
|||
MainRouter.propTypes={
|
||||
devURL: PropTypes.string,
|
||||
requiereLogin: PropTypes.bool,
|
||||
basename: PropTypes.string,
|
||||
children: PropTypes.element.isRequired
|
||||
};
|
||||
|
||||
|
|
|
@ -11,6 +11,7 @@ const SaasApp = ({
|
|||
dev = false,
|
||||
idiomaDefecto,
|
||||
messages,
|
||||
basename,
|
||||
children
|
||||
}) => {
|
||||
return (
|
||||
|
@ -21,6 +22,7 @@ const SaasApp = ({
|
|||
devAuthURL={dev ? devAuthURL : undefined}
|
||||
idiomaDefecto={idiomaDefecto}
|
||||
messages={messages}
|
||||
basename={basename}
|
||||
>
|
||||
{children}
|
||||
</Inicializar>
|
||||
|
@ -36,6 +38,7 @@ SaasApp.propTypes={
|
|||
dev: PropTypes.bool,
|
||||
idiomaDefecto: PropTypes.string,
|
||||
messages: PropTypes.object,
|
||||
basename: PropTypes.string,
|
||||
children: PropTypes.element.isRequired
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue