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