Skip to content

Commit

Permalink
fix: clean code
Browse files Browse the repository at this point in the history
remove dashboard from getLearnerHeaderMenu to cleane the code
  • Loading branch information
mubbsharanwar committed Jul 25, 2024
1 parent eddb511 commit 69f813c
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ const getLearnerHeaderMenu = (
formatMessage,
courseSearchUrl,
authenticatedUser,
dashboard,
exploreCoursesClick,
) => ({
mainMenu: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@ exports[`LearnerDashboardHeader render 1`] = `
<ConfirmEmailBanner />
<injectIntl(ShimmedIntlComponent)
mainMenuItems={
Array [
Object {
[
{
"content": "Courses",
"href": "/",
"isActive": true,
"type": "item",
},
Object {
{
"content": "Programs",
"href": "http://localhost:18000/dashboard/programs",
"type": "item",
},
Object {
{
"content": "Discover New",
"href": "undefined",
"onClick": [Function],
Expand All @@ -26,35 +26,35 @@ exports[`LearnerDashboardHeader render 1`] = `
]
}
secondaryMenuItems={
Array [
Object {
[
{
"content": "Help",
"href": "http://localhost:18000/support",
"type": "item",
},
]
}
userMenuItems={
Array [
Object {
[
{
"heading": "",
"items": Array [
Object {
"items": [
{
"content": "Profile",
"href": "http://account-profile-url.test/u/undefined",
"type": "item",
},
Object {
{
"content": "Account",
"href": "http://account-settings-url.test",
"type": "item",
},
],
},
Object {
{
"heading": "",
"items": Array [
Object {
"items": [
{
"content": "Sign Out",
"href": "http://localhost:18000/logout",
"type": "item",
Expand Down
4 changes: 2 additions & 2 deletions src/containers/LearnerDashboardHeader/hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ export const findCoursesNavDropdownClicked = (href) => track.findCourses.findCou
});

export const useLearnerDashboardHeaderMenu = ({
courseSearchUrl, authenticatedUser, dashboard, exploreCoursesClick,
courseSearchUrl, authenticatedUser, exploreCoursesClick,
}) => {
const { formatMessage } = useIntl();
return getLearnerHeaderMenu(formatMessage, courseSearchUrl, authenticatedUser, dashboard, exploreCoursesClick);
return getLearnerHeaderMenu(formatMessage, courseSearchUrl, authenticatedUser, exploreCoursesClick);
};

export const useLearnerDashboardHeaderData = () => {
Expand Down
2 changes: 0 additions & 2 deletions src/containers/LearnerDashboardHeader/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import './index.scss';
export const LearnerDashboardHeader = () => {
const { authenticatedUser } = React.useContext(AppContext);
const { courseSearchUrl } = reduxHooks.usePlatformSettingsData();
const dashboard = reduxHooks.useEnterpriseDashboardData();

const exploreCoursesClick = findCoursesNavClicked(
urls.baseAppUrl(courseSearchUrl),
Expand All @@ -24,7 +23,6 @@ export const LearnerDashboardHeader = () => {
const learnerHomeHeaderMenu = useLearnerDashboardHeaderMenu({
courseSearchUrl,
authenticatedUser,
dashboard,
exploreCoursesClick,
});

Expand Down

0 comments on commit 69f813c

Please sign in to comment.