- updates and fixes;

This commit is contained in:
Vitalii Kiiko
2024-09-03 17:24:41 +02:00
parent 429ca3c1d1
commit 949ff95933
21 changed files with 342 additions and 117 deletions

View File

@@ -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>