- 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 { useLocation } from 'react-router-dom';
|
||||
|
||||
@@ -8,7 +8,6 @@ import { useStoreValue, storeSet } from '../../store';
|
||||
// components
|
||||
import AppSidebar from './components/AppSidebar';
|
||||
import AppTopbar from './components/AppTopbar';
|
||||
import { Dialog } from 'primereact/dialog';
|
||||
import { pathOr } from 'ramda';
|
||||
|
||||
const DefaultLayout = ({ children }) => {
|
||||
@@ -16,18 +15,11 @@ const DefaultLayout = ({ children }) => {
|
||||
const location = useLocation();
|
||||
const userData = useStoreValue('userData');
|
||||
const role = pathOr('', ['role', 'roleType'], userData);
|
||||
const [visible, setVisible] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
storeSet('isError404', false);
|
||||
}, [location]);
|
||||
|
||||
useEffect(() => {
|
||||
if (['ROLE_BENEFICIARY', 'ROLE_CONFIDI'].includes(role)) {
|
||||
setVisible(true);
|
||||
}
|
||||
}, [role]);
|
||||
|
||||
return (
|
||||
<div className="wrapper">
|
||||
<AppTopbar/>
|
||||
@@ -37,15 +29,6 @@ const DefaultLayout = ({ children }) => {
|
||||
{isError404
|
||||
? <p>Error 404</p>
|
||||
: 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>
|
||||
<p>{__('© 2024 Gepafin. Tutti i diritti riservati.', 'gepafin')}</p>
|
||||
</footer>
|
||||
|
||||
Reference in New Issue
Block a user