diff --git a/src/layouts/DefaultLayout/index.js b/src/layouts/DefaultLayout/index.js index e3a9881..e0686a7 100644 --- a/src/layouts/DefaultLayout/index.js +++ b/src/layouts/DefaultLayout/index.js @@ -1,4 +1,4 @@ -import React, { useEffect } from 'react'; +import React, { useEffect, useState } from 'react'; import { __ } from '@wordpress/i18n'; import { useLocation } from 'react-router-dom'; @@ -8,15 +8,26 @@ 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 }) => { const isError404 = useStoreValue('isError404'); 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 (
Error 404
: children} +