This commit is contained in:
elforjani3
2021-03-11 19:35:06 +02:00
62 changed files with 921 additions and 378 deletions

View File

@@ -14,7 +14,7 @@ function PageFade(props) {
}
export default function AuthenticationWrapper({ ...rest }) {
const to = { pathname: '/homepage' };
const to = { pathname: '/' };
const location = useLocation();
const isAuthenticated = useIsAuthenticated();
const locationKey = location.pathname;

View File

@@ -24,6 +24,9 @@ import withSettings from 'containers/Settings/withSettings';
import QuickNewDropdown from 'containers/QuickNewDropdown/QuickNewDropdown';
import { compose } from 'utils';
/**
* Dashboard topbar.
*/
function DashboardTopbar({
// #withDashboard
pageTitle,
@@ -116,11 +119,7 @@ function DashboardTopbar({
<div class="dashboard__breadcrumbs">
<DashboardBreadcrumbs />
</div>
{/* <div class="dashboard__organization-name">
{ organizationName }
</div> */}
<DashboardBackLink />
</div>

View File

@@ -9,7 +9,7 @@ export default function Sidebar() {
return (
<SidebarContainer>
<SidebarHead />
<div className="sidebar__menu">
<SidebarMenu />
</div>

View File

@@ -1,12 +1,66 @@
import React from 'react';
import appMeta from 'config/app';
import { Button, Popover, Menu, Position } from '@blueprintjs/core';
import Icon from 'components/Icon';
export default function() {
import { useAuthUser } from 'hooks/state';
import withSettings from 'containers/Settings/withSettings';
import { compose, firstLettersArgs } from 'utils';
// Popover modifiers.
const POPOVER_MODIFIERS = {
offset: { offset: '20, 8' },
};
/**
* Sideabr head.
*/
function SidebarHead({
// #withSettings
organizationName,
}) {
const user = useAuthUser();
return (
<div className="sidebar__head">
<div className="sidebar__head-organization">
<Popover
modifiers={POPOVER_MODIFIERS}
content={
<Menu className={'menu--dashboard-organization'}>
<div class="org-item">
<div class="org-item__logo">
{firstLettersArgs(...organizationName.split(' '))}{' '}
</div>
<div class="org-item__name">{organizationName}</div>
</div>
</Menu>
}
position={Position.BOTTOM}
minimal={true}
>
<Button
className="title"
rightIcon={<Icon icon={'caret-down-16'} size={16} />}
>
{organizationName}
</Button>
</Popover>
<span class="subtitle">{user.full_name}</span>
</div>
<div className="sidebar__head-logo">
<Icon icon={'bigcapital'} width={140} height={28} className="bigcapital--alt" />
<Icon
icon={'mini-bigcapital'}
width={140}
height={28}
className="bigcapital--alt"
/>
</div>
</div>
);
};
}
export default compose(
withSettings(({ organizationSettings }) => ({
organizationName: organizationSettings.name,
})),
)(SidebarHead);