-
+
-
+ {showPages()}
diff --git a/apps/user-profile/src/context/SidebarDataContext.js b/apps/user-profile/src/context/SidebarDataContext.js
new file mode 100644
index 000000000..16ee8525d
--- /dev/null
+++ b/apps/user-profile/src/context/SidebarDataContext.js
@@ -0,0 +1,18 @@
+import { useReducer } from 'react';
+import constate from 'constate';
+import { sidebarReducer } from './../state/reducers';
+
+const useSidebarData = () => {
+ const [sidebarState, sidebarDispatch] = useReducer(
+ sidebarReducer.sidebarReducer,
+ sidebarReducer.sidebarInitialState
+ );
+ return {
+ sidebarState,
+ sidebarDispatch,
+ };
+};
+
+const [SidebarDataProvider, useSidebarDataContext] = constate(useSidebarData);
+
+export { SidebarDataProvider, useSidebarDataContext };
diff --git a/apps/user-profile/src/images/UserProfile/ideas.png b/apps/user-profile/src/images/UserProfile/ideas.png
deleted file mode 100644
index cfb87d147..000000000
Binary files a/apps/user-profile/src/images/UserProfile/ideas.png and /dev/null differ
diff --git a/apps/user-profile/src/images/UserProfile/naideas.png b/apps/user-profile/src/images/UserProfile/naideas.png
deleted file mode 100644
index a9496e57a..000000000
Binary files a/apps/user-profile/src/images/UserProfile/naideas.png and /dev/null differ
diff --git a/apps/user-profile/src/images/UserProfile/naopportunities.png b/apps/user-profile/src/images/UserProfile/naopportunities.png
deleted file mode 100644
index 32c39115a..000000000
Binary files a/apps/user-profile/src/images/UserProfile/naopportunities.png and /dev/null differ
diff --git a/apps/user-profile/src/images/UserProfile/naoverview.png b/apps/user-profile/src/images/UserProfile/naoverview.png
deleted file mode 100644
index c4ab584b5..000000000
Binary files a/apps/user-profile/src/images/UserProfile/naoverview.png and /dev/null differ
diff --git a/apps/user-profile/src/images/UserProfile/naprofiles.png b/apps/user-profile/src/images/UserProfile/naprofiles.png
deleted file mode 100644
index a0b4c7f01..000000000
Binary files a/apps/user-profile/src/images/UserProfile/naprofiles.png and /dev/null differ
diff --git a/apps/user-profile/src/images/UserProfile/naprojects.png b/apps/user-profile/src/images/UserProfile/naprojects.png
deleted file mode 100644
index e8c3982bd..000000000
Binary files a/apps/user-profile/src/images/UserProfile/naprojects.png and /dev/null differ
diff --git a/apps/user-profile/src/images/UserProfile/opportunities.png b/apps/user-profile/src/images/UserProfile/opportunities.png
deleted file mode 100644
index f632e303c..000000000
Binary files a/apps/user-profile/src/images/UserProfile/opportunities.png and /dev/null differ
diff --git a/apps/user-profile/src/images/UserProfile/overview.png b/apps/user-profile/src/images/UserProfile/overview.png
deleted file mode 100644
index 693b4ef85..000000000
Binary files a/apps/user-profile/src/images/UserProfile/overview.png and /dev/null differ
diff --git a/apps/user-profile/src/images/UserProfile/profiles.png b/apps/user-profile/src/images/UserProfile/profiles.png
deleted file mode 100644
index ed97dffc3..000000000
Binary files a/apps/user-profile/src/images/UserProfile/profiles.png and /dev/null differ
diff --git a/apps/user-profile/src/images/UserProfile/projects.png b/apps/user-profile/src/images/UserProfile/projects.png
deleted file mode 100644
index 6db2b109c..000000000
Binary files a/apps/user-profile/src/images/UserProfile/projects.png and /dev/null differ
diff --git a/apps/user-profile/src/pages/users/[userId].js b/apps/user-profile/src/pages/users/[userId].js
index 364c56ec6..8e330cf0d 100644
--- a/apps/user-profile/src/pages/users/[userId].js
+++ b/apps/user-profile/src/pages/users/[userId].js
@@ -2,6 +2,7 @@ import React from 'react';
import axios from 'axios';
import UserProfile from '../../components/modules/UserProfile';
+import { SidebarDataProvider } from './../../context/SidebarDataContext';
export const getStaticPaths = async () => {
return {
@@ -33,7 +34,9 @@ export const getStaticProps = async (context) => {
export default function UserProfilePage({ user }) {
return (
-
+
+
+
);
}
diff --git a/apps/user-profile/src/pages/users/me.js b/apps/user-profile/src/pages/users/me.js
index 69310a9ca..2939abed7 100644
--- a/apps/user-profile/src/pages/users/me.js
+++ b/apps/user-profile/src/pages/users/me.js
@@ -13,6 +13,7 @@ import {
UseOnboardingData,
useOnboardingDataContext,
} from '../../context/OnboardingDataContext';
+import { SidebarDataProvider } from './../../context/SidebarDataContext';
/**
* @drescription This component renders the User Profile Component.
@@ -64,7 +65,9 @@ export default function UserProfilePage(props) {
}}
/>
)}
-
+
+
+
>
) : (
diff --git a/apps/user-profile/src/state/actions/index.js b/apps/user-profile/src/state/actions/index.js
index f9978a66c..6551a1462 100644
--- a/apps/user-profile/src/state/actions/index.js
+++ b/apps/user-profile/src/state/actions/index.js
@@ -1,3 +1,4 @@
export * as onboardingActions from './onboardingActions';
export * as editProfileActions from './editProfileActions';
export * as userProfileActions from './userProfileActions';
+export * as sidebarActions from './sidebarActions';
diff --git a/apps/user-profile/src/state/actions/sidebarActions.js b/apps/user-profile/src/state/actions/sidebarActions.js
new file mode 100644
index 000000000..6f93fffb3
--- /dev/null
+++ b/apps/user-profile/src/state/actions/sidebarActions.js
@@ -0,0 +1,27 @@
+const SHOW_OVERVIEW_SETTING = 'Show overview settings.';
+const HIDE_OVERVIEW_SETTING = 'Hide overview settings.';
+
+const SHOW_PROJECTS_SETTING = 'Show projects settings.';
+const HIDE_PROJECTS_SETTING = 'Hide projects settings.';
+
+const SHOW_PROFILES_SETTING = 'Show profiles settings.';
+const HIDE_PROFILES_SETTING = 'Hide profiles settings.';
+
+const SHOW_IDEAS_SETTING = 'Show ideas settings.';
+const HIDE_IDEAS_SETTING = 'Hide ideas settings.';
+
+const SHOW_OPPORTUNITIES_SETTING = 'Show opportunities settings.';
+const HIDE_OPPORTUNITIES_SETTING = 'Hide opportunities settings.';
+
+export {
+ SHOW_OVERVIEW_SETTING,
+ HIDE_OVERVIEW_SETTING,
+ SHOW_PROJECTS_SETTING,
+ HIDE_PROJECTS_SETTING,
+ SHOW_PROFILES_SETTING,
+ HIDE_PROFILES_SETTING,
+ SHOW_IDEAS_SETTING,
+ HIDE_IDEAS_SETTING,
+ SHOW_OPPORTUNITIES_SETTING,
+ HIDE_OPPORTUNITIES_SETTING,
+};
diff --git a/apps/user-profile/src/state/reducers/index.js b/apps/user-profile/src/state/reducers/index.js
index f97bc0cde..44bed8f93 100644
--- a/apps/user-profile/src/state/reducers/index.js
+++ b/apps/user-profile/src/state/reducers/index.js
@@ -1,3 +1,4 @@
export * as onboardingReducer from './onboardingReducer';
export * as editProfileReducer from './editProfileReducer';
export * as userProfileReducer from './userProfileReducer';
+export * as sidebarReducer from './sidebarReducer';
diff --git a/apps/user-profile/src/state/reducers/sidebarReducer.js b/apps/user-profile/src/state/reducers/sidebarReducer.js
new file mode 100644
index 000000000..ca3e09fe4
--- /dev/null
+++ b/apps/user-profile/src/state/reducers/sidebarReducer.js
@@ -0,0 +1,128 @@
+import { sidebarActions } from './../actions';
+
+const sidebarInitialState = {
+ pages: {
+ showOverview: true,
+ showProjects: false,
+ },
+};
+
+const sidebarReducer = (state, action) => {
+ switch (action.type) {
+ case sidebarActions.SHOW_OVERVIEW_SETTING: {
+ return {
+ ...state,
+ pages: {
+ ...state.pages,
+ showOverview: true,
+ showProjects: false,
+ showProfiles: false,
+ showIdeas: false,
+ showOpportunities: false,
+ },
+ };
+ }
+ case sidebarActions.HIDE_OVERVIEW_SETTING: {
+ return {
+ ...state,
+ pages: {
+ ...state.pages,
+ showOverview: false,
+ },
+ };
+ }
+ case sidebarActions.SHOW_PROJECTS_SETTING: {
+ return {
+ ...state,
+ pages: {
+ ...state.pages,
+ showOverview: false,
+ showProjects: true,
+ showProfiles: false,
+ showIdeas: false,
+ showOpportunities: false,
+ },
+ };
+ }
+ case sidebarActions.HIDE_PROJECTS_SETTING: {
+ return {
+ ...state,
+ pages: {
+ ...state.pages,
+ showProjects: false,
+ },
+ };
+ }
+ case sidebarActions.SHOW_PROFILES_SETTING: {
+ return {
+ ...state,
+ pages: {
+ ...state.pages,
+ showOverview: false,
+ showProjects: false,
+ showProfiles: true,
+ showIdeas: false,
+ showOpportunities: false,
+ },
+ };
+ }
+ case sidebarActions.HIDE_PROFILES_SETTING: {
+ return {
+ ...state,
+ pages: {
+ ...state.pages,
+ showProfiles: false,
+ },
+ };
+ }
+ case sidebarActions.SHOW_IDEAS_SETTING: {
+ return {
+ ...state,
+ pages: {
+ ...state.pages,
+ showOverview: false,
+ showProjects: false,
+ showProfiles: false,
+ showIdeas: true,
+ showOpportunities: false,
+ },
+ };
+ }
+ case sidebarActions.HIDE_IDEAS_SETTING: {
+ return {
+ ...state,
+ pages: {
+ ...state.pages,
+ showIdeas: false,
+ },
+ };
+ }
+ case sidebarActions.SHOW_OPPORTUNITIES_SETTING: {
+ return {
+ ...state,
+ pages: {
+ ...state.pages,
+ showOverview: false,
+ showProjects: false,
+ showProfiles: false,
+ showIdeas: false,
+ showOpportunities: true,
+ },
+ };
+ }
+ case sidebarActions.HIDE_OPPORTUNITIES_SETTING: {
+ return {
+ ...state,
+ pages: {
+ ...state.pages,
+ showOpportunities: false,
+ },
+ };
+ }
+ default: {
+ return state;
+ }
+ }
+};
+
+export { sidebarReducer, sidebarInitialState };