- updates and fixes;
This commit is contained in:
@@ -1,6 +1,10 @@
|
||||
import React, { useRef } from 'react';
|
||||
import React, { useEffect, useRef } from 'react';
|
||||
import { Link } from 'react-router-dom';
|
||||
import { __ } from '@wordpress/i18n';
|
||||
import { useLocation } from 'react-router-dom';
|
||||
|
||||
// store
|
||||
import { useStore, storeSet } from '../../store';
|
||||
|
||||
// components
|
||||
import { Toolbar } from 'primereact/toolbar';
|
||||
@@ -15,6 +19,12 @@ import AppSidebar from './components/AppSidebar';
|
||||
|
||||
const DefaultLayout = ({ children }) => {
|
||||
const menuLeft = useRef(null);
|
||||
const isError404 = useStore().main.isError404();
|
||||
const location = useLocation();
|
||||
|
||||
useEffect(() => {
|
||||
storeSet.main.isError404(false);
|
||||
}, [location]);
|
||||
|
||||
const startContent = <Link to="/">
|
||||
<LogoIcon/>
|
||||
@@ -47,7 +57,9 @@ const DefaultLayout = ({ children }) => {
|
||||
<div className="inner">
|
||||
<AppSidebar/>
|
||||
<main>
|
||||
{children}
|
||||
{isError404
|
||||
? <p>Error 404</p>
|
||||
: children}
|
||||
|
||||
<footer>
|
||||
<p>{__('© 2024 Gepafin. Tutti i diritti riservati.', 'gepafin')}</p>
|
||||
|
||||
Reference in New Issue
Block a user