Skip to content

Commit

Permalink
Merge pull request #473 from sirraminyavari/dev-redesign
Browse files Browse the repository at this point in the history
fix(redesign): 💄 improve UI implementation of `rv-components`
  • Loading branch information
sorenabedi committed May 11, 2023
2 parents 06840b1 + e7ec591 commit ece3855
Show file tree
Hide file tree
Showing 25 changed files with 674 additions and 173 deletions.
17 changes: 15 additions & 2 deletions src/layouts/NewSidebar/MainSidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,14 @@ import { selectApplication } from 'store/slice/applications/selectors';
import { useHistory } from 'react-router-dom';
import { decodeBase64 } from 'helpers/helpers';
import styles from './sidebarStyles.module.scss';
import { CLASSES_PATH, HOME_PATH } from 'constant/constants';
import {
CLASSES_PATH,
CONFIG_GROUPS_PATH,
CONFIG_USERS_PATH,
HOME_PATH,
PROFILE_USER,
TEAM_SETTINGS_PATH,
} from 'constant/constants';

const PrimarySidebar = () => {
const history = useHistory();
Expand All @@ -25,10 +32,16 @@ const PrimarySidebar = () => {

switch (true) {
case history.location.pathname.startsWith(CLASSES_PATH):
case history.location.pathname.startsWith(
TEAM_SETTINGS_PATH.replace('/:id', '')
):
case history.location.pathname === CONFIG_USERS_PATH:
case history.location.pathname === CONFIG_GROUPS_PATH:
case history.location.pathname === `/${PROFILE_USER}`:
setIsSubMenuToggled(true);
break;
case history.location.pathname === HOME_PATH:
setIsSubMenuToggled(true);
setIsSubMenuToggled(false);
break;

default:
Expand Down
159 changes: 159 additions & 0 deletions src/layouts/NewSidebar/sidebarContents/sidebarContentsEmptyAction.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
import {
ChartColumnBarSvg,
ChatBubblesSvg,
CMLogoSvg,
DashboardSvg,
HammerWrenchSvg,
HomeSvg,
MenuSvg,
NotificationSvg,
PeopleCircleSvg,
PersonSvg,
SettingsSvg,
SocialSvg,
} from '@cliqmind/rv-components';
import {
CLASSES_PATH,
CONFIG_GROUPS_PATH,
CONFIG_USERS_PATH,
DASHBOARD_PATH,
HOME_PATH,
MESSAGES_PATH,
REPORTS_PATH,
TEAM_SETTINGS_PATH,
TEMPLATES_SETTING_PATH,
} from 'constant/constants';
import { SidebarContentFunction } from './useSidebarContent';
import SidebarContentDefault from './sidebarContentsDefault';
import useWindowContext from 'hooks/useWindowContext';

const SidebarContentsEmptyAction: SidebarContentFunction<{}> = ({
isSubMenuToggled,
setIsSubMenuToggled,
history,
urlParams,
selectedApplication,
}) => {
const { RVGlobal } = useWindowContext();
const defaults = SidebarContentDefault({
history,
isSubMenuToggled,
setIsSubMenuToggled,
urlParams,
selectedApplication,
});

return {
mainSidebarPrimaryLinks: [
...(defaults?.mainSidebarPrimaryLinks || []),
{
Icon: CMLogoSvg,
title: '',
onClick: () => {},
noIndicator: true,
path: '/logo',
},

{
Icon: HomeSvg,
noIndicator: false,
onClick: () => {
history.push(CLASSES_PATH);
},
path: CLASSES_PATH,
},
// {
// Icon: NotificationSvg,
// noIndicator: false,
// onClick: () => {
// history.push(HOME_PATH);
// },
// path: '/notifications',
// },
{
Icon: SocialSvg,
noIndicator: false,
onClick: () => {
history.push(HOME_PATH);
},
path: HOME_PATH,
},
...(RVGlobal.IsSystemAdmin
? [
// {
// Icon: BriefcaseSvg,
// noIndicator: false,
// onClick: () => {
// history.push(HOME_PATH);
// },
// path: '/work',
// },
{
Icon: ChatBubblesSvg,
noIndicator: false,
onClick: () => {
history.push(MESSAGES_PATH);
},
path: MESSAGES_PATH,
},
// {
// Icon: ShapesSvg,
// noIndicator: false,
// onClick: () => {
// history.push(HOME_PATH);
// },
// path: '/shapes',
// },
{
Icon: HammerWrenchSvg,
noIndicator: false,
onClick: () => {
history.push(TEMPLATES_SETTING_PATH);
},
path: TEMPLATES_SETTING_PATH,
},
{
Icon: DashboardSvg,
noIndicator: false,
onClick: () => {
history.push(DASHBOARD_PATH);
},
path: DASHBOARD_PATH,
},
{
Icon: ChartColumnBarSvg,
noIndicator: false,
onClick: () => {
history.push(REPORTS_PATH);
},
path: REPORTS_PATH,
},
...(selectedApplication?.ApplicationID
? [
{
Icon: SettingsSvg,
noIndicator: false,
onClick: () => {
history.push(
TEAM_SETTINGS_PATH.replace(
':id',
selectedApplication?.ApplicationID
)
);
},
path: TEAM_SETTINGS_PATH.replace(
':id',
selectedApplication?.ApplicationID
),
},
]
: []),
]
: []),
],
mainSidebarSecondaryLinks: [...(defaults?.mainSidebarSecondaryLinks || [])],
subSidebarLinks: [],
};
};

export default SidebarContentsEmptyAction;
35 changes: 0 additions & 35 deletions src/layouts/NewSidebar/sidebarContents/sidebarContentsNodePage.ts

This file was deleted.

35 changes: 0 additions & 35 deletions src/layouts/NewSidebar/sidebarContents/sidebarContentsProfile.ts

This file was deleted.

Loading

0 comments on commit ece3855

Please sign in to comment.