diff --git a/appv2/src/UI/App.tsx b/appv2/src/UI/App.tsx
index 7b9ec96cb..a944051c8 100644
--- a/appv2/src/UI/App.tsx
+++ b/appv2/src/UI/App.tsx
@@ -35,6 +35,7 @@ import { Browser } from "@capacitor/browser";
import { LayerPickerBasic } from './Map/LayerPickerBasic';
import { NewRecord } from './Map/Buttons/NewRecord';
import NewRecordDialog from './Map/Buttons/NewRecordDialog';
+import AccessRequestPage from './Overlay/AccessRequest/AccessRequestPage';
// URL listener so that the auth saga can redirect to the correct page
const URL_LISTENER = (props) => {
@@ -147,11 +148,12 @@ const OverlayContentMemo = React.memo((props: any) => {
path="/Batch/list/:id"
render={(props) => }
/>
- } />
- } />
- } />
- } />
- } />
+ }/>
+ }/>
+ }/>
+ }/>
+ }/>
+ }/>
} />
diff --git a/appv2/src/UI/Header/Header.tsx b/appv2/src/UI/Header/Header.tsx
index 08c5da926..e67e152eb 100644
--- a/appv2/src/UI/Header/Header.tsx
+++ b/appv2/src/UI/Header/Header.tsx
@@ -202,6 +202,10 @@ const AdminPanelMemo = React.memo((props) => {
});
const LoginOrOutMemo = React.memo((props) => {
+ const dispatch = useDispatch();
+ const history = useHistory();
+ const authenticated = useSelector((state: any) => state?.Auth?.authenticated);
+ const activated = useSelector((state: any) => state?.UserInfo?.activated);
const [anchorEl, setAnchorEl] = React.useState(null);
const openMenu = Boolean(anchorEl);
const handleClick = (event: React.MouseEvent) => {
@@ -214,11 +218,30 @@ const LoginOrOutMemo = React.memo((props) => {
};
const navToUpdateRequest = () => {
- return null;
+ history.push({
+ pathname: '/AccessRequest',
+ state: {
+ updateInfo: true
+ }
+ });
+ dispatch({
+ type: TOGGLE_PANEL,
+ payload: { panelOpen: true, fullScreen: true }
+ });
}
- const authenticated = useSelector((state: any) => state?.Auth?.authenticated);
- const activated = useSelector((state: any) => state?.UserInfo?.activated);
+ const requestAccess = async () => {
+ if (!authenticated) {
+ dispatch({ type: AUTH_SIGNIN_REQUEST });
+ } else {
+ history.push('/AccessRequest');
+ dispatch({
+ type: TOGGLE_PANEL,
+ payload: { panelOpen: true, fullScreen: true }
+ });
+ }
+ };
+
return
@@ -231,16 +254,16 @@ const LoginOrOutMemo = React.memo((props) => {
elevation: 3
}}
transformOrigin={{ horizontal: 'right', vertical: 'top' }}>
- {/* {showLoggedInTabs && ( */}
+ {activated &&
- {/* )} */}
+ }
{!activated &&
-