Skip to content

Commit

Permalink
feat: add organization page
Browse files Browse the repository at this point in the history
  • Loading branch information
danielstefanequilobe committed Mar 18, 2022
1 parent 729ef5e commit 1167439
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/components/blocks/LeftNav.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,11 @@ const LeftNav = withTheme(({ children }) => {
</MenuItem>
)}
{myOrgIsNotCreated && (
<MenuItem selected={createOrgIsVisible} to={window.location}>
<MenuItem
selected={createOrgIsVisible}
to={window.location}
onClick={() => setCreateOrgIsVisible(true)}
>
<FormattedMessage id="create-organization" />
</MenuItem>
)}
Expand Down
13 changes: 12 additions & 1 deletion src/pages/Organization/index.js
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -44,13 +49,19 @@ const StyledCopyIconContainer = styled('div')`
`;

const Organization = () => {
const dispatch = useDispatch();
const { organizations } = useSelector(store => store.climateWarehouse);
const myOrgUid = getMyOrgUid(organizations);
const myOrganzation = organizations[myOrgUid];
const createMarkup = icon => {
return { __html: icon };
};

useEffect(() => {
dispatch(activateProgressIndicator);
dispatch(deactivateProgressIndicator);
}, []);

return (
<StyledOrganizationContainer>
<div>
Expand Down

0 comments on commit 1167439

Please sign in to comment.