- removed redundant modal window;
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
import React, { useEffect, useState } from 'react';
|
import React, { useEffect } from 'react';
|
||||||
import { __ } from '@wordpress/i18n';
|
import { __ } from '@wordpress/i18n';
|
||||||
import { useLocation } from 'react-router-dom';
|
import { useLocation } from 'react-router-dom';
|
||||||
|
|
||||||
@@ -8,7 +8,6 @@ import { useStoreValue, storeSet } from '../../store';
|
|||||||
// components
|
// components
|
||||||
import AppSidebar from './components/AppSidebar';
|
import AppSidebar from './components/AppSidebar';
|
||||||
import AppTopbar from './components/AppTopbar';
|
import AppTopbar from './components/AppTopbar';
|
||||||
import { Dialog } from 'primereact/dialog';
|
|
||||||
import { pathOr } from 'ramda';
|
import { pathOr } from 'ramda';
|
||||||
|
|
||||||
const DefaultLayout = ({ children }) => {
|
const DefaultLayout = ({ children }) => {
|
||||||
@@ -16,18 +15,11 @@ const DefaultLayout = ({ children }) => {
|
|||||||
const location = useLocation();
|
const location = useLocation();
|
||||||
const userData = useStoreValue('userData');
|
const userData = useStoreValue('userData');
|
||||||
const role = pathOr('', ['role', 'roleType'], userData);
|
const role = pathOr('', ['role', 'roleType'], userData);
|
||||||
const [visible, setVisible] = useState(false);
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
storeSet('isError404', false);
|
storeSet('isError404', false);
|
||||||
}, [location]);
|
}, [location]);
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
if (['ROLE_BENEFICIARY', 'ROLE_CONFIDI'].includes(role)) {
|
|
||||||
setVisible(true);
|
|
||||||
}
|
|
||||||
}, [role]);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="wrapper">
|
<div className="wrapper">
|
||||||
<AppTopbar/>
|
<AppTopbar/>
|
||||||
@@ -37,15 +29,6 @@ const DefaultLayout = ({ children }) => {
|
|||||||
{isError404
|
{isError404
|
||||||
? <p>Error 404</p>
|
? <p>Error 404</p>
|
||||||
: children}
|
: children}
|
||||||
|
|
||||||
<Dialog header="Header" visible={visible} style={{ width: '50vw' }} onHide={() => {if (!visible) return; setVisible(false); }}>
|
|
||||||
<p className="m-0">
|
|
||||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
|
|
||||||
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
|
|
||||||
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
|
|
||||||
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
|
|
||||||
</p>
|
|
||||||
</Dialog>
|
|
||||||
<footer>
|
<footer>
|
||||||
<p>{__('© 2024 Gepafin. Tutti i diritti riservati.', 'gepafin')}</p>
|
<p>{__('© 2024 Gepafin. Tutti i diritti riservati.', 'gepafin')}</p>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
Reference in New Issue
Block a user