From 116743978bdc3b15f11fe021f4b7c9ea33b9583c Mon Sep 17 00:00:00 2001 From: Daniel Stefan Date: Fri, 18 Mar 2022 18:40:49 +0200 Subject: [PATCH] feat: add organization page --- src/components/blocks/LeftNav.js | 6 +++++- src/pages/Organization/index.js | 13 ++++++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/src/components/blocks/LeftNav.js b/src/components/blocks/LeftNav.js index 2c44d322..022f02bf 100644 --- a/src/components/blocks/LeftNav.js +++ b/src/components/blocks/LeftNav.js @@ -175,7 +175,11 @@ const LeftNav = withTheme(({ children }) => { )} {myOrgIsNotCreated && ( - + setCreateOrgIsVisible(true)} + > )} diff --git a/src/pages/Organization/index.js b/src/pages/Organization/index.js index e6501b3e..0556a2ba 100644 --- a/src/pages/Organization/index.js +++ b/src/pages/Organization/index.js @@ -1,12 +1,17 @@ -import React from 'react'; +import React, { useEffect } from 'react'; import { getMyOrgUid } from '../../utils/getMyOrgUid'; import { useSelector } from 'react-redux'; import styled from 'styled-components'; import QRCode from 'qrcode.react'; +import { useDispatch } from 'react-redux'; import { validateUrl } from '../../utils/urlUtils'; import { Body, CopyIcon, H2, H4 } from '../../components'; import { FormattedMessage } from 'react-intl'; +import { + activateProgressIndicator, + deactivateProgressIndicator, +} from '../../store/actions/app'; const StyledOrganizationContainer = styled('div')` padding: 30px 63px; @@ -44,6 +49,7 @@ const StyledCopyIconContainer = styled('div')` `; const Organization = () => { + const dispatch = useDispatch(); const { organizations } = useSelector(store => store.climateWarehouse); const myOrgUid = getMyOrgUid(organizations); const myOrganzation = organizations[myOrgUid]; @@ -51,6 +57,11 @@ const Organization = () => { return { __html: icon }; }; + useEffect(() => { + dispatch(activateProgressIndicator); + dispatch(deactivateProgressIndicator); + }, []); + return (